Fix metrics job

It was failing because the pager wasn't set, causing the message

  error: executing '': No such file or directory

to pollute the JSON output.

https://hydra.nixos.org/build/154768851

Issue #76776.
This commit is contained in:
Eelco Dolstra 2021-09-27 16:23:09 +02:00
parent c553f34417
commit 39d038d14d

View File

@ -9,6 +9,7 @@ runCommand "nixpkgs-metrics"
} }
'' ''
export NIX_STATE_DIR=$TMPDIR export NIX_STATE_DIR=$TMPDIR
export NIX_PAGER=
nix-store --init nix-store --init
mkdir -p $out/nix-support mkdir -p $out/nix-support
@ -24,13 +25,11 @@ runCommand "nixpkgs-metrics"
# Redirect stdout to /dev/null to avoid hitting "Output Limit # Redirect stdout to /dev/null to avoid hitting "Output Limit
# Exceeded" on Hydra. # Exceeded" on Hydra.
nix-env.qaDrv|nix-env.qaDrvAggressive) nix-env.qaDrv|nix-env.qaDrvAggressive)
NIX_SHOW_STATS=1 time -o stats-time "$@" 2>stats-nix >/dev/null ;; NIX_SHOW_STATS=1 NIX_SHOW_STATS_PATH=stats-nix time -o stats-time "$@" >/dev/null ;;
*) *)
NIX_SHOW_STATS=1 time -o stats-time "$@" 2>stats-nix ;; NIX_SHOW_STATS=1 NIX_SHOW_STATS_PATH=stats-nix time -o stats-time "$@" ;;
esac esac
sed '/^warning:/d' -i stats-nix
cat stats-nix; echo; cat stats-time; echo cat stats-nix; echo; cat stats-time; echo
x=$(jq '.cpuTime' < stats-nix) x=$(jq '.cpuTime' < stats-nix)