From 43178a462f0fe723c1d7b074abc8e63820b6fde0 Mon Sep 17 00:00:00 2001 From: Rhys-T <108157737+Rhys-T@users.noreply.github.com> Date: Sat, 22 Feb 2025 20:09:28 -0500 Subject: [PATCH] noBrokenSymlinks: fix tests on Linux `mkUnreadableSymlink` was exiting before the hook could print its messages, meaning that the combined 'broken' test wasn't getting the symlink counts. --- pkgs/test/stdenv/no-broken-symlinks.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/test/stdenv/no-broken-symlinks.nix b/pkgs/test/stdenv/no-broken-symlinks.nix index 344f8b5afc1d..5ef7a75e7774 100644 --- a/pkgs/test/stdenv/no-broken-symlinks.nix +++ b/pkgs/test/stdenv/no-broken-symlinks.nix @@ -29,7 +29,10 @@ let ) if readlink "$out/unreadable-symlink" >/dev/null 2>&1; then nixErrorLog "symlink permissions not supported" - ${optionalString failIfUnsupported "exit 1"} + ${optionalString failIfUnsupported + # Postpone the failure until after no-broken-symlinks.sh has a chance to print its messages + "postFixupHooks+=('exit 1')" + } fi '';