From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8GuFBQzhlGLE9wAAbAwnHQ (envelope-from ) for ; Mon, 30 May 2022 17:21:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8JBqBQzhlGJyPwEAauVa8A (envelope-from ) for ; Mon, 30 May 2022 17:21:48 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9CC19B4EC for ; Mon, 30 May 2022 17:21:47 +0200 (CEST) Received: from localhost ([::1]:42402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nvhDG-0006BS-Pi for larch@yhetil.org; Mon, 30 May 2022 11:21:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56488) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhCM-00064f-FG for guix-devel@gnu.org; Mon, 30 May 2022 11:20:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:39994) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhCM-00084K-6c for guix-devel@gnu.org; Mon, 30 May 2022 11:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=UyHMPQ9WuzaOOcFYTxbh+tah0BRC03KAB5I5ggU56RQ=; b=UNyp2ARGiiQAtYfzCj13 iG90hVKbYE5zi5QcT/7IKDFZVo6gBXsaGVpaVsnWyN3NdD9XVzxlJYLy1lpSbytU7Xd3JTo7DyQK1 8s2o5FyI6V+N0UZCEd3DUpKm/Eb+H03C6I3kjj7GzB7NFTBzXzt546GL8aoBalCYYXxqaE1pl2jwr 9g7onfukor/8/AygujPisuMY1n5+tB6Qtenz1wB+wRKlbD7nAQGHtw9KSnPVa5UP9UkLviZfELEnt oh7vAZjSPepuLbthnQ8WAoT2TI1p6YQwy2GTbTTuZHQj95B3ic5cu6XRQKwdzNWx0I6LvQM2YCVfr jXZ+IMKkZCGNnw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=41886 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nvhCL-0004Zf-52 for guix-devel@gnu.org; Mon, 30 May 2022 11:20:50 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: guix-devel@gnu.org Subject: Re: Why does sh in the build environment ignore SIGINT and SIGQUIT? References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Primidi 11 Prairial an 230 de la =?utf-8?Q?R=C3=A9vo?= =?utf-8?Q?lution=2C?= jour de la Fraise X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 30 May 2022 17:20:46 +0200 In-Reply-To: (Foo Chuan Wei's message of "Sun, 22 May 2022 08:00:15 +0000") Message-ID: <87v8tn2gj5.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1653924107; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=UyHMPQ9WuzaOOcFYTxbh+tah0BRC03KAB5I5ggU56RQ=; b=gc+dzjeCw1jEeV1aI56wFgVTkF9+kquIuBeZ0F9+Ssde5EHXZpDeHOeye68AdWlQCHsUIG 3pWBk+a//j9eSznQtyiHmFTM8hxrD2I37BeIDBGn9ikRr3T2k5+t6meMDqiGQNGAClZZIC bFKG70T+Dz5sUTZIelMhgjNXhn4C/Qg5TkUgkYPcCPVw+WS7q7RANbSNeIFZCcF7lqX0MQ Xk59KWDwzSCdD8oZtbYnPfaBLFj4BbXwzAWp2D7ShdI6cqEofWjcmKmoRkW8YsGx5Cy1xg 74Pq4Nhtwwg1bm56jHJik7nqFLHgjMCy0oGUr1QPGikGPbN7GlIJrCvVvvxCQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1653924107; a=rsa-sha256; cv=none; b=D7+/yeggdk4dmL3pjT55rCVT9jEUi2F8BDpgWj59BSY2FvbDto/J4l2CHnval2L5Tr2m00 ekDopwTX6VFMGK3M7RXoQTvC6DENXR2gw8BB9vZBaNAR0wEdBx7KtnDa3AeCU3EfHAPgmP ZEqXbohamuTHCvzRkqCF5ewJ71QIC38N6GcJt0qfBqFdOrlWIShP9bnxHnn0vHrCi3u9xs pplFv5ICS1v8smX7hI26dcIW2PvkLTAGqfjOPDPV15cu0eaMktL0uCw7Ko8tDhY9mGJwKS ChpDuCRfnl4xouxILG+W2gApHtJkxZtk8evxqjTgesjU2mSPJPO5aK4ucKnyXw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=UNyp2ARG; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.23 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=UNyp2ARG; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 9CC19B4EC X-Spam-Score: -4.23 X-Migadu-Scanner: scn1.migadu.com X-TUID: fxMpSznBKQ8E Hi, Foo Chuan Wei 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=E2=80=99s because it=E2=80=99s running as PID 1, which does not have d= efault signal handlers, unlike other processes (see the discussion at .) > 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=E2=80=99t think it can affect the resulting executable. Which signal handlers a process running =E2=80=98smlnj=E2=80=99 depends on run-time fact= ors, 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=E2=80=99.