-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 garbage collects build dependencies even when gc root is added. #979
Comments
So, this seems to require this incantation to make sure that the development environment is not gc-d:
|
@vrthra can you elaborate? |
After seeing that a command exists ( |
I think this is expected behavior, but there should be an easier way to create a root for the build environment without having to open a shell. |
I am having a similar issue, and I think I can shed some light. The issue crops up when you make a derivation with no |
No, I don't think the mechanisms are close. Instead, I suspect that |
@vcunat That's what I mean, and that he garbage collector (i.e., Here's a MWE:
The GC still wants to delete the py33 installation when you use the traditional |
Just using `nix-instantiate --add-root` doesn't prevent built things from being garbage collected, see NixOS/nix#979. Using `nix-shell --indirect --add-root` fixes the issue.
Just using `nix-instantiate --add-root` doesn't prevent built things from being garbage collected, see NixOS/nix#979. Using `nix-shell --indirect --add-root` fixes the issue.
How come these options |
The nix-shell options quoted above seem to be silently ignored today. I'm accomplishing something similar by parsing the output of |
Steps:
$PWD/etc/shell.nix
.nix-instantiate ./etc/shell.nix --indirect --add-root $PWD/etc/shell.drv
nix-shell --pure $PWD/etc/shell.drv
nix-collect-garbage -d
nix-shell --pure $PWD/etc/shell.drv
Result: the entire set of packages specified under
shell.nix
is downloaded againnixos-version
16.03.1083.d745044 (Emu)nix-env --version
(Nix) 1.11.2nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
16.09pre-gitThe text was updated successfully, but these errors were encountered: