Ludovic Courtès <[email protected]> writes: > Hello, > > Maxim Cournoyer <[email protected]> writes: > >> Your analysis appears correct; the above 'make' runs with PID 3. >> >> --8<---------------cut here---------------start------------->8--- >> maxim@terra ~/src/forgejo$ guix shell -CNF -m manifest.scm -- env >> GOPATH=/tmp TAGS="bindata timetzdata sqlite sqlite_unlock_notify" make build >> go: downloading go1.24.3 (linux/amd64) >> ^Cgo: downloading go1.24.3 (linux/amd64) >> ^Cgo: downloading go1.24.3 (linux/amd64) >> ^Cgo: downloading go1.24.3 (linux/amd64) >> ^Cgo: downloading go1.24.3 (linux/amd64) >> ^CForgejo requires Go 1.24 or greater to build. You can get it at >> https://go.dev/dl/ >> make: *** [Makefile:297: go-check] Error 1 >> ^C^C^C^C^C^C^C^C^C >> # doesn't abort, need kill -9 $pid >> --8<---------------cut here---------------end--------------->8--- >> >> This doesn't handle signals as expected because it runs as PID 1. I >> agree this needs be documented or better, handled with --init ala >> docker. > > I didn’t follow closely but how about this: > > diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm > index 1c2d222c748..43cfffbd9cb 100644 > --- a/guix/scripts/environment.scm > +++ b/guix/scripts/environment.scm > @@ -980,6 +980,11 @@ (define* (launch-environment/container #:key command > bash user user-mappings > ;; Call an additional setup procedure, if provided. > (when setup-hook > (setup-hook profile))) > + > + ;; Do not run the shell as PID 1 since that prevents proper signal > + ;; handling (?). > + #:child-is-pid1? #f > + > #:guest-uid uid > #:guest-gid gid > #:writable-root? writable-root?
The proposed patch used to work for long time, but is broken by --8<---------------cut here---------------start------------->8--- commit c3fefb065c53703e3dc6507c813182101c5c3a38 Author: Ludovic Courtès <[email protected]> Date: Sat Feb 7 18:33:45 2026 +0100 gnu: guile: Change ‘guile-3.0-latest’ to 3.0.11. * gnu/packages/guile.scm (guile-3.0-latest): Switch to ‘guile-3.0.11’. * gnu/packages/ci.scm (cuirass)[arguments]: Add ‘skip-known-failing-tests’ phase. Change-Id: I3f93c2947875b68252475291e068071a6054a5f5 gnu/packages/ci.scm | 18 +++++++++++++++++- gnu/packages/guile.scm | 2 +- 2 files changed, 18 insertions(+), 2 deletions(-) bisect found first bad commit --8<---------------cut here---------------end--------------->8--- On the commit above, with the patch applied, `guix shell -C' just hangs. Reproducer script (used for bisecting) attached. Tomas
76282-shell-sigint
Description: bisect script
-- There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.
