feat(platforms): validate __archspec microarchitecture names - #6701
Merged
Conversation
`__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.
baszalmstra
reviewed
Jul 28, 2026
baszalmstra
enabled auto-merge (squash)
July 29, 2026 09:24
baszalmstra
approved these changes
Jul 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Tools: Claude
Checklist:
schema/model.py.