Subject: ^C'ed --keep-failed build leaves directory owned by root
From: Janneke Nieuwenhuizen <[email-masked]>
To: [email-masked]
Date: Sat, 28 Jun 2025 10:48:33 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

When running something like

--8<---------------cut here---------------start------------->8---
guix build hello --with-configure-flag=hello=foo=bar --keep-failed
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
guix build hello --with-configure-flag=hello=CFLAGS=-Dparse_options=main --keep-failed
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
Contacting host: codeberg.org:443
fedi-http--process-response: 
404 page not found
--8<---------------cut here---------------end--------------->8---

or

--8<---------------cut here---------------start------------->8---
Contacting host: codeberg.org:443
if: I am Error: The target couldn't be found. Endpoint: repos/janneke/guix/
--8<---------------cut here---------------end--------------->8---

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

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
$ 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
--8<---------------cut here---------------end--------------->8---

-- 
Janneke Nieuwenhuizen <[email-masked]>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com