ci.eval.compare: extract a derivation for cmp-stats

It's not very useful yet.
This commit is contained in:
Philip Taron 2025-09-16 09:06:28 -07:00
commit 2fe7b1cec2
No known key found for this signature in database

View file

@ -5,7 +5,45 @@
runCommand,
writeText,
python3,
stdenvNoCC,
makeWrapper,
}:
let
python = python3.withPackages (ps: [
ps.numpy
ps.pandas
ps.scipy
]);
cmp-stats = stdenvNoCC.mkDerivation {
pname = "cmp-stats";
version = lib.trivial.release;
dontUnpack = true;
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/share/cmp-stats
cp ${./cmp-stats.py} "$out/share/cmp-stats/cmp-stats.py"
makeWrapper ${python.interpreter} "$out/bin/cmp-stats" \
--add-flags "$out/share/cmp-stats/cmp-stats.py"
runHook postInstall
'';
meta = {
description = "Performance comparison of Nix evaluation statistics";
license = lib.licenses.mit;
mainProgram = "cmp-stats";
maintainers = with lib.maintainers; [ philiptaron ];
};
};
in
{
combinedDir,
touchedFilesJson,
@ -140,14 +178,7 @@ runCommand "compare"
# Don't depend on -dev outputs to reduce closure size for CI.
nativeBuildInputs = map lib.getBin [
jq
(python3.withPackages (
ps: with ps; [
numpy
pandas
scipy
]
))
cmp-stats
];
maintainers = builtins.toJSON maintainers;
passAsFile = [ "maintainers" ];
@ -181,7 +212,7 @@ runCommand "compare"
echo
} >> $out/step-summary.md
python3 ${./cmp-stats.py} >> $out/step-summary.md
cmp-stats >> $out/step-summary.md
else
# Package chunks are the same in both revisions