-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Description
Describe the bug
As the title says, post-build-hook will be run with OUTPUT_PATHS set but empty after a successful nix build. DRV_PATH is set non-empty.
Steps To Reproduce
We observed this in an unchanged GitHub CI setup with Cachix install-nix-action once it updated from 2.7.0 to 2.8.0. With 2.8.0 installed, you can see the bug by, setting a simple build-hook script, e.g. "build-hook.sh":
#!/usr/bin/env bash
set -euf
echo "post-build-hook"
echo "-- ${OUT_PATHS} --"
echo "^^ ${DRV_PATH} ^^"
and then running one of:
nix-build -E '(import <nixpkgs> {}).writeText "example" (builtins.toString builtins.currentTime)' --post-build-hook ./build-hook.sh
or
nix build --rebuild -L nixpkgs#hello --extra-experimental-features flakes --post-build-hook ./build-hook.sh
Results look like:
post-build-hook: post-build-hook
post-build-hook: -- --
post-build-hook: ^^ /nix/store/5fv6808114kqw4n8g5qn8pczzfw7mrl4-example.drv ^^
Where the OUTPUT_PATHS line unexpectedly has an empty value.
nix-env --version output
% nix-env --version
nix-env (Nix) 2.8.0
Additional context
First commented here in #5694 but this seems to be a different issue. #6311 may be related.
Reactions are currently unavailable