^C'ed --keep-failed build leaves directory owned by root

  • Open
  • quality assurance status badge
Details
3 participants
  • Janneke Nieuwenhuizen
  • Ludovic Courtès
  • Ludovic Courtès
Owner
unassigned
Submitted by
Janneke Nieuwenhuizen
Severity
normal

Debbugs page

J
J
Janneke Nieuwenhuizen wrote on 28 Jun 01:48 -0700
(address . bug-guix@gnu.org)
87cyao9rq6.fsf@gnu.org
When running something like

Toggle snippet (3 lines)
guix build hello --with-configure-flag=hello=foo=bar --keep-failed

and hitting ^C during the `build' phase, the guix-daemon leaves

Toggle snippet (5 lines)
$ sudo ls -ld /tmp/guix-build-hello-2.12.2.drv-0 /tmp/guix-build-hello-2.12.2.drv-0/top
drwx------ 3 root root 4096 Jun 28 10:04 /tmp/guix-build-hello-2.12.2.drv-0
drwxr-xr-x 3 guixbuilder01 guixbuild 4096 Jun 28 10:04 /tmp/guix-build-hello-2.12.2.drv-0/top

This is after updating my system yesterday to guix-1.4.0-39. The
guix-daemon is running as root, so without using (privileged? #f).

Note that I have not been able to reproduce this when interrupting the
build during the `configure' phase. It also does not reproduce when
the build breaks by itself, e.g., when running something like

Toggle snippet (3 lines)
guix build hello --with-configure-flag=hello=CFLAGS=-Dparse_options=main --keep-failed

the build tree is owned by janneke.

Details and build log attached (I hope...).

Greetings,
Janneke

PS: I tried several times to report this using M-x fj-create-issue, but
I'm gettting either

Toggle snippet (5 lines)
Contacting host: codeberg.org:443
fedi-http--process-response:
404 page not found

or

Toggle snippet (4 lines)
Contacting host: codeberg.org:443
if: I am Error: The target couldn't be found. Endpoint: repos/janneke/guix/

I've tried for Repo, amongst others: C-c C-r guix, guix/guix,
codeberg.org/guix/guix, https://codeberg.org/guix/guix. Help much
appreciated. Also, an unsuccesful submit: C-c C-c, kills the buffer as
I found out after crafting it the first time. Emacs should *never* do
that, losing text is one of the main reasons I avoid using a browser!

Details

Toggle snippet (8 lines)
$ guix describe
Generation 102 Jun 27 2025 20:48:59 (current)
guix 93d10b5
repository URL: https://git.guix.gnu.org/guix.git
branch: master
commit: 93d10b5f4e709ed8d6f95f63f1279f52fd982ea8

Toggle snippet (16 lines)
$ guix system describe
Generation 158 Jun 27 2025 22:07:23 (current)
file name: /var/guix/profiles/system-158-link
canonical file name: /gnu/store/alii74y72cnhlv8cigxibw2y3kdrhhwh-system
label: GNU with Linux-Libre 6.14.11
bootloader: grub
root device: /dev/mapper/guix
kernel: /gnu/store/0a8vvmsl30f2wj4rqwa4lxjrcb5z2pcj-linux-libre-6.14.11/bzImage
channels:
guix:
repository URL: https://git.guix.gnu.org/guix.git
branch: master
commit: 93d10b5f4e709ed8d6f95f63f1279f52fd982ea8
configuration file: /gnu/store/n3y742pvdglzzdz2magw0fdv286v8nqk-configuration.scm

Toggle snippet (19 lines)
$ sudo herd status guix-daemon
Status of guix-daemon:
It is running since Fri Jun 27 22:13:10 2025 (12 hours ago).
Main PID: 647
Command: /gnu/store//gvd2gga48av5pjsyczqn6brdjz1d5xzf-guix-1.4.0-39.95d8845/bin/guix-daemon --build-users-group guixbuild --max-silent-time 3600 --timeout 86400 --log-compression gzip --discover=yes --substitute-urls "http://kluit.dezyne.org:8181 http://janneke.lilypond.org:8080 https://bordeaux.guix.gnu.org https://ci.guix.gnu.org"
It is enabled.
Provides: guix-daemon
Requires: user-processes guix-ownership avahi-daemon
Custom actions: set-http-proxy discover
Will be respawned.
Log file: /var/log/guix-daemon.log

Recent messages (use '-n' to view more or less):
2025-06-28 10:04:33 accepted connection from pid 26301, user janneke
2025-06-28 10:04:52 SIGPOLL
2025-06-28 10:04:52 note: keeping build directory `/tmp/guix-build-hello-2.12.2.drv-9'
2025-06-28 10:04:52 error (ignored): file `/tmp/guix-build-hello-2.12.2.drv-9/top/GMfifo3394' has an unsupported type
2025-06-28 10:04:52 unexpected build daemon error: interrupted by the user
Attachment: hello.log
--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote on 29 Jun 03:13 -0700
Reporting issues with fj.el
(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)(address . 78919@debbugs.gnu.org)
87h5zyua6y.fsf@inria.fr
Hi,

Just a quick note before looking at the actual bug…

Janneke Nieuwenhuizen <janneke@gnu.org> writes:

Toggle quote (13 lines)
> PS: I tried several times to report this using M-x fj-create-issue, but
> I'm gettting either
>
> Contacting host: codeberg.org:443
> fedi-http--process-response:
> 404 page not found
>
>
> or
>
> Contacting host: codeberg.org:443
> if: I am Error: The target couldn't be found. Endpoint: repos/janneke/guix/

I usually create issues from the “issue timeline”:

1. M-x fj-list-issues
2. c

Maybe there’s a bug such that doing ‘M-x fj-create-issue’ from another
context gets the repo wrong?

HTH!

Ludo’.
L
L
Ludovic Courtès wrote 2 days ago
Re: bug#78919: ^C'ed --keep-failed build leaves directory owned by root
(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)(address . 78919@debbugs.gnu.org)
87h5znnmc4.fsf@chbouib.org
Hi Janneke,

Janneke Nieuwenhuizen <janneke@gnu.org> writes:

Toggle quote (15 lines)
> When running something like
>
> guix build hello --with-configure-flag=hello=foo=bar --keep-failed
>
>
> and hitting ^C during the `build' phase, the guix-daemon leaves
>
> $ sudo ls -ld /tmp/guix-build-hello-2.12.2.drv-0 /tmp/guix-build-hello-2.12.2.drv-0/top
> drwx------ 3 root root 4096 Jun 28 10:04 /tmp/guix-build-hello-2.12.2.drv-0
> drwxr-xr-x 3 guixbuilder01 guixbuild 4096 Jun 28 10:04 /tmp/guix-build-hello-2.12.2.drv-0/top
>
>
> This is after updating my system yesterday to guix-1.4.0-39. The
> guix-daemon is running as root, so without using (privileged? #f).

I cannot reproduce it:

Toggle snippet (12 lines)
$ timeout -s INT 2s guix build hello --no-grafts --check -K -v1
The following derivation will be built:
/gnu/store/f0sgfzr1za0mnnm6bk9qiqkyapdby7bv-hello-2.12.2.drv

building /gnu/store/f0sgfzr1za0mnnm6bk9qiqkyapdby7bv-hello-2.12.2.drv...
\ 'configure' phase
$ ls -ld /tmp/guix-build-hello-2.12.2.drv-0/
drwxr-xr-x 3 ludo users 100 8 juil. 09:58 /tmp/guix-build-hello-2.12.2.drv-0/
$ sudo herd status guix-daemon |grep Command
Command: /gnu/store/l7dp21l1p6hal8hiky44csll9vd9f1j5-guix-1.4.0-39.95d8845/bin/guix-daemon --build-users-group guixbuild --max-silent-time 3600 --timeout 86400 --log-compression gzip --discover=yes --substitute-urls "https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://guix.bordeaux.inria.fr" --cache-failures

Is there something else at play?

Thanks,
Ludo’.
J
J
Janneke Nieuwenhuizen wrote 41 hours ago
(name . Ludovic Courtès)(address . ludo@chbouib.org)(address . 78919@debbugs.gnu.org)
87o6tucu24.fsf@gnu.org
Ludovic Courtès writes:

Hey Ludo,

Toggle quote (8 lines)
> Janneke Nieuwenhuizen <janneke@gnu.org> writes:
>
>> When running something like
>>
>> guix build hello --with-configure-flag=hello=foo=bar --keep-failed
>>
>> and hitting ^C during the `build' phase, the guix-daemon leaves

NOTE: `build' phase, _not_ 'configure'

Toggle quote (12 lines)
>> $ sudo ls -ld /tmp/guix-build-hello-2.12.2.drv-0 /tmp/guix-build-hello-2.12.2.drv-0/top
>> drwx------ 3 root root 4096 Jun 28 10:04 /tmp/guix-build-hello-2.12.2.drv-0
>> drwxr-xr-x 3 guixbuilder01 guixbuild 4096 Jun 28 10:04 /tmp/guix-build-hello-2.12.2.drv-0/top
>>
>>
>> This is after updating my system yesterday to guix-1.4.0-39. The
>> guix-daemon is running as root, so without using (privileged? #f).
>
> I cannot reproduce it:
>
> $ timeout -s INT 2s guix build hello --no-grafts --check -K -v1

This command throws INT during 'configure' on my computer

Toggle snippet (10 lines)
22:19:11 janneke@glimdal:~/src/guix/master
$ timeout -s INT 2s guix build hello --no-grafts --check -K -v1
The following derivation will be built:
/gnu/store/f0sgfzr1za0mnnm6bk9qiqkyapdby7bv-hello-2.12.2.drv

building /gnu/store/f0sgfzr1za0mnnm6bk9qiqkyapdby7bv-hello-2.12.2.drv...
/ 'configure' phase[124] 22:19:15 janneke@glimdal:~/src/guix/master
$

and ...

Toggle quote (7 lines)
> The following derivation will be built:
> /gnu/store/f0sgfzr1za0mnnm6bk9qiqkyapdby7bv-hello-2.12.2.drv
>
> building /gnu/store/f0sgfzr1za0mnnm6bk9qiqkyapdby7bv-hello-2.12.2.drv...
> \ 'configure' phase
> $ ls -ld /tmp/guix-build-hello-2.12.2.drv-0/

...from this output it seems on your computer too. Using

Toggle snippet (3 lines)
timeout -s INT 10s guix build hello --no-grafts --check -K -v1

works for me, or "just" hit ^C manually.

Toggle quote (6 lines)
> drwxr-xr-x 3 ludo users 100 8 juil. 09:58 /tmp/guix-build-hello-2.12.2.drv-0/
> $ sudo herd status guix-daemon |grep Command
> Command: /gnu/store/l7dp21l1p6hal8hiky44csll9vd9f1j5-guix-1.4.0-39.95d8845/bin/guix-daemon --build-users-group guixbuild --max-silent-time 3600 --timeout 86400 --log-compression gzip --discover=yes --substitute-urls "https://ci.guix.gnu.org https://bordeaux.guix.gnu.org https://guix.bordeaux.inria.fr" --cache-failures
>
> Is there something else at play?

I hope not, just the configure/build phase subtlety?

Greetings,
Janneke

--
Janneke Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com| Avatar® https://AvatarAcademy.com
L
L
Ludovic Courtès wrote 41 hours ago
(name . Janneke Nieuwenhuizen)(address . janneke@gnu.org)(address . 78919@debbugs.gnu.org)
87ikk2mm95.fsf@chbouib.org
Hi Janneke,

Wait, indeed, if I C-c during the ‘build’ phase, I end up with:

Toggle snippet (4 lines)
$ ls -lrtd /tmp/guix-build-hello-2.12.2.drv-0/
drwx------ 3 root root 60 8 juil. 22:44 /tmp/guix-build-hello-2.12.2.drv-0/

(This is counter-intuitive because the daemon doesn’t know what a phase
is, which is why I didn’t pay attention to the build phase…)

The reason appears in the output of guix-daemon:

Toggle snippet (5 lines)
2025-07-08 22:45:06 note: keeping build directory `/tmp/guix-build-hello-2.12.2.drv-0'
2025-07-08 22:45:06 error (ignored): file `/tmp/guix-build-hello-2.12.2.drv-0/top/GMfifo3392' has an unsupported type
2025-07-08 22:45:06 unexpected build daemon error: interrupted by the user

This comes from the call to ‘secureFilePerms’ added in
‘DerivationGoal::deleteTmpDir’ as part of
ae18b3d9e6bd0c184505a094851448d08555e23e, a commit that supports the
unprivileged daemon.

I’ll see how we can fix that.

Thanks!

Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 78919@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 78919
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch