Skip to content

feat: support CONDA_OVERRIDE_* in pixi global#6325

Open
baszalmstra wants to merge 3 commits into
prefix-dev:mainfrom
baszalmstra:claude/wonderful-fermi-23iylq
Open

feat: support CONDA_OVERRIDE_* in pixi global#6325
baszalmstra wants to merge 3 commits into
prefix-dev:mainfrom
baszalmstra:claude/wonderful-fermi-23iylq

Conversation

@baszalmstra

Copy link
Copy Markdown
Contributor

Description

pixi global ignored the CONDA_OVERRIDE_* environment variables when solving environments. A package constrained by a virtual package like __cuda could 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 update and pixi global sync solve from, overrides that are set during pixi global install are also recorded in the manifest as system requirements:

[envs.cuda-tool.system-requirements]
cuda = "12.0"

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?

  • Unit tests for parsing, recording and the precedence of the requirements
  • Integration tests covering a failing install with a too low override, recording on install, re-solving from the manifest without the environment variable, and the environment variable winning over the recorded value
  • Manually verified the reproduction steps from pixi ignoring run constraints on virtual packages #6323

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude Code

Checklist:

  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.

claude added 2 commits June 9, 2026 21:00
… 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
@hunger

hunger commented Jun 10, 2026

Copy link
Copy Markdown
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
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.

pixi ignoring run constraints on virtual packages

3 participants