Check out https://github.com/NixOS/nix/blob/master/src/libstore/gc.cc, particularly addTempRoot (which is called by nix before any new nix path is written or considered valid) and openGCLock.
The answer to "what happens" is that invariants are preserved, though possibly at the cost of a long wait. ~Shea On Wed, Oct 01, 2014 at 01:58:33AM +0100, Vincent Laporte wrote: > Hi, > > Out of curiosity, I wonder what happens if the garbage collection > (nix-collect-garbage) is run while some other process builds a package > (nix-build or nix-env -i), both operating on the same store at the same > time. > > In particular, the collector may remove a path that is a dependency of a > package being built. How do you address this issue? > > Thanks, > -- > Vincent. > _______________________________________________ > nix-dev mailing list > [email protected] > http://lists.science.uu.nl/mailman/listinfo/nix-dev _______________________________________________ nix-dev mailing list [email protected] http://lists.science.uu.nl/mailman/listinfo/nix-dev
