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 ms9.migadu.com with LMTPS id oB/qHgmQP2SZYwAASxT56A (envelope-from ) for ; Wed, 19 Apr 2023 08:54:01 +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 YITUHgmQP2QifQAAauVa8A (envelope-from ) for ; Wed, 19 Apr 2023 08:54:01 +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 39A6F32D9 for ; Wed, 19 Apr 2023 08:54:01 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pp1h0-0007wu-TR; Wed, 19 Apr 2023 02:53:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pp1gz-0007wX-4f for help-guix@gnu.org; Wed, 19 Apr 2023 02:53:25 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pp1gx-0004CV-3R for help-guix@gnu.org; Wed, 19 Apr 2023 02:53:24 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 1C2BB2402BD for ; Wed, 19 Apr 2023 08:53:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681887201; bh=YYVCQUHHEmpZUnWpXO+azGlbQxyHBZ8oaQkR4bVsRL8=; h=From:To:Subject:Date:From; b=cgun4lVLLXlnuqpcG1HchQjRYEDo8xbRCJb7M+OiU4h8+LUGc2VZyHNnbJ26i4gco K/8DdScfzozk17J2rA8Q9X78Vg4CiGnMVYPsOS1jmvtPjX72/Z9/XZWLxibXUw04BD GhgAg4RHPoXxQ7qfTDvj+AeV6AtQH1wV4cuJa6hi6vNQdYuiLIh3wU2+hui8SXxf8Q 8RZkKqvNY3Gb0nLwBhJxDTNFrB220KHW0MnmGN5BW9i1yzhW5mElH7YKdoUp9TFbE0 Dtw4Xsp59hxXs25C1VhHvcaokIxVlLG9aaZ107piaVnEKOc61boYqqzCgh8pOfev8k 7JD37X6ASd5qg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q1Whc0yVXz6txc for ; Wed, 19 Apr 2023 08:53:19 +0200 (CEST) From: Kyle Andrews To: help-guix@gnu.org Subject: Alternatives to --emulate-fhs on foreign distros Date: Wed, 19 Apr 2023 06:18:33 +0000 Message-ID: <87cz407482.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=kyle@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: help-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=cgun4lVL; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1681887241; a=rsa-sha256; cv=none; b=sGxtLNpe9oPv9Z2L29oArvoCxonnAF9qaW4vZc5mXW8o/6OdKBLueDz83HHdxndxbGZRXR MOE+Doe0ymQiCrNg0jXcXWE/qhOx3YL6FOgLFBaYu6JWhH84D1vjVwDxJYqdcfi0om5Eud P+obAp3mLuGdqz5Vgy4d8NSqfsebIWpP3FzPZFYQI8oMo2+DEbf8D5/MgaRWFYPrah8Q6S HvkwO07jISYglK5DocCLH4gh/OKB6ybARdK/5+D43zoacdcYKwFgaLgQYhFmdt/Cq+Lh5n HQXjl+lPlci2hWxzQMNILQ+7GSOQ8OHhzESOlCv/NH48IjtWDdIl1nF7OlISLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1681887241; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=YYVCQUHHEmpZUnWpXO+azGlbQxyHBZ8oaQkR4bVsRL8=; b=rnSmAQOztYKNKyLhj+moDbmOHpcETRFQlbt3uAon3ncXZcDXwQ5hlN+jsJJ1Io8ffmmNY0 ENf1NXZo/2heCzukr3kyKzsZv0JIZfDNu3WM5VvdWOEAaTzBzl1wU6sueRYapMYJhfEKrO x3+GRkDwTQbDo3MWFCLHkNVROM18BngdK+B52OPvbMEWC3ZDZN2xOkQW/t+J+hlGzqJwKJ LfAxyjjP16PENcAow5SuNv8bl03ZirQXagiC/h1kerOKHisxUw1dryf2CXc0iG0ue3MrO2 7YXbqQZfWltARl9yzGsqmGmQfC289GuBNEEE0ZHAulqfdy5eeCYVO4PwmKEcVg== X-Migadu-Spam-Score: -6.50 X-Spam-Score: -6.50 X-Migadu-Queue-Id: 39A6F32D9 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=cgun4lVL; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net X-TUID: KS6Bn/IRP266 Dear Guix, The (many) shell scripts in my software depend on bashisms. In the code right now I typically use /usr/bin/env bash since I had read that was the most portable way of referencing a shell. However, I really don't think I have a good handle on what my choices are. Maybe the tedious solution of just typing `bash script.sh' in all of the system calls referencing this scripts might be the right approach in the long run? Should I be aiming to automatically patch my source code to point to a specific bash? Why doesn't this happen automatically? Is there a way to upgrade from /bin/sh to bash within a shell script? I know I can use --emulate-fhs to ensure that /bin/bash and /usr/bin/env bash are available, but that seems to preclude including the software directly in Guix without a container. I'm curious what other options might be. The main bashism I use is default environment variables ${FOO:-bar}. On a native Guix system I could just add /usr/bin/env back in. However, that doesn't seem to be possible with only Guix shell. Maybe I am wrong here? Thanks, Kyle