Preserve compiler metadata context and diagnose exact identity differences (#931)

This commit is contained in:
Quixos Development Agent 01f26965-84fa-4a79-8069-725682c13065
2026-11-05 21:21:38 +00:00
parent e5232098aa
commit 61881f9cda
2 changed files with 95 additions and 5 deletions
+13 -2
View File
@@ -5,6 +5,8 @@
}:
let
comparisonIdentity = import ../tools/local-first/derivation-identity.nix;
# Inspect the actual .drv as data, without its derivation-deep output context.
productionDerivation = builtins.unsafeDiscardOutputDependency library.drvPath;
source = pkgs.lib.fileset.toSource {
root = ./.;
fileset = pkgs.lib.fileset.unions [
@@ -28,14 +30,23 @@ let
};
inputs = pkgs.writeText "protocol-source-inputs.json" (
builtins.toJSON {
inherit source nixpkgsNarHash;
inherit source nixpkgsNarHash productionDerivation;
narHashContext = builtins.getContext nixpkgsNarHash;
evaluatorVersion = builtins.nixVersion;
pinnedNixVersion = pkgs.nix.version;
nixpkgs = pkgs.path;
system = pkgs.stdenv.hostPlatform.system;
expected = comparisonIdentity library;
expectedSource = builtins.unsafeDiscardStringContext (toString library.src);
yarn = comparisonIdentity library.yarn-freestanding;
}
);
closure = pkgs.closureInfo { rootPaths = [ pkgs.path ]; };
closure = pkgs.closureInfo {
rootPaths = [
pkgs.path
productionDerivation
];
};
in
pkgs.runCommand "quixos-protocol-source-check"
{