From 1edb73a7fe0f0a659c07264e1baec940237977cc Mon Sep 17 00:00:00 2001 From: piegames Date: Mon, 20 Apr 2026 21:08:52 +0200 Subject: [PATCH] ci/parse: Fail on warning Lix simply emits all warnings to stderr. All warnings it emits are deprecation warnings which we would like to turn into hard errors in the future, but are still too widespread in use, including in Nixpkgs. If we don't hard-error on these too, then regressions will continue being introduced and we will never be able to turn these into hard errors. --- ci/parse.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/parse.nix b/ci/parse.nix index 14fd1e719547..8c9a84b446b1 100644 --- a/ci/parse.nix +++ b/ci/parse.nix @@ -28,7 +28,14 @@ runCommand "nix-parse-${nix.name}" # the other CI jobs will report in more detail. This job is about checking parsing # across different implementations / versions, not about providing the best DX. # Returning all parse errors requires significantly more resources. - find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse >/dev/null + + find . -type f -iname '*.nix' | xargs -P $(nproc) nix-instantiate --parse 2>&1 >/dev/null | { + # Also fail on (deprecation) warnings printed to stderr. + if grep "warning"; then + echo "Failing due to warnings in stderr" >&2 + exit 1 + fi + } touch $out ''