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

NIX_BUILD_TOP not set correctly outside of nixos #3142

Open
cleverca22 opened this issue Oct 12, 2019 · 5 comments
Open

NIX_BUILD_TOP not set correctly outside of nixos #3142

cleverca22 opened this issue Oct 12, 2019 · 5 comments
Labels

Comments

@cleverca22
Copy link
Contributor

https://gist.github.com/a0722abf36a1cfc5cadf8e39c356fba5

for some weird reason, if the sandbox is on, but nix cant get root, then the working dir, and the $NIX_BUILD_TOP wont agree on the directory

this results in things like runCommand being unable to follow $buildCommandPath and then complaining about you needing to set src or srcs

@infinisil
Copy link
Member

infinisil commented Oct 12, 2019

A user on IRC just encountered this, the error was

building '/nix/store/31yjixwkm35d6m2yqg3qdf367i06vvf0-kernel-modules.drv'...
/nix/store/95j91i5mkhfwqrscmiz49qab3l343jc7-stdenv-linux/setup: line 810: /build/env-vars: No such file or directory
created 3 symlinks in user environment
/nix/store/95j91i5mkhfwqrscmiz49qab3l343jc7-stdenv-linux/setup: line 313: pkgBuildAccumVars: readonly variable
[...]
/nix/store/95j91i5mkhfwqrscmiz49qab3l343jc7-stdenv-linux/setup: line 352: allPlatOffsets: readonly variable
/nix/store/95j91i5mkhfwqrscmiz49qab3l343jc7-stdenv-linux/setup: line 797: /build/env-vars: No such file or directory
kernel version is 4.19.78
building '/nix/store/wiq4rchmxckzkyvlz09lw6r0x7f3vp65-hwdb.bin.drv'...
/nix/store/95j91i5mkhfwqrscmiz49qab3l343jc7-stdenv-linux/setup: line 810: /build/env-vars: No such file or directory
unpacking sources
/nix/store/95j91i5mkhfwqrscmiz49qab3l343jc7-stdenv-linux/setup: line 810: /build/env-vars: No such file or directory
variable $src or $srcs should point to the source
builder for '/nix/store/wiq4rchmxckzkyvlz09lw6r0x7f3vp65-hwdb.bin.drv' failed with exit code 1
cannot build derivation '/nix/store/jdsra676zymclc25z5yjn395jxkk7dpw-etc.drv': 1 dependencies couldn't be built
building '/nix/store/d0nnk98k3haz7mj7ignqk1givcy21ard-linux-4.19.78-modules.drv'...
cannot build derivation '/nix/store/5va0q68d872ppqn3zw1w9la7hxizqrlq-nixos-system-vulcan-19.09.741.dbad7c7d59f.drv': 1 dependencies couldn't be built
error: build of '/nix/store/5va0q68d872ppqn3zw1w9la7hxizqrlq-nixos-system-vulcan-19.09.741.dbad7c7d59f.drv' failed

Logs including solution: https://logs.nix.samueldr.com/nixos/2019-10-12#1570910798-1570911855;

@matthewbauer
Copy link
Member

Yeah this looks like a mistake I made in #3006. I think #3144 fixes this.

@bitonic
Copy link

bitonic commented Dec 14, 2019

For posterity, to work around the issue, pass --option sandbox false to the nix command you're running.

Edit: I've also now updated to nix 2.3.7 and the issue is resolved. I'm not sure what the first version containing that fix is though.

@nh2
Copy link
Contributor

nh2 commented Oct 12, 2020

I'm not sure what the first version containing that fix is though.

It's fixed not in 2.3.1 but in 2.3.2; this is the commit in that release: 10bf534

@stale
Copy link

stale bot commented Jun 3, 2021

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

@stale stale bot added the stale label Jun 3, 2021
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

5 participants