Repository navigation
Trace how each package of a package set was made - #131
Merged
Merged
Conversation
A package config gains traced: the same sets, built on the same lib with callPackageWith replaced by a version that records each call. Every derivation a traced callPackage returns carries caissonTrace: the step, the derivation it was applied to, the names it was given and the position of the argument set the caller wrote; the callPackage at the bottom also names the file of the function, the arguments that came from the scope and the set. override, overrideAttrs and overrideDerivation on a traced derivation trace what they return. The trace is attributes beside the derivation, so drvPaths are unchanged, and only an inspection builds a traced set. traceChainOf reads a trace as plain data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
This is item 6 of what topside needs from the record, the trace that
topside packagereads (design section 8, Tracking). nixpkgs keeps no link from an override's result to what it overrode, so the trace is recorded while a set is built.tracedon a package config. The manifest of a package config gainstraced.children.nixpkgs.<system>: the same sets, built on the same lib, withcallPackageWithreplaced by a version that records each call (lib-overlays/nixpkgs/trace.nix). Only an inspection reads it, so an ordinary evaluation builds no traced set.caissonTraceon each package. Every derivation a tracedcallPackagereturns carriescaissonTrace: the step,from(the derivation it was applied to), the names the step was given, and the position of the argument set the caller wrote. ThecallPackageat the bottom also records the function's file, the arguments that came from the scope, and the set as{ config; system; }.override,overrideAttrsandoverrideDerivationon a traced derivation trace what they return.drvPathstays the same.lib.caisson.nixpkgs.traceChainOfreads a trace as plain data, from the last step down to thecallPackage, with each derivation given by itsdrvPath.Where this differs from the design. Section 8 describes the trace as a forced lib layer,
caisson-core.trace, added when the whole tree is recomposed. Since #128, a package set's lib takescustomisation, and with itcallPackageWith, from the package set's own source. A layer in the composed lib would not reach the set, so the trace applies where a package set's lib is assembled, after that split, in the nixpkgs integration. The trace covers the packages of a package config's sets. Recomposing a whole tree, for a flake output's package, is not part of this.Tests.
nixpkgs-pkg-setschecks that a tracedhellohas thedrvPathof the untraced one. It checks that the bottom record names…/hello/package.nix,stdenvamong the scope arguments, and the set. It checks that(hello.override { }).overrideAttrs …traces asoverrideAttrs,override,callPackage, with eachfromand the finaldrvPathmatching the untraced chain. Reordering the expected chain makes the test fail. The fullnix flake checkpasses, including the VM tests and the evaluation-cost gate.🤖 Generated with Claude Code