Lock build dependencies with full distribution info
Capture and persist build dependency resolutions in the lock file with
complete distribution information (URLs, hashes, wheel metadata). This
enables deterministic builds across lock and sync operations.
During `uv lock`:
- Build dependencies are resolved and captured with full dist info
- Previously locked versions are used as preferences (hints) for the
resolver, matching normal dependency preference behavior
- Results stored as [[package]] entries in the lock file
During `uv sync`:
- Build dependencies are loaded directly from the lock file
- Resolution is skipped entirely, using pre-built Resolution objects
- Matches the pattern used for regular dependencies
Key changes:
- Add `build-dependencies` field to lock file packages
- Add `BuildResolutions` to capture resolutions during lock
- Add `LockedBuildResolutions` for skip-resolution during sync
- Add `BuildPreferences` for preference hints during re-lock
- Add `Lock::build_resolution()` to construct Resolution from lock
- Add `Preference::from_build()` for build dependency preferences
https://claude.ai/code/session_0124yg6yBrMEEaeiT3t1hAfH
Panic on uninitialized preview access instead of using default
Using `get_or_init` with a default would silently return disabled
preview if accessed before initialization, making bugs harder to
diagnose. Using `expect` ensures a clear panic with backtrace pointing
to the problematic call site.
https://claude.ai/code/session_01Gzak8YGk9kpH3Uy9HWypS5