NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.8k stars 1.52k forks source link

builtins.readDir does not respect `local?root=` #2381

Open cleverca22 opened 6 years ago

cleverca22 commented 6 years ago
[clever@amd-nixos:~/nix-tests]$ nix-instantiate --eval readdir.nix  --read-write-mode --store local?root=/home/clever/fakeroot/ -vvvvv
evaluating file '/nix/store/im2gph340jbcsnn8rh0lpdmjf70l99aa-nix-2.1pre6148_a4aac7f/share/nix/corepkgs/derivation.nix'
acquiring global GC lock '/home/clever/fakeroot/nix/var/nix/gc.lock'
acquiring read lock on '/home/clever/fakeroot/nix/var/nix/temproots/16802'
acquiring write lock on '/home/clever/fakeroot/nix/var/nix/temproots/16802'
downgrading to read lock on '/home/clever/fakeroot/nix/var/nix/temproots/16802'
copied source '/home/clever/nix-tests' -> '/nix/store/c755gda2r90mhsrz1k6fd8w62ffvshyb-nix-tests'
error: opening directory '/nix/store/c755gda2r90mhsrz1k6fd8w62ffvshyb-nix-tests/kexec': No such file or directory

[clever@amd-nixos:~/nix-tests]$ ls -ld /nix/store/c755gda2r90mhsrz1k6fd8w62ffvshyb-nix-tests /home/clever/fakeroot//nix/store/c755gda2r90mhsrz1k6fd8w62ffvshyb-nix-tests
ls: cannot access '/nix/store/c755gda2r90mhsrz1k6fd8w62ffvshyb-nix-tests': No such file or directory
dr-xr-xr-x 19 clever users 39 Dec 31  1969 /home/clever/fakeroot//nix/store/c755gda2r90mhsrz1k6fd8w62ffvshyb-nix-tests

[clever@amd-nixos:~/nix-tests]$ cat readdir.nix 
builtins.readDir "${./.}/kexec"

[clever@amd-nixos:~/nix-tests]$ ls -ld kexec/
drwxr-xr-x 2 clever users 23 Jul 12 17:37 kexec/

related: #2125 and #2174

builtins.readDir (./. + "/kexec") prevents the problem, by keeping it as a non-store path

stale[bot] commented 3 years ago

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

stale[bot] commented 2 years ago

I closed this issue due to inactivity. → More info