Skip to content

Commit 246dbe1

Browse files
Ericson2314xokdvium
andcommitted
Regression test for issue #14287
This will currently fail, until the bug is fixed. Co-Authored-By: Sergei Zimmerman <[email protected]>
1 parent 194c21f commit 246dbe1

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
set -x
4+
set -e
5+
6+
[ -n "$OUT_PATHS" ]
7+
[ -n "$DRV_PATH" ]
8+
[ -n "$HOOK_DEST" ]
9+
10+
for o in $OUT_PATHS; do
11+
echo "$o" >> "$HOOK_DEST"
12+
done

tests/functional/post-hook.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ nix-build -o "$TEST_ROOT"/result dependencies.nix --post-build-hook "$pushToStor
2929
export BUILD_HOOK_ONLY_OUT_PATHS=$([ ! "$NIX_TESTS_CA_BY_DEFAULT" ])
3030
nix-build -o "$TEST_ROOT"/result-mult multiple-outputs.nix -A a.first --post-build-hook "$pushToStore"
3131

32+
if isDaemonNewer "2.33.0pre20251029"; then
33+
# Regression test for issue #14287: `--check` should re-run post build
34+
# hook, even though nothing is getting newly registered.
35+
export HOOK_DEST=$TEST_ROOT/listing
36+
# Needed so the hook will get the above environment variable.
37+
restartDaemon
38+
nix-build -o "$TEST_ROOT"/result-mult multiple-outputs.nix --check -A a.first --post-build-hook "$PWD/build-hook-list-paths.sh"
39+
grepQuiet a-first "$HOOK_DEST"
40+
grepQuiet a-second "$HOOK_DEST"
41+
unset HOOK_DEST
42+
fi
43+
3244
clearStore
3345

3446
# Ensure that the remote store contains both the runtime and build-time

0 commit comments

Comments
 (0)