guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does sh in the build environment ignore SIGINT and SIGQUIT?


From: Ludovic Courtès
Subject: Re: Why does sh in the build environment ignore SIGINT and SIGQUIT?
Date: Mon, 30 May 2022 17:20:46 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]