Skip to content

feat: add platform override #5960

Merged
ruben-arts merged 6 commits intoprefix-dev:mainfrom
DaniAffCH:override-platform
Apr 29, 2026
Merged

feat: add platform override #5960
ruben-arts merged 6 commits intoprefix-dev:mainfrom
DaniAffCH:override-platform

Conversation

@DaniAffCH
Copy link
Copy Markdown
Contributor

@DaniAffCH DaniAffCH commented Apr 26, 2026

Description

Adds support for the PIXI_OVERRIDE_PLATFORM environment variable, allowing users to install packages for a foreign architecture. It is useful for cross-compilation workflows where target dependencies need to be present on the host machine.

As suggested in #5918, I went with an env var rather than a new CLI flag.

A few design choices worth mentioning:

  • If the value doesn't match a valid Platform, pixi raises a warning panics. Silently falling back to the host platform felt wrong since the user clearly has a different intention.
  • The emulation warning is skipped when the override is set. To my understanding, the warning exists to notify users of an automatic fallback they didn't ask for. With an explicit override, there's no implicit fallback, so the warning doesn't apply.

Note: I'm not familiar with Rust at all, so feel free to point out if something can be improved!
Fixes #5918

How Has This Been Tested?

Added two unit tests: test_best_platform_override_env_var and test_best_platform_override_invalid_value.
I also manually tested it on a linux-64 host by running:

PIXI_OVERRIDE_PLATFORM=linux-aarch64 pixi install

and verified the installed libraries are aarch64.

AI Disclosure

This PR doesn't contain AI-generated code.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

@DaniAffCH DaniAffCH changed the title add platform override feat: add platform override Apr 26, 2026
@baszalmstra
Copy link
Copy Markdown
Contributor

Thanks for this!

Lets just return a proper warning instead of panicking!

@DaniAffCH
Copy link
Copy Markdown
Contributor Author

DaniAffCH commented Apr 26, 2026

Lets just return a proper warning instead of panicking!

Done! Now it raises a warning and falls back on the local platform. Thanks for your quick review

Copy link
Copy Markdown
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added docs, looks good to me now.

@ruben-arts ruben-arts enabled auto-merge (squash) April 29, 2026 08:42
@ruben-arts ruben-arts merged commit 4acf4e7 into prefix-dev:main Apr 29, 2026
41 checks passed
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 install support installing foreign-arch envs for cross-compilation

3 participants