guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Allow roots to refer to arbitrary files in the store


From: Ludovic Courtès
Subject: Re: [PATCH] Allow roots to refer to arbitrary files in the store
Date: Tue, 15 Apr 2014 22:11:37 +0200
User-agent: Gnus/5.130009 (Ma Gnus v0.9) Emacs/24.3 (gnu/linux)

Eelco Dolstra <address@hidden> skribis:

> On 14/04/14 16:59, 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.
>
> The problem with your patch is that those roots don't get cleaned up
> automatically.  A better solution is to generalize the handling of temporary
> store paths like lock files and chroot directories; check out the calls to
> isActiveTempFile() in tryToDelete() in gc.cc. Those don't get deleted while 
> the
> associated build is still running, but do get deleted afterwards.

Hmm yes, I know.

I wanted to avoid going at lengths to expose all that but OK.  That
raises the barrier for build hook implementors...

Thanks,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]