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

buildStackProject: Set __noChroot to make it fail without sandbox #73362

Merged
merged 2 commits into from
Nov 14, 2019

Conversation

infinisil
Copy link
Member

Motivation for this change

Currently buildStackProject doesn't have any indication that it needs the sandbox to be disabled, leading to a hard-to-decipher error, see #32005

With this change, doing a buildStackProject will result in

error: derivation '/nix/store/nk4wms3hk4mp9lc86k30vc8w44fcq0rj-foo.drv' has
  '__noChroot' set, but that's not allowed when 'sandbox' is 'true'

when attempting to build it without --option sandbox false

Fixes #32005

Things done
  • Made sure this error happens without disabling the sandbox

Sorry, something went wrong.

@ofborg ofborg bot added 6.topic: haskell 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Nov 13, 2019
@cdepillabout
Copy link
Member

@infinisil Thanks for this change. I was actually thinking of doing this myself.

I think this is okay as-is, if you'd like to go ahead and merge it.

However, if possible, I think it would be nice to add a little more documentation. For example, either linking to the nix manual where it talks about __noChroot, or alternatively just adding a small example of running nix-build with sandbox set to relaxed.

As a new user, at one point I came across __noChroot and had no idea what it meant or where I could find more information about it.

Verified

This commit was signed with the committer’s verified signature. The key has expired.
infinisil Silvan Mosberger
Building such a derivation will result in

  error: derivation '/nix/store/nk4wms3hk4mp9lc86k30vc8w44fcq0rj-foo.drv' has '__noChroot' set, but that's not allowed when 'sandbox' is 'true'

when attempting to build it without --option sandbox false

Verified

This commit was signed with the committer’s verified signature. The key has expired.
infinisil Silvan Mosberger
@infinisil infinisil force-pushed the buildStackProjectChroot branch from 49b2922 to 27e7b9a Compare November 14, 2019 00:32
@infinisil
Copy link
Member Author

Added a bit more comment and docs

@ofborg ofborg bot added the 8.has: documentation This PR adds or changes documentation label Nov 14, 2019
@cdepillabout
Copy link
Member

Thanks! Looks really good!

@cdepillabout cdepillabout merged commit d0c73e8 into NixOS:master Nov 14, 2019
@infinisil infinisil deleted the buildStackProjectChroot branch November 14, 2019 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: haskell 8.has: documentation This PR adds or changes documentation 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buildStackProject: fails downloading resolver
2 participants