mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 11:45:45 +03:00
ci/eval.combine: avoid parsing of plain text file into JSON
Instead of parsing a plain text file with jq, we can make nix-env output JSON directly, which is significantly faster. This saves about 8 out of 10 seconds for the combine step.
This commit is contained in:
parent
d87d760dfa
commit
138393e0ba
1 changed files with 4 additions and 18 deletions
|
@ -96,7 +96,7 @@ let
|
||||||
--option restrict-eval true \
|
--option restrict-eval true \
|
||||||
--option allow-import-from-derivation false \
|
--option allow-import-from-derivation false \
|
||||||
--query --available \
|
--query --available \
|
||||||
--no-name --attr-path --out-path \
|
--out-path --json \
|
||||||
--show-trace \
|
--show-trace \
|
||||||
--arg chunkSize "$chunkSize" \
|
--arg chunkSize "$chunkSize" \
|
||||||
--arg myChunk "$myChunk" \
|
--arg myChunk "$myChunk" \
|
||||||
|
@ -188,7 +188,7 @@ let
|
||||||
rm "$chunkOutputDir"/stats/"$seq_end"
|
rm "$chunkOutputDir"/stats/"$seq_end"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cat "$chunkOutputDir"/result/* > $out/${evalSystem}/paths
|
cat "$chunkOutputDir"/result/* | jq -s 'add | map_values(.outputs)' > $out/${evalSystem}/paths.json
|
||||||
'';
|
'';
|
||||||
|
|
||||||
combine =
|
combine =
|
||||||
|
@ -204,22 +204,8 @@ let
|
||||||
''
|
''
|
||||||
mkdir -p $out
|
mkdir -p $out
|
||||||
|
|
||||||
# Transform output paths to JSON
|
# Combine output paths from all systems
|
||||||
cat ${resultsDir}/*/paths |
|
cat ${resultsDir}/*/paths.json | jq -s add > $out/outpaths.json
|
||||||
jq --sort-keys --raw-input --slurp '
|
|
||||||
split("\n") |
|
|
||||||
map(select(. != "") | split(" ") | map(select(. != ""))) |
|
|
||||||
map(
|
|
||||||
{
|
|
||||||
key: .[0],
|
|
||||||
value: .[1] | split(";") | map(split("=") |
|
|
||||||
if length == 1 then
|
|
||||||
{ key: "out", value: .[0] }
|
|
||||||
else
|
|
||||||
{ key: .[0], value: .[1] }
|
|
||||||
end) | from_entries}
|
|
||||||
) | from_entries
|
|
||||||
' > $out/outpaths.json
|
|
||||||
|
|
||||||
mkdir -p $out/stats
|
mkdir -p $out/stats
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue