[Backport release-25.05] ci/eval: reduce closure size (#432225)

This commit is contained in:
Wolfgang Walther
2025-08-09 12:08:31 +00:00
committed by GitHub
2 changed files with 19 additions and 17 deletions

View File

@@ -122,7 +122,8 @@ let
in
runCommand "compare"
{
nativeBuildInputs = [
# Don't depend on -dev outputs to reduce closure size for CI.
nativeBuildInputs = map lib.getBin [
jq
(python3.withPackages (
ps: with ps; [

View File

@@ -14,10 +14,9 @@
runCommand,
writeShellScript,
symlinkJoin,
time,
procps,
nix,
busybox,
jq,
nix,
}:
let
@@ -48,9 +47,10 @@ let
runCommand "attrpaths-superset.json"
{
src = nixpkgs;
nativeBuildInputs = [
# Don't depend on -dev outputs to reduce closure size for CI.
nativeBuildInputs = map lib.getBin [
busybox
nix
time
];
}
''
@@ -72,11 +72,11 @@ let
# The system to evaluate.
# Note that this is intentionally not called `system`,
# because `--argstr system` would only be passed to the ci/default.nix file!
evalSystem,
evalSystem ? builtins.currentSystem,
# The path to the `paths.json` file from `attrpathsSuperset`
attrpathFile ? "${attrpathsSuperset { inherit evalSystem; }}/paths.json",
# The number of attributes per chunk, see ./README.md for more info.
chunkSize,
chunkSize ? 5000,
checkMeta ? true,
# Don't try to eval packages marked as broken.
@@ -131,11 +131,11 @@ let
in
runCommand "nixpkgs-eval-${evalSystem}"
{
nativeBuildInputs = [
nix
time
procps
# Don't depend on -dev outputs to reduce closure size for CI.
nativeBuildInputs = map lib.getBin [
busybox
jq
nix
];
env = {
inherit evalSystem chunkSize;
@@ -160,14 +160,14 @@ let
# Record and print stats on free memory and swap in the background
(
while true; do
availMemory=$(free -b | grep Mem | awk '{print $7}')
freeSwap=$(free -b | grep Swap | awk '{print $4}')
echo "Available memory: $(( availMemory / 1024 / 1024 )) MiB, free swap: $(( freeSwap / 1024 / 1024 )) MiB"
availMemory=$(free -m | grep Mem | awk '{print $7}')
freeSwap=$(free -m | grep Swap | awk '{print $4}')
echo "Available memory: $(( availMemory )) MiB, free swap: $(( freeSwap )) MiB"
if [[ ! -f "$out/${evalSystem}/min-avail-memory" ]] || (( availMemory < $(<$out/${evalSystem}/min-avail-memory) )); then
echo "$availMemory" > $out/${evalSystem}/min-avail-memory
fi
if [[ ! -f $out/${evalSystem}/min-free-swap ]] || (( availMemory < $(<$out/${evalSystem}/min-free-swap) )); then
if [[ ! -f $out/${evalSystem}/min-free-swap ]] || (( freeSwap < $(<$out/${evalSystem}/min-free-swap) )); then
echo "$freeSwap" > $out/${evalSystem}/min-free-swap
fi
sleep 4
@@ -206,7 +206,8 @@ let
}:
runCommand "combined-eval"
{
nativeBuildInputs = [
# Don't depend on -dev outputs to reduce closure size for CI.
nativeBuildInputs = map lib.getBin [
jq
];
}