ci/nixpkgs-vet: memoize filesets
Speeds up evaluation a bit, because `filtered head` doesn't need to be evaluated 3x.
This commit is contained in:
@@ -16,6 +16,9 @@ let
|
|||||||
fileset = (gitTracked path);
|
fileset = (gitTracked path);
|
||||||
root = path;
|
root = path;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
filteredBase = filtered base;
|
||||||
|
filteredHead = filtered head;
|
||||||
in
|
in
|
||||||
runCommand "nixpkgs-vet"
|
runCommand "nixpkgs-vet"
|
||||||
{
|
{
|
||||||
@@ -27,11 +30,11 @@ runCommand "nixpkgs-vet"
|
|||||||
''
|
''
|
||||||
export NIX_STATE_DIR=$(mktemp -d)
|
export NIX_STATE_DIR=$(mktemp -d)
|
||||||
|
|
||||||
nixpkgs-vet --base ${filtered base} ${filtered head}
|
nixpkgs-vet --base ${filteredBase} ${filteredHead}
|
||||||
|
|
||||||
# TODO: Upstream into nixpkgs-vet, see:
|
# TODO: Upstream into nixpkgs-vet, see:
|
||||||
# https://github.com/NixOS/nixpkgs-vet/issues/164
|
# https://github.com/NixOS/nixpkgs-vet/issues/164
|
||||||
badFiles=$(find ${filtered head}/pkgs -type f -name '*.nix' -print | xargs grep -l '^[^#]*<nixpkgs/' || true)
|
badFiles=$(find ${filteredHead}/pkgs -type f -name '*.nix' -print | xargs grep -l '^[^#]*<nixpkgs/' || true)
|
||||||
if [[ -n $badFiles ]]; then
|
if [[ -n $badFiles ]]; then
|
||||||
echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself."
|
echo "Nixpkgs is not allowed to use <nixpkgs> to refer to itself."
|
||||||
echo "The offending files:"
|
echo "The offending files:"
|
||||||
@@ -41,7 +44,7 @@ runCommand "nixpkgs-vet"
|
|||||||
|
|
||||||
# TODO: Upstream into nixpkgs-vet, see:
|
# TODO: Upstream into nixpkgs-vet, see:
|
||||||
# https://github.com/NixOS/nixpkgs-vet/issues/166
|
# https://github.com/NixOS/nixpkgs-vet/issues/166
|
||||||
conflictingPaths=$(find ${filtered head} | awk '{ print $1 " " tolower($1) }' | sort -k2 | uniq -D -f 1 | cut -d ' ' -f 1)
|
conflictingPaths=$(find ${filteredHead} | awk '{ print $1 " " tolower($1) }' | sort -k2 | uniq -D -f 1 | cut -d ' ' -f 1)
|
||||||
if [[ -n $conflictingPaths ]]; then
|
if [[ -n $conflictingPaths ]]; then
|
||||||
echo "Files in nixpkgs must not vary only by case."
|
echo "Files in nixpkgs must not vary only by case."
|
||||||
echo "The offending paths:"
|
echo "The offending paths:"
|
||||||
|
|||||||
Reference in New Issue
Block a user