feat: support CONDA_OVERRIDE_* in pixi global#6325
Open
baszalmstra wants to merge 3 commits into
Open
Conversation
… in the manifest `pixi global` detected virtual packages with `VirtualPackageOverrides::default()`, which ignores the `CONDA_OVERRIDE_*` environment variables. As a result a package with a run dependency or constraint on e.g. `__cuda` could be installed even though the override said otherwise (prefix-dev#6323). Because the global manifest is what `pixi global update`/`sync` re-solve from, just reading the environment variables at install time is not enough: the next update would silently re-solve without them. Overrides that are set during `pixi global install` are therefore recorded in the manifest as a `system-requirements` table per environment, using the same format as workspace system requirements: ```toml [envs.cuda-tool.system-requirements] cuda = "12.0" ``` When solving a global environment the precedence is: 1. `CONDA_OVERRIDE_*` environment variables, so recorded values can always be overridden ephemerally, 2. the `system-requirements` recorded in the manifest, 3. the virtual packages detected on the machine. Also switch the virtual package detection fallbacks in `pixi_command_dispatcher` (tool platform and build environments) to `VirtualPackageOverrides::from_env()` so they honor the override environment variables as well, consistent with `pixi exec` and the workspace code paths. Fixes prefix-dev#6323 https://claude.ai/code/session_01QGmyPuprYpTw1N7umFdvje
Reading the `CONDA_OVERRIDE_*` environment variables should not happen implicitly in `BuildEnvironment::default()` and `simple_cross()`. Also drop the incorrect workspace comparison from the global manifest docs: workspace solves use system-requirements, not the override environment variables. https://claude.ai/code/session_01QGmyPuprYpTw1N7umFdvje
Contributor
|
I let my claude do a counter proposal using rich platforms over system requirements here: #6335 |
The recorded values act as overrides for the detected virtual packages rather than as minimum requirements, so name the manifest table accordingly. https://claude.ai/code/session_01QGmyPuprYpTw1N7umFdvje
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
pixi globalignored theCONDA_OVERRIDE_*environment variables when solving environments. A package constrained by a virtual package like__cudacould therefore be installed even though the override said the system does not satisfy it.The overrides are now taken into account. Since the global manifest is what
pixi global updateandpixi global syncsolve from, overrides that are set duringpixi global installare also recorded in the manifest as system requirements:The table can also be edited by hand and supports the same fields as the workspace system requirements. The environment variables always take precedence over the recorded values, so they can be overridden ephemerally at any time.
Fixes #6323
How Has This Been Tested?
AI Disclosure
Tools: Claude Code
Checklist: