[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nix-dev] [PATCH] Allow roots to refer to arbitrary files in the sto
Re: [Nix-dev] [PATCH] Allow roots to refer to arbitrary files in the store
Tue, 15 Apr 2014 21:34:01 +0200
Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux)
Shea Levy <address@hidden> skribis:
> On Mon, Apr 14, 2014 at 04:59:15PM +0200, Ludovic Courtès wrote:
>> address@hidden (Ludovic Courtès) skribis:
>> > Shea Levy <address@hidden> 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.
> Hmm using the store as an auto-collected $TMPDIR seems wrong, but this
> is a decent argument. Do you have a specific use case already planned?
Yup, the build hook, as I wrote (specifically, for the temporary it uses
when restoring from a Nar.)
The other option is to use the temporary root file (that’s what
build-remote.pl does.) That’s nice, but it requires exposing a lot of
implementation details (GC lock, GC roots directory, etc.)
- [PATCH], Ludovic Courtès, 2014/04/14