Open K900 opened 1 year ago
Mh, it looks like the “relativity” of the path gets interpreted relatively to /
somewhere in the build loop. I'm surprised that we (apparently) don't resolve it right away to $PWD/foo
and only deal with the absolute path afterwards
That's probably it, yeah. I'm unfortunately not familiar enough with the codebase to know where it happens or why though.
Aaah, that's actually funnier than that: Nix does actually seem to take the absolute path before doing anything else with that store
argument (here). So that bit works just fine (which is why the first example works).
However, what Nix also does is that it spawns a separate process at the beginning of the build process (the build-hook which is used to potentially distribute the build to other machines). And that process apparently runs with its cwd set to /
. Hence the issue.
Depending on the exact Nix version, your error message might include a … while reading the response from the build hook
line which is a trace of that
Describe the bug
I honestly have no idea what is happening here.
Steps To Reproduce
nix build --store ./foo nixpkgs#hello
nix build --store ./foo --expr 'derivation { name = "boop"; system = "x86_64-linux"; builder = builtins.toFile "beep" "boop"; }'
error: creating directory '/foo': Permission denied
Expected behavior
The second command works as intended.
nix-env --version
outputnix-env (Nix) 2.13.3
Additional context
...what even. Found while trying to debug a potentially unrelated issue on Matrix.
Priorities
Add :+1: to issues you find important.