[M5+] use devbox attr_paths for pinned-dep nixpkgs attr

This commit is contained in:
2026-05-10 13:06:35 +00:00
parent 935e8d5f79
commit 1604b1d5a8
6 changed files with 86 additions and 27 deletions

View File

@@ -91,6 +91,19 @@ All notable changes to cargoxx will be documented in this file.
6 cases against fixtures derived from a real fmt 10.2.1 response;
`tests/devbox_resolve_live.cpp` (gated by `CARGOXX_NETWORK_TESTS=1`)
hits the live API.
- Fix: pinned-dep `buildInputs` line used the curated linkdb's
`nixpkgs_attr` (e.g. `fmt_10`) regardless of the pinned rev, so
`cargoxx add fmt@12.1.0` emitted `pkgs_nixpkgs_fmt_12_1_0.fmt_10`
even though that rev only exposes `fmt`. `resolve_version` now
returns `ResolvedVersion { nixpkgs_rev, nixpkgs_attr }` (the attr
comes from devbox's `attr_paths` for the resolved rev, with the
package name as a best-effort fallback for the git path).
`cmd_add` writes the attr into the lockfile and `cmd_build`'s
`merge_lockfile` now also preserves it. Codegen prefers the
lockfile's attr over the linkdb recipe's whenever it's set, so
pinned deps reach the right attribute on their per-dep nixpkgs.
Live verified: `cargoxx add fmt@12.1.0 && cargoxx build` now emits
`pkgs_nixpkgs_fmt_12_1_0.fmt` and the binary builds and runs.
- `flake.nix` codegen rewritten for **per-dep nixpkgs revisions**. The
shared `nixpkgs` input always tracks `nixos-unstable` and provides
the toolchain. Each pinned manifest dep