Skip to content

feat(platforms): validate __archspec microarchitecture names - #6701

Merged
baszalmstra merged 2 commits into
prefix-dev:mainfrom
hunger:push-xxwportlromk
Jul 29, 2026
Merged

feat(platforms): validate __archspec microarchitecture names#6701
baszalmstra merged 2 commits into
prefix-dev:mainfrom
hunger:push-xxwportlromk

Conversation

@hunger

@hunger hunger commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Description

These should be the uncontroversial parts of #6533:

A bug fix on how we handle extra = in build strings and rejecting invalid archspecs when a user provides one.

How Has This Been Tested?

Unit tests :-)

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

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.

hunger added 2 commits July 28, 2026 15:51
`__archspec` build strings name a CPU microarchitecture, not a version, and
only names the bundled archspec database knows can ever be reported by a
host. Pixi accepted anything, so a typo silently produced a platform that
never matches -- and pixi's own docs suggested `x86-64-v3` and `armv8-a`,
neither of which is a valid archspec name (conda build strings cannot
contain '-').

Validate the name in every user-facing parser -- the friendly `archspec`
key, the raw `__archspec = "version=build"` escape hatch, and
`pixi workspace platform add/edit` -- through one shared helper, so the
manifest and the CLI accept exactly the same values. Unknown names are
rejected with a did-you-mean suggestion: the underscore spelling when that
is what was meant, otherwise the closest database entry.

Also collapses the three hand-rolled copies of the "empty or 0 means
unknown microarchitecture" encoding into `archspec_microarchitecture`, and
corrects the invalid examples in the docs, the JSON schema and the CLI help.

BREAKING: a manifest declaring an unknown `__archspec` name now fails to
parse instead of producing a platform no host can match.
@hunger
hunger requested a review from baszalmstra July 28, 2026 15:02
Comment thread crates/pixi_cli/src/workspace/platform.rs
@hunger hunger changed the title Archspec-related small things feat(platforms): validate __archspec microarchitecture names Jul 28, 2026
@baszalmstra
baszalmstra enabled auto-merge (squash) July 29, 2026 09:24
@baszalmstra
baszalmstra merged commit c54e4af into prefix-dev:main Jul 29, 2026
39 of 40 checks passed
@hunger
hunger deleted the push-xxwportlromk branch July 29, 2026 09:26
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.

2 participants