Subject: bug#25018: GC incorrectly removes the temporary root file of the calling process

From: Ludovic Courtès <[email-masked]>
Date: Mon, 10 Oct 2022 10:01:01 +0200

Hi Maxim,

Maxim Cournoyer <[email-masked]> skribis:

> I'm not Eelco, but your change LGTM.  Note that the upstream version
> still uses the original code [0].

Right.

> I've installed the change, tested that it had the expected result:
>
> reading temporary root file `/var/guix/temproots/8386'
> waiting for read lock on `/var/guix/temproots/8386'
> got temporary root `/gnu/store/0siy93lggjw7sfdg8gsvrzafaa974h2d-foo'
> considering whether to delete `/gnu/store/0siy93lggjw7sfdg8gsvrzafaa974h2d-foo'
> |   cannot delete `/gnu/store/0siy93lggjw7sfdg8gsvrzafaa974h2d-foo' because it's a root
> |   cannot delete `/gnu/store/0siy93lggjw7sfdg8gsvrzafaa974h2d-foo' because it's still reachable
> ice-9/boot-9.scm:1685:16: In procedure raise-exception:
> ERROR:
>   1. &store-protocol-error:
>       message: "cannot delete path `/gnu/store/0siy93lggjw7sfdg8gsvrzafaa974h2d-foo' since it is still alive"
>       status: 1
>
> and pushed!

Thank you!  (Your bug triage work is much appreciated!)  We could turn
the example here in a unit test; the only downside is that running the
GC in a test is expensive.

Ludo’.