Skip to content

fix: resolve rich platforms in workspace export conda-explicit-spec - #6551

Merged
hunger merged 3 commits into
prefix-dev:mainfrom
MridulS:fix/conda-explicit-spec-rich-platforms
Jul 27, 2026
Merged

fix: resolve rich platforms in workspace export conda-explicit-spec#6551
hunger merged 3 commits into
prefix-dev:mainfrom
MridulS:fix/conda-explicit-spec-rich-platforms

Conversation

@MridulS

@MridulS MridulS commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Description

pixi workspace export conda-explicit-spec looked up platforms by conda subdir. Rich platforms are keyed in the lock file under generated aliases, so the lookup returned None and the command failed with platform 'osx-arm64' not found for env <env>.

How Has This Been Tested?

platforms = [
  { name = "nvidia-orin-cuda13", platform = "linux-aarch64", cuda = { driver = "13", arch = "8.7" }, glibc = "2.35" },
  { name = "x86-cuda13", platform = "linux-64", cuda = "13", glibc = "2.35" },
  { name = "aarch64-cuda13", platform = "linux-aarch64", cuda = "13", glibc = "2.35" },
  { name = "x86-cpu", platform = "linux-64", glibc = "2.35" },
  { name = "aarch64-cpu", platform = "linux-aarch64", glibc = "2.35" },
  { name = "osx-arm64-cuda", platform = "osx-arm64", cuda = "12" },
  { name = "osx-arm64-cpu", platform = "osx-arm64" },
]

On main this errors with platform 'osx-arm64' not found for env default. With only the lookup fixed it writes three subdir-named files, silently dropping four of the seven platforms. With this PR all seven are exported under their own names, and a subdir expands to every platform on it:

$ pixi workspace export conda-explicit-spec -p linux-aarch64 out/
out/default_aarch64-cpu_conda_spec.txt          # 62 lines
out/default_aarch64-cuda13_conda_spec.txt       # 92 lines
out/default_nvidia-orin-cuda13_conda_spec.txt   # 92 lines

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 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.

@MridulS, sorry for blundly taking over your PR but this should be a fix that works for all rich platforms now.

Comment on lines +111 to +118
// Resolve the conda subdir to the environment's platform entry. Rich
// platforms (platforms carrying system-requirements) are stored in the lock
// file under generated aliases (e.g. `p1`, `p2`) rather than their subdir
// name, so we cannot look them up by `platform.to_string()`. Instead, match
// on the subdir of each platform the environment actually provides.
let lock_platform =
env.platforms()
.find(|p| p.subdir() == *platform)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does this just match any rich platform of the same subdir? What if there are multiple?

@hunger hunger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for looking into this!

@hunger
hunger merged commit 2ff3728 into prefix-dev:main Jul 27, 2026
39 checks passed
@MridulS

MridulS commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

@hunger @ruben-arts thanks for getting this fixed!!

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.

4 participants