NixOS / nix

Nix, the purely functional package manager

Home Page:https://nixos.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nix-store --add doesn't update refrences properly

lolbinarycat opened this issue · comments

Steps To Reproduce

$ mkdir /tmp/gcbug
$ ln -s $(realpath /bin/sh) /tmpgcbug/sh
$ nix-store -q --tree $(nix-store --add /tmp/gcbug)
/nix/store/zk2qklkcilxpsxf0xbsi65g0b02ywaj2-gcbug

Expected behavior

the closure of the added path should contain bash.

nix-env --version output
nix-env (Nix) 2.18.1

Additional context

this causes store paths to be garbage collected while still alive. this should not ever happen.

Priorities

Add 👍 to issues you find important.