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

build fails with "path is not valid" with multiple output derivation and disallowedRequisites #2310

Open
symphorien opened this issue Jul 26, 2018 · 4 comments
Labels

Comments

@symphorien
Copy link
Member

Considering this derivation:

with import <nixpkgs> {};
stdenv.mkDerivation {
  name = "a";
  outputs = [ "out" "dev" ];
  disallowedRequisites = [stdenv];
  src = sl.src;
  configurePhase = ":";
  buildPhase = "mkdir $dev";
  installPhase = "mkdir $out";
  preferLocalBuild = true;
}

The build fails with

these derivations will be built:                                                                                                                                                                       
  /nix/store/v66k16a8ns42x5r35yzpm4qir89w4861-a.drv                                                                                                                                                    
building '/nix/store/v66k16a8ns42x5r35yzpm4qir89w4861-a.drv'...                                                                                                                                        
unpacking sources                                                                                                                                                                                      
unpacking source archive /nix/store/4r5rlpyy6vqprjxwbd3idji5h3zqzr82-source                                                                                                                            
source root is source                                                                                                                                                                                  
patching sources                                                                                                                                                                                       
configuring                                                                                                                                                                                            
building                                                                                                                                                                                               
installing                                                                                                                                                                                             
post-installation fixup                                                                                                                                                                                
shrinking RPATHs of ELF executables and libraries in /nix/store/5i4q58lr18xr13ngwl9f9cn48siq48gw-a                                                                                                     
strip is /nix/store/k8b9hqv58dd1z0j4ikak24ykndcm91s6-binutils-2.28.1/bin/strip                                                                                                                         
patching script interpreter paths in /nix/store/5i4q58lr18xr13ngwl9f9cn48siq48gw-a                                                                                                                     
checking for references to /build in /nix/store/5i4q58lr18xr13ngwl9f9cn48siq48gw-a...                                                                                                                  
shrinking RPATHs of ELF executables and libraries in /nix/store/bkwg6dy7g67icb5bvi73f4rzwb0idq4r-a-dev                                                                                                 
strip is /nix/store/k8b9hqv58dd1z0j4ikak24ykndcm91s6-binutils-2.28.1/bin/strip                                                                                                                         
patching script interpreter paths in /nix/store/bkwg6dy7g67icb5bvi73f4rzwb0idq4r-a-dev                                                                                                                 
checking for references to /build in /nix/store/bkwg6dy7g67icb5bvi73f4rzwb0idq4r-a-dev...                                                                                                              
error: path '/nix/store/5i4q58lr18xr13ngwl9f9cn48siq48gw-a' is not valid 
  • Commenting out disallowedRequisites makes it work
  • making it a single output derivation makes it work
  • adding -vvv does not reveal much.

nix-info:

  • system: "x86_64-linux"
  • host os: Linux 4.17.8, NixOS, 18.03.132915.d6c6c7fcec6 (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0.4
  • channels(root): "nixos-18.03.132915.d6c6c7fcec6, nixos-stable-17.09.3194.edf1079d43f"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs
@symphorien symphorien changed the title build fails with "path is not valid" with mutliple output derivation and disallowedRequisites build fails with "path is not valid" with multiple output derivation and disallowedRequisites Jul 26, 2018
@cleverca22
Copy link
Contributor

nix/src/libstore/build.cc

Lines 3195 to 3203 in 169e147

/* For debugging, print out the referenced and unreferenced
paths. */
for (auto & i : inputPaths) {
PathSet::iterator j = references.find(i);
if (j == references.end())
debug(format("unreferenced input: '%1%'") % i);
else
debug(format("referenced input: '%1%'") % i);
}

shortly after this point in the code, it starts to clean up the /tmp/nix-build-a.drv-0 and /nix/store/snlc84rnhv4gi0jca4m7v441jwhd036l-a.drv.chroot
and during that cleanup, it deletes $out
but there is not enough logging to explain where/why

@matthewbauer
Copy link
Member

This is happening to me even when disallowedRequisites = [].

@stale
Copy link

stale bot commented Feb 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Feb 21, 2021
@stale
Copy link

stale bot commented Apr 28, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 28, 2022
@thufschmitt thufschmitt reopened this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants