From dcc37c236c66ba463bd61fec23d046485d8a412f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 1 Feb 2005 12:36:25 +0000 Subject: * nix-store, nix-instantiate: added an option `--add-root' to immediately add the result as a permanent GC root. This is the only way to prevent a race with the garbage collector. For instance, the old style ln -s $(nix-store -r $(nix-instantiate foo.nix)) \ /nix/var/nix/gcroots/result has two time windows in which the garbage collector can interfere (by GC'ing the derivation and the output, respectively). On the other hand, nix-store --add-root /nix/var/nix/gcroots/result -r \ $(nix-instantiate --add-root /nix/var/nix/gcroots/drv \ foo.nix) is safe. * nix-build: use `--add-root' to prevent GC races. --- src/libmain/shared.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libmain/shared.hh') diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh index 76b639e3785d..82da7550626f 100644 --- a/src/libmain/shared.hh +++ b/src/libmain/shared.hh @@ -17,6 +17,10 @@ void run(Strings args); /* Should print a help message to stdout and return. */ void printHelp(); +/* Ugh. No better place to put this. */ +Path makeRootName(const Path & gcRoot, int & counter); +void printGCWarning(); + extern string programId; -- cgit 1.4.1