feat: Improve __archspec handling in pixi#6533
Conversation
Both host-compatibility comparators (possible_pixi_platforms and unsatisfied_virtual_packages) ignored build strings, so a declared build-string requirement constrained nothing. Unify them on one shared predicate: a non-empty required build string must be provided exactly. __archspec is exempt for now; its microarchitecture names need DAG compatibility rather than string equality, which lands separately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
CI is read as this needs conda/rattler#2558 |
|
No special handling is needed now that conda-forge/microarch-level-feedstock#26 is merged ! |
|
We might want to do more than comparing the |
|
With the PR merged in microarch-level feedstock, the lockfile is now valid for multiple archspecs "automatically". It uses a regex that matches on all compatible archspec names. This means that if you lock "haswell" the environment will also be satisfiable on skylake automatically. Because of that, we don't need to treat the inheritance of microarchitectures in any special way. It's captured by the requirements/constraints of the microarch-level packages. |
|
I am aware of that. I still need to handle virtual packages in a couple of places that are not resolution. That needs a bit of support code. |
When pixi checks whether the current host can run a declared platform, a host satisfies an __archspec requirement if its detected microarchitecture implements the required baseline (the same node or a descendant in the archspec DAG); the meaningless version constant is ignored. This replaces the build-string exemption in the shared predicate used for rich-platform selection and the conda-meta marker, and the minimal-required computation now keeps every distinct required microarchitecture instead of discarding build strings. Lock-file validation continues to skip __archspec: the solver already matches it through the DAG, so re-checking it here against the single detected microarchitecture would reject hosts the solver accepted (a skylake host running x86_64_v3 packages). Unknown archspec names are rejected at manifest parse time, in raw __archspec entries, and in 'pixi workspace platform --archspec', with a did-you-mean hint for dashed spellings. Docs and schema examples used dashed names, which are invalid in conda build strings; they now use the canonical underscore names, and the rich-platform docs describe DAG matching and the list-most-specific-first pattern. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds a microarch-v3 package (requiring __archspec ==1 x86_64_v3, like conda-forge's microarchitecture metapackages) to the virtual_packages test channel, and integration tests covering variant selection, baseline fallback, install refusal with the exact override hint, run-time refusal on a machine weaker than the environment was installed for, and CLI rejection of unknown names. Also pins the conda-meta/pixi marker round-trip with multiple __archspec entries. Fixes CONDA_OVERRIDE_ARCHSPEC being ignored by host-platform detection: apply_environment_variable_overrides handled cuda, linux, osx and glibc but never archspec, so platform selection kept using the real CPU even when the override was set. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Description
!!! This needs change in rattler before it can land!!! conda/rattler#2558
Improve how
__archspecmatches are handled in pixi. USe proper DAG based matching over just comparing the version (which is defined to have a hard-coded value!).This change does not do anything about resolving packages.
How Has This Been Tested?
I played with a couple of user projects I had around. I did validate that the data looks sane in all places it can show up.
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.