Hi Chris, Chris Marusich <cmmarus...@gmail.com> 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’.