unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org
Subject: Re: Why does sh in the build environment ignore SIGINT and SIGQUIT?
Date: Mon, 30 May 2022 17:20:46 +0200	[thread overview]
Message-ID: <87v8tn2gj5.fsf@gnu.org> (raw)
In-Reply-To: <PU1PR01MB2155A56B7FD179919DDB37C18DD59@PU1PR01MB2155.apcprd01.prod.exchangelabs.com> (Foo Chuan Wei's message of "Sun, 22 May 2022 08:00:15 +0000")

Hi,

Foo Chuan Wei <chuanwei.foo@hotmail.com> skribis:

> The shell in the environment where packages are built ignores SIGINT and
> SIGQUIT. If I add `(invoke "sh" "-c" "trap")` to a custom build phase,
> this output is produced during the build:
>
>     trap -- '' INT
>     trap -- '' QUIT
>
> Why does the shell in the build environment need to ignore these two
> signals?

That’s because it’s running as PID 1, which does not have default signal
handlers, unlike other processes (see the discussion at
<https://github.com/krallin/tini/issues/8#issuecomment-146135930>.)

> For context, this affects the build of the smlnj package
> (gnu/packages/sml.scm). The resulting executable seems to inherit the
> signal dispositions of the shell where the executable is built, with the
> result that CTRL-C is ignored at the sml REPL.

Lack of proper signal handler may affect the build process of smlnj, but
I don’t think it can affect the resulting executable.  Which signal
handlers a process running ‘smlnj’ depends on run-time factors, not on
its build environment, unless the build process explicitly records the
set of available signal handlers, but that would be a strange thing to
do.

Ludo’.


      parent reply	other threads:[~2022-05-30 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22  8:00 Why does sh in the build environment ignore SIGINT and SIGQUIT? Foo Chuan Wei
2022-05-22 14:14 ` Ryan Prior
2022-05-23  3:14   ` Foo Chuan Wei
2022-05-24  6:25     ` Foo Chuan Wei
2022-05-24 23:28       ` Kaelyn
2022-05-30 15:20 ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8tn2gj5.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).