From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uL5cBGRkMWNg5gAAbAwnHQ (envelope-from ) for ; Mon, 26 Sep 2022 10:35:48 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id aIluBGRkMWO7tQAA9RJhRA (envelope-from ) for ; Mon, 26 Sep 2022 10:35: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 9EA5FC696 for ; Mon, 26 Sep 2022 10:35:47 +0200 (CEST) Received: from localhost ([::1]:55682 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocjDt-0007vL-FX for larch@yhetil.org; Mon, 26 Sep 2022 04:12:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocj9x-0005PR-13 for guix-devel@gnu.org; Mon, 26 Sep 2022 04:08:13 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:37403) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocj9t-0003qN-Mf for guix-devel@gnu.org; Mon, 26 Sep 2022 04:08:12 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 93D015C00BA; Mon, 26 Sep 2022 04:08:08 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 26 Sep 2022 04:08:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= philipmcgrath.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm2; t=1664179688; x=1664266088; bh=D/0CoSCMSq 9sBCuwNLjch68BMmpPRf4pTyX1pgCVsYY=; b=MAxvw+BspbOunn5vdbEXY0Jag7 CgpV5QE55uvjeipqDFWvwcLQtCy7qHleJpgUZrFPwNq5eVZWbXx5vJxzlTHr2/9c I32UMLdRXrwQlkv7kpUIoYxi8g3U5ThmIR7MMue0qUZoGKYwe32oGP6KKaK+6jjx dov/GbLfh2Qo1cpxdp/xAiz/HMnDnHv2aVgR9n4fUqr2SEVdljxO+StkszG/u07I e4wP5HQayanKlQhuOgpPyzaTdK1PQcDvPuSKIK5nK0AlAuedkODNAK50cUk95c/f nFRc6arQZQL/unQ1nRVEzgwls+U91zY6XcWOAEVVjqMS+0dm9c5N2UeIQvsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1664179688; x= 1664266088; bh=D/0CoSCMSq9sBCuwNLjch68BMmpPRf4pTyX1pgCVsYY=; b=D TwTi3hn9TEWQW3/4XbCNc8LB3ljs7luzyQChUxtYq6b1qROc69VyWlwjMqmJ8Rrf VCCR0QXoD8DL2wB+oaVCjmubIQGvP86E0QNCnSUxcauo3hvV4oq8GU/kZ02f4CiQ HsIOiNru74xi5YwxtVvfLN5b1zIOr8r8T+qoI8r+chIz9QWs23YJmVh593EcnqDI 5JuFbdyyJfHyaJmHY98cDdFMiG00CraavDk0/6wiVxC/jc5WSqMhyt+BDX3IY/Da hNWhNldIFneIwRJkmeQIFy3calFxkqEo2ulvZoXcqjRIJ+1U8MEHWHQlI0jnrcVY mLJgDuvClTHY9VxE8ntwA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrfeegvddgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtfeejnecuhfhrohhmpefrhhhi lhhiphcuofgtifhrrghthhcuoehphhhilhhiphesphhhihhlihhpmhgtghhrrghthhdrtg homheqnecuggftrfgrthhtvghrnhepjeeiffeghefhueeiueffgfefueetieffgedvfeeu vdekgeejvdevheejudefieehnecuffhomhgrihhnpehophgvnhhgrhhouhhprdhorhhgne cuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepphhhihhl ihhpsehphhhilhhiphhmtghgrhgrthhhrdgtohhm X-ME-Proxy: Feedback-ID: i2b1146f3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 26 Sep 2022 04:08:03 -0400 (EDT) Message-ID: Date: Mon, 26 Sep 2022 04:07:57 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 Subject: Re: What 'sh' should 'system' use? Content-Language: en-US To: Liliana Marie Prikler , guix Cc: Maxime Devos , Liliana Marie Prikler References: <2284386.8hzESeGDPO@bastet> <3147250c1695e9ff0885cec9b2ba847a31071bb1.camel@ist.tugraz.at> From: Philip McGrath In-Reply-To: <3147250c1695e9ff0885cec9b2ba847a31071bb1.camel@ist.tugraz.at> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=66.111.4.27; envelope-from=philip@philipmcgrath.com; helo=out3-smtp.messagingengine.com X-Spam_score_int: -65 X-Spam_score: -6.6 X-Spam_bar: ------ X-Spam_report: (-6.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-3.766, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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=1664181347; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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=D/0CoSCMSq9sBCuwNLjch68BMmpPRf4pTyX1pgCVsYY=; b=S1N7oBk9QHmtX3v3gSEhiVoqt3kkVzDmjMYXqBhB1nsZDwgRz5tE8EJuRfPA7C9WmPJQKO 02Kj2LreJ3C8m0z/5ndLHGf/4xRE49YBkwKIPa4bZy0wxDDjKcjkJ/d6NAR9Bg4IcvydfO 6AzI61kNU2eZg8SiV0v7SnIE/hrjDNPKLCDz1imz5ZwV/5NGNhmayIPkCW1obYOtwy98X4 5if7I0cwdM4umYDgjDtX53Z/553CW27OqrcUw+3uHkvW1aDEPTji73tqK/7iMFPzP3z6F4 o4/AWLuwoPfYd+Ksg5hR9uBagqBBQMj/OCfaPT3NrHdtwXKeJBIUT0RGNfJ9Ow== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664181347; a=rsa-sha256; cv=none; b=VSYIUauuPduTsirH9VahZsRg9kZv6CKHiQzwuLKL2SEoASWaq57ME39UWvpPSReMD8L8d4 qs+/+rcGVIxP/mlMMi9VdqLZdKniSDq7kXhA+0haMY4tQ+Rr8FBp8LdjArpAx0LS59yKQL nnxMtPt5uXTXRuxwtRccvowyPhEIOfI0cbqPqd2Hzg+LGwDZhSggoW09b/kX6JeLg+ipZD fvIu11E0rFhDMMbHlHG3pG9OPesiRJcJMsOZV5lKMT5PQnuI9K95P3Ljx20riLDSe8H+Ua hxqqQdicubErA31Mb8nOAx2r0X5ltsP5AoJqGeeWpbwPL/mBTzHzIwYY/3cNIg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm2 header.b=MAxvw+Bs; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="D TwTi3h"; dmarc=none; 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: 5.26 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=philipmcgrath.com header.s=fm2 header.b=MAxvw+Bs; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm2 header.b="D TwTi3h"; dmarc=none; 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: 9EA5FC696 X-Spam-Score: 5.26 X-Migadu-Scanner: scn1.migadu.com X-TUID: wLdkH+YBCK7A Hi, On 9/19/22 03:07, Liliana Marie Prikler wrote: > Am Sonntag, dem 18.09.2022 um 20:13 -0400 schrieb Philip McGrath: >> On the other hand, even Nix puts '/bin/sh' at its usual path: we >> are really quite an outlier in this respect. (IIUC, Nix also has >> '/usr/bin/env', but no other utilities at FHS paths.) > We are not. We provide both /bin/sh and /usr/bin/env. If you're > talking about the build container then that's a much smaller > distinction. > Yes, I'm talking about the build container. But for the build container, programs/libraries that use "/bin/sh" would work unmodified. >> More broadly, I now think it would be better in we embedded zero >> references to copies of Bash in libc. > I don't think we can do that without breaking system. > When "/bin/sh" is not available at runtime, I think libc's `system` ought to return 127, and other `system`-like functions should raise exceptions or whatever the idiomatic way is to signal failure. Of course, we will presumably need to make "/bin/sh" available in many more places, but don't think it's surprising for programs that need to run shell commands to fail in the absence of a shell. >> However, giving every program using Glibc a hard dependency on >> Bash—and on a particular Bash executable—seems like a much bigger >> imposition. > We're talking 1.7 MiB here. Certainly a "big" imposition, but > nothing in comparison to the things you need in the store for > bootstrapping purposes. Also note that bash-minimal, while only > taking up 1.0 MiB for itself, requires both glibc and gcc:lib, which > apart from creating a cycle does blow up its closure size quite a > bit. > I'm less concerned with the literal size than with the significance of putting a specific shell so near the root of most dependency graphs: I tried to give examples in my reply to Maxime, like creating containers without a shell. >>> In versions of glibc before 2.1.3, [...] system() always returned >>> 1 [...]. > Note that always returning non-zero is required by POSIX 2017. > To quote the whole paragraph from : > Note that, system(NULL) is required to return non-zero, indicating > that there is a command language interpreter. At first glance, this > would seem to conflict with the ISO C standard which allows > system(NULL) to return zero. There is no conflict, however. A system > must have a command language interpreter, and is non-conforming if > none is present. It is therefore permissible for the system() > function on such a system to implement the behavior specified by the > ISO C standard as long as it is understood that the implementation > does not conform to POSIX.1-2017 if system(NULL) returns zero. I understand that to mean that `system(NULL)` returning zero indicates that the program is not (currently) running in a POSIX.1-2017 environment. Guix creates many environments that do not conform to POSIX.1-2017: for example, any environment without `vi`. -Philip