Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OUT_PATHS empty in post-build-hook in Nix 2.8.0 #6446

Closed
arobertn opened this issue Apr 26, 2022 · 0 comments · Fixed by #6459
Closed

OUT_PATHS empty in post-build-hook in Nix 2.8.0 #6446

arobertn opened this issue Apr 26, 2022 · 0 comments · Fixed by #6459
Assignees
Labels
Milestone

Comments

@arobertn
Copy link

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.

@arobertn arobertn added the bug label Apr 26, 2022
@edolstra edolstra self-assigned this Apr 26, 2022
@edolstra edolstra added this to the nix-2.9 milestone Apr 26, 2022
@edolstra edolstra changed the title OUTPUT_PATHS empty in post-build-hook in Nix 2.8.0 OUT_PATHS empty in post-build-hook in Nix 2.8.0 Apr 28, 2022
edolstra added a commit to edolstra/nix that referenced this issue Apr 28, 2022
github-actions bot pushed a commit that referenced this issue Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants