You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nix-build --run-env with --add-root not working as expected (or at all?) #86
~/Projects/MyEnv $ nix-build --run-env '<nixpkgs>' -A irssi
works fine but when I try it with add-root I get surprising results:
~/Projects/MyEnv $ nix-build --run-env '<nixpkgs>' -A irssi --add-root myroot error: creating a garbage collector root (/nix/store/27irakzga2m3wiv7977hafjr8kaa3plb-stdenv.drv) in the Nix store is forbidden (are you running nix-build inside the store?) /run/current-system/sw/bin/nix-build: failed to build all dependencies
with --indirect
~/Projects/MyEnv $ nix-build --run-env '<nixpkgs>' -A irssi --add-root myroot --indirect
error: path `/home/goibhniu/Projects/MyEnv/--indirect' is not a valid garbage collector root; it's not in the directory `/nix/var/nix/gcroots'
/run/current-system/sw/bin/nix-build: failed to build all dependencies
~/dev/nixos/nixpkgs/
% nix-build default.nix --run-env -A irssi
warning: you did not specify `--add-root'; the result might be removed by the garbage collector
/nix/store/b48470bj4b8d4x6z5rr62924n30cwsiq-stdenv/setup:93: command not found: shopt
exitHandler:4: command not found: closeNest
runHook:2: bad option: -t
runHook:6: bad substitution
@cillianderoiste: Where did you find documentation for the parameters you used? nix-build --help only says: [--run-env [--command cmd] [--exclude regexp]] paths...
@qknight If I remember correctly, you were using this at the hackfest. Do you still use it?
$ nix-build ~/code/nixpkgs --run-env -A irssi --add-root
error: creating a garbage collector root (/nix/store/27irakzga2m3wiv7977hafjr8kaa3plb-stdenv.drv) in the Nix store is forbidden (are you running nix-build inside the store?)
/run/current-system/sw/bin/nix-build: failed to build all dependencies
Since "nix-build --run-env" doesn't actually build the top-level package (just its dependencies), the "--add-root" flag doesn't really make sense. But I guess it shouldn't print that weird error message.
Aha! No wonder it isn't documented then! I was under the impression that --run-env with --add-root could replace buildEnv to provide a persistent development environment, so I was obviously wrong. Thanks for clearing that up.
Activity
chaoflow commentedon Jan 11, 2013
nix-build (Nix) 1.3
NixOS/nixpkgs@6f1aad7
chaoflow commentedon Jan 11, 2013
@cillianderoiste: Where did you find documentation for the parameters you used?
nix-build --helponly says:[--run-env [--command cmd] [--exclude regexp]] paths...cillianderoiste commentedon Jan 12, 2013
@chaoflow IIUC it doesn't work correctly on zsh: NixOS/nixpkgs#79
cillianderoiste commentedon Jan 12, 2013
The only documentation I've found which mentions --run-env with --add-root is:
http://nixos.org/wiki/GIT_workflow
@qknight If I remember correctly, you were using this at the hackfest. Do you still use it?
edolstra commentedon Jan 14, 2013
Since "nix-build --run-env" doesn't actually build the top-level package (just its dependencies), the "--add-root" flag doesn't really make sense. But I guess it shouldn't print that weird error message.
cillianderoiste commentedon Jan 15, 2013
Aha! No wonder it isn't documented then! I was under the impression that --run-env with --add-root could replace buildEnv to provide a persistent development environment, so I was obviously wrong. Thanks for clearing that up.
CMCDragonkai commentedon Jul 28, 2014
Does nix-shell replace
nix-build --run-env?edolstra commentedon Jul 28, 2014
Yes.
templates: rephrase to include `@generated`
Merge pull request NixOS#86 from DeterminateSystems/release-v3.6.2/12…
feat(eval-cache): add PathExpr / PathStep types
feat(eval-cache): plumb fromCIDs[] + path fields through Query types
feat(eval-cache): add cidasks::pathFromSubject helper
docs(eval-cache): record per-arg semantics in design principles
docs: drop dangling task numbers and "deferred" work framing