guix-devel
[Top][All Lists]
Advanced

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

Re: 'guix build' and garbage collection


From: Ludovic Courtès
Subject: Re: 'guix build' and garbage collection
Date: Sun, 02 Apr 2017 11:30:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Hi Chris,

Chris Marusich <address@hidden> skribis:

> I saw this in guix/scripts.build.scm:
>
> (and (build-derivations store drv mode)
>      (for-each show-derivation-outputs drv)
>      (for-each (cut register-root store <> <>)
>                (map (lambda (drv)
>                       (map cdr
>                            (derivation->output-paths drv)))
>                     drv)
>                roots))
>
> Here, we build the derivations, and then we add indirect GC roots.  My
> question is: what guarantee is there that the output paths will not be
> garbage collected after we build the derivations but before we add the
> indirect GC roots?

For the duration of the connection to the build daemon, build results
are registered as GC roots, so we’re fine.

You can see it in the ‘DerivationGoal’ constructor in libstore/build.cc:

    /* Prevent the .chroot directory from being
       garbage-collected. (See isActiveTempFile() in gc.cc.) */
    worker.store.addTempRoot(drvPath);

Likewise in ‘SubstitutionGoal::init’.

HTH,
Ludo’.



reply via email to

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