[Nix-dev] [PATCH] Allow roots to refer to arbitrary files in the store

Ludovic Courtès ludo at gnu.org
Mon Apr 14 16:59:15 CEST 2014


ludo at gnu.org (Ludovic Courtès) skribis:

> Shea Levy <shea at shealevy.com> skribis:
>
>> On Mon, Apr 14, 2014 at 03:38:01PM +0200, Ludovic Courtès wrote:
>>> The patch below allows files such as /nix/store/foo to be protected from
>>> GC if a root refers to them.  This makes it easy for a build hook to use
>>> such files for its temporary working files.
>>> 
>>> WDYT?
>>> 
>>
>> It seems a bit odd to me to be using the store as a temporary file
>> location. What's wrong with $TMPDIR?
>
> Well, this is useful for build hooks, because it guarantees that any
> garbage they leave there will eventually be reclaimed.

It also guarantees that this thing lives on the same file system as the
store, which means that rename(2) can be used to move it to its final
location in the store.

Ludo’.


More information about the nix-dev mailing list