From 247d5623795d85938b41be1571c83c2e5d189fcd Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Tue, 10 Jun 2025 13:17:00 +0200 Subject: [PATCH] ci/nixpkgs-vet: add badFiles and conflictingPaths checks Those checks are part of top-level/nixpkgs-basic-release-checks.nix, but can be run in CI already to prevent regressions. The idea is to upstream them into nixpkgs-vet eventually, but we can just as well run them as-is in the same derivation already. --- ci/nixpkgs-vet.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ci/nixpkgs-vet.nix b/ci/nixpkgs-vet.nix index ccc5ba289dcf5..58b5024589bd0 100644 --- a/ci/nixpkgs-vet.nix +++ b/ci/nixpkgs-vet.nix @@ -29,5 +29,25 @@ runCommand "nixpkgs-vet" nixpkgs-vet --base ${filtered base} ${filtered head} + # TODO: Upstream into nixpkgs-vet, see: + # https://github.com/NixOS/nixpkgs-vet/issues/164 + badFiles=$(find ${filtered head}/pkgs -type f -name '*.nix' -print | xargs grep -l '^[^#]* to refer to itself." + echo "The offending files:" + echo "$badFiles" + exit 1 + fi + + # TODO: Upstream into nixpkgs-vet, see: + # 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) + if [[ -n $conflictingPaths ]]; then + echo "Files in nixpkgs must not vary only by case." + echo "The offending paths:" + echo "$conflictingPaths" + exit 1 + fi + touch $out ''