Skip to content

Dereference symlinked config before copying#1944

Open
tiferrei wants to merge 1 commit into
apple:mainfrom
tiferrei:main
Open

Dereference symlinked config before copying#1944
tiferrei wants to merge 1 commit into
apple:mainfrom
tiferrei:main

Conversation

@tiferrei

Copy link
Copy Markdown

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Motivation and Context

When ~/.config/container/config.toml is a symbolic link, FileManager.copyItem preserves the link when copying it into the application support directory. This causes the runtime configuration snapshot to remain tied to the original file, which is problematic for declaratively managed, read-only configurations such as those installed through Nix.

Resolve the source path before copying so the application support configuration is always an independent file.

Testing

  • Tested locally
  • Added/updated tests
  • Added/updated docs

Added a regression test that verifies a symlinked source produces a regular destination that remains readable after removing the source target. The test fails without the fix, and the full test suite passes with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant