feat: Add configuration options to control package link modes#5525
Merged
ruben-arts merged 10 commits intoprefix-dev:mainfrom May 6, 2026
Merged
Conversation
ruben-arts
requested changes
Feb 20, 2026
Contributor
ruben-arts
left a comment
There was a problem hiding this comment.
The --no-ref-links is setup to work for pixi install but the config is not hooked up yet.
pixi config set allow-ref-links false doesn't work and as a fly by issue the config in a local to the project config file doesn't work at all. Maybe something your friend can do in a fly by fix?
9c2860c to
18350d5
Compare
Adds configuration options to control which installation methods (hardlinks, reflinks, symlinks) are allowed during package installation. This is useful for HPC environments like Lustre where reflinks consume excessive inodes. Configuration options: - `allow-symbolic-links`: Allow/disallow symbolic links (default: true) - `allow-hard-links`: Allow/disallow hard links (default: true) - `allow-ref-links`: Allow/disallow copy-on-write/reflinks (default: true) These can be set in ~/.pixi/config.toml: ```toml allow-ref-links = false allow-hard-links = true ``` Or via CLI flags: `--no-ref-links`, `--no-hard-links`, `--no-symbolic-links` Or via environment variables: `PIXI_NO_REF_LINKS`, `PIXI_NO_HARD_LINKS`, etc. Implementation details: - Conda: Integrated via rattler's LinkOptions passed to Installer - PyPI: Integrated via uv's LinkMode with derive_link_mode() helper - Config flows through CommandDispatcher to both installers Closes prefix-dev#5332
Pass the user-configured link mode (derived from allow_symbolic_links, allow_hard_links, allow_ref_links config) through to UvBuildDispatchParams when building PyPI source distributions during dependency resolution. This ensures the link mode restrictions are respected not just during installation, but also when building wheels from source during the solve phase.
The allow-symbolic-links, allow-hard-links, and allow-ref-links config keys were registered in get_keys() and deserialized from TOML, but the set() method was missing match arms for them — causing `pixi config set allow-ref-links false` to fail with "Unknown key". Also add the keys to partial_config() so `pixi config list` can display them individually. https://claude.ai/code/session_014vnQN14HgHrid7ZrHjnWGD
Add test_config_allow_links that verifies: - `pixi config set --local allow-ref-links false` works - `pixi config list` shows the set values - `pixi config list <key>` shows individual key values - The local .pixi/config.toml file is written correctly - `pixi config unset` removes a key - Setting a value to true also works Also add --no-ref-links, --no-hard-links, --no-symbolic-links CLI flag tests to the existing test_cli_config_options test. https://claude.ai/code/session_014vnQN14HgHrid7ZrHjnWGD
- Collapse derive_link_mode into a single allowance predicate plus an ordered fallback scan, dropping the redundant default-allowed branch and the narration comments. - Drop the trivial Config::allow_symbolic_links/hard_links/ref_links accessors and read the public fields directly at call sites. - Hoist the per-environment derive_link_mode call out of the PyPI solve loop in UpdateContext::update so it is computed once per workspace. - Replace the if/else chains in From<ConfigCli> for Config with bool::then_some.
The --no-*-links flags need to appear on every command that exposes ConfigCli; pixi publish was missed when the docs were last regenerated.
18350d5 to
103b47a
Compare
2 tasks
ruben-arts
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds three new configuration options to control which link modes are allowed during package installation:
allow-symbolic-links/PIXI_NO_SYMBOLIC_LINKS: Disallow symbolic linksallow-hard-links/PIXI_NO_HARD_LINKS: Disallow hard linksallow-ref-links/PIXI_NO_REF_LINKS: Disallow ref links (copy-on-write)These options enable users to restrict package installation methods based on their environment requirements. The implementation includes:
Configuration layer (
pixi_config):--no-symbolic-links,--no-hard-links,--no-ref-links) with corresponding environment variablesallow_symbolic_links,allow_hard_links,allow_ref_links)Link mode derivation (
pixi_install_pypi):derive_link_mode()function that implements a fallback chain:Integration:
CommandDispatcherandCommandDispatcherBuilderLinkOptions) and PyPI package installationThe configuration respects the standard precedence: CLI flags override config file settings, which override defaults.
Fixes #5332
How Has This Been Tested?
AI Disclosure
Tools: Claude Code Opus 4.6 Extended
Checklist:
schema/model.py.