mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Regression test for issue #14287
This will currently fail, until the bug is fixed.
Co-Authored-By: Sergei Zimmerman <sergei@zimmerman.foo>
(cherry picked from commit 246dbe1c05)
This commit is contained in:
parent
5c9481de19
commit
328a3bbbd0
2 changed files with 24 additions and 0 deletions
12
tests/functional/build-hook-list-paths.sh
Executable file
12
tests/functional/build-hook-list-paths.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
[ -n "$OUT_PATHS" ]
|
||||||
|
[ -n "$DRV_PATH" ]
|
||||||
|
[ -n "$HOOK_DEST" ]
|
||||||
|
|
||||||
|
for o in $OUT_PATHS; do
|
||||||
|
echo "$o" >> "$HOOK_DEST"
|
||||||
|
done
|
||||||
|
|
@ -29,6 +29,18 @@ nix-build -o "$TEST_ROOT"/result dependencies.nix --post-build-hook "$pushToStor
|
||||||
export BUILD_HOOK_ONLY_OUT_PATHS=$([ ! "$NIX_TESTS_CA_BY_DEFAULT" ])
|
export BUILD_HOOK_ONLY_OUT_PATHS=$([ ! "$NIX_TESTS_CA_BY_DEFAULT" ])
|
||||||
nix-build -o "$TEST_ROOT"/result-mult multiple-outputs.nix -A a.first --post-build-hook "$pushToStore"
|
nix-build -o "$TEST_ROOT"/result-mult multiple-outputs.nix -A a.first --post-build-hook "$pushToStore"
|
||||||
|
|
||||||
|
if isDaemonNewer "2.33.0pre20251029"; then
|
||||||
|
# Regression test for issue #14287: `--check` should re-run post build
|
||||||
|
# hook, even though nothing is getting newly registered.
|
||||||
|
export HOOK_DEST=$TEST_ROOT/listing
|
||||||
|
# Needed so the hook will get the above environment variable.
|
||||||
|
restartDaemon
|
||||||
|
nix-build -o "$TEST_ROOT"/result-mult multiple-outputs.nix --check -A a.first --post-build-hook "$PWD/build-hook-list-paths.sh"
|
||||||
|
grepQuiet a-first "$HOOK_DEST"
|
||||||
|
grepQuiet a-second "$HOOK_DEST"
|
||||||
|
unset HOOK_DEST
|
||||||
|
fi
|
||||||
|
|
||||||
clearStore
|
clearStore
|
||||||
|
|
||||||
# Ensure that the remote store contains both the runtime and build-time
|
# Ensure that the remote store contains both the runtime and build-time
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue