Skip to content

fix: Handle CONDA_OVERRIDE_* in pixi global install#6335

Open
hunger wants to merge 5 commits into
prefix-dev:mainfrom
hunger:push-ruoslnwqkzvl
Open

fix: Handle CONDA_OVERRIDE_* in pixi global install#6335
hunger wants to merge 5 commits into
prefix-dev:mainfrom
hunger:push-ruoslnwqkzvl

Conversation

@hunger

@hunger hunger commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

This is a counter proposal to PR #6325 by @baszalmstra.

The issue that go reported is basically that pixi global install ignores CONDA_OVERRIDE_* variables. The user was using CONDA_OVERRIDE_CUDA=12 to limit his support to a version lower than what was available on his machine and pixi install still installing for __cuda=13.

So we need to take CONDA_OVERRIDE_* into account. This change uses the auto-detected rich platform as a base line (which takes CONDA_OVERRIDE_* into accound), and stores the minimum and the version an environment was resolved for in the generated environment, so that the information does not get lost between runs.

@baszalmstra PR #6325 used system requirements table to the pixi-global toml manifest for this

Fixes: #6323

@hunger

hunger commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

The more I think about it: I should store a conda-meta/pixi file with resolved platform and minimal platform, just like I do for "local" environments. That is inherently environment specific information. I'll change this.

@hunger hunger force-pushed the push-ruoslnwqkzvl branch from 4a7ef48 to 030f755 Compare June 11, 2026 11:10
hunger added 4 commits June 15, 2026 16:44
Pull the per-subdir core of compute_minimal_required_platforms into a public
minimal_required_virtual_packages(&[&str]) so pixi global can derive the same
minimum-platform set from an installed environment's records.
Make EnvironmentFile, its fields, LockedEnvironmentHash::invalid and
write_environment_file public, and add PlatformData::new, so pixi global can
write the same conda-meta/pixi marker that workspace environments do.
…x-dev#6323)

Solve pixi global environments against machine-detected virtual packages via
VirtualPackageOverrides::from_env(), so CONDA_OVERRIDE_* (e.g.
CONDA_OVERRIDE_CUDA=12.0) is honored and run constraints on virtual packages
are respected. Record the resolved platform and the minimum-supported platform
in the environment's conda-meta/pixi marker, reusing the EnvironmentFile,
PlatformData and minimal-platform code shared with non-global environments.

Fixes prefix-dev#6323.
Document that pixi global records the resolved and minimum-supported platform
in an environment's conda-meta/pixi marker and how CONDA_OVERRIDE_* feeds the
solve.
@hunger hunger force-pushed the push-ruoslnwqkzvl branch from 030f755 to 497b857 Compare June 15, 2026 17:05
@hunger

hunger commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

@baszalmstra: Simplified it a bit more and store the data on the platform used to resolve in the environment itself.

Works now:-)

@hunger hunger requested a review from Hofer-Julian June 16, 2026 10:05
Comment thread crates/pixi_core/src/environment/mod.rs
Comment thread docs/global_tools/manifest.md Outdated
Install the `cuda` package from the virtual packages channel in test data
with and without CUDA version overrides and verify the override works.
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

2 participants