-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
Description
Describe the bug
I have a simple script to upload artifacts to cache after a build:
set -x
echo $OUT_PATHS
[[ $DIRENV_IN_ENVRC = 1 ]] && exit
[[ $NO_CACHE_UPLOAD = 1 ]] && exit
[[ -z $OUT_PATHS ]] && exit
export IFS=' '
echo "Signing paths" $OUT_PATHS
nix store sign --key-file secrets/nix-secret-key-file $OUT_PATHS
echo "Uploading paths" $OUT_PATHS
exec nix copy --to 'redacted' $OUT_PATHSI placed the first echo statement at the top for debugging. The script always fails to upload anything because OUT_PATHS is always empty.
Steps To Reproduce
- Take the script above
- set it as a post build hook
- run
nix build -L nixpkgs#hello, add a--rebuildflag if the package has already been built (since hook only runs after a local build) - notice how the echo statement echos nothing
Expected behavior
man nix.conf says OUT_PATHS should contain a space separated list of built paths.
nix-env --version output
I tried this on the latest nix unstable as well as stable nix 2.4
Additional context
I am setting the post-build-hook in a flake devShell via the NIX_CONFIG variable. This is done because the cache in question is local to this particular flake and it's environment. Not sure if that may somehow be part of the issue.
Reactions are currently unavailable