Repository navigation
refactor: Round-trip build- and host-packages of conda source packages - #5958
Merged
baszalmstra merged 4 commits intoApr 24, 2026
Merged
Conversation
…ersal Resolving build_packages/host_packages from a lockfile requires walking the full package table to match handles to UnresolvedPixiRecord values. Without a resolver, every call site does its own ad-hoc scan. This commit introduces LockFileResolver which builds once in DFS post-order (so dependencies are ready before dependents) and caches the result per package via pointer-offset arithmetic — O(1) lookup with no HashMap allocation. Cycle detection gives a named path for debugging.
Now that LockFileResolver exists, thread it through the update pipeline so every satisfiability check and record-lookup goes through a single, lazily-built resolver rather than constructing per-package scans ad-hoc. LockFileDerivedData holds a OnceCell<Arc<LockFileResolver>> populated on first use; UpdateContext carries an optional pre-seeded resolver for cases where the caller already built one. This eliminates the repeated full-table scans that the old locked_packages_to_unresolved_records helper performed.
When writing the lock file, source packages must carry their build_packages and host_packages as PackageHandle references so downstream solvers can reconstruct the build graph. Previously these fields were populated on read but dropped on write. This change wires UnresolvedPixiRecord::into_conda_package_data through the LockFileBuilder so each source record registers its deps recursively before returning its own handle.
baszalmstra
approved these changes
Apr 24, 2026
Add fixture-driven round-trip tests that load a .lock file, run the satisfiability resolver, and verify that the re-serialised lockfile is byte-identical to the fixture. The nested_source_build_dep fixture specifically exercises the recursive case where a source package lists another source package as a build dependency, ensuring the DFS traversal in LockFileResolver actually fires on the recursive branch.
hunger
force-pushed
the
push-lqqlxtykmkkx
branch
from
April 24, 2026 12:58
0021da7 to
3369e96
Compare
baszalmstra
merged commit Apr 24, 2026
322f5d3
into
prefix-dev:feature/lockfile-v7
36 of 37 checks passed
baszalmstra
added a commit
to baszalmstra/pixi
that referenced
this pull request
Apr 24, 2026
Integrates prefix-dev#5958 on top of source-build-compute-engine. Adds: - LockFileResolver: single-pass topological walk of lock-file packages that produces UnresolvedPixiRecord with build_packages/host_packages populated from predecessors. Built once per update/satisfiability run and shared across platforms. - Hash/Eq/PartialEq on PixiRecord, UnresolvedPixiRecord, SourceRecord<D> (HashMap<String,SourceLocationSpec> -> BTreeMap for Hash). - SourceRecordRequiresRebuild pessimistic stopgap for mutable/partial records in satisfiability (matches upstream). TODO to replace with backend-spec-vs-locked-packages check lives with the code. - resolve_dev_dependencies takes a single WorkspaceEnvRef instead of channels/build_env/variants; adapted both call sites (satisfiability and update's spawn_extract_environment_task). - Test fixtures for nested source-build deps and round-tripped build/host packages. Adapts to the Key-based dispatcher API on this branch: uses SolvePixiEnvironmentKey + EnvironmentRef/EnvironmentSpec in place of the retired command_dispatcher.solve_pixi_environment; uses engine().with_ctx(...).pin_and_checkout for source pinning.
baszalmstra
pushed a commit
that referenced
this pull request
May 1, 2026
baszalmstra
pushed a commit
that referenced
this pull request
May 1, 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
Round trip build- and host packages from the LockFile all the way through pixi.
The biggest challenge is to not map the same data into the different Arcs (inside *PixiRecord) over and over again.
How Has This Been Tested?
Some new tests:-)
AI Disclosure
Tools: Claude
Checklist:
schema/model.py.