From unknown Sun Jun 15 08:27:01 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77878 <77878@debbugs.gnu.org> To: bug#77878 <77878@debbugs.gnu.org> Subject: Status: [PATCH] pre-inst-env: Issue a warning if nor run within a guix shell. Reply-To: bug#77878 <77878@debbugs.gnu.org> Date: Sun, 15 Jun 2025 15:27:01 +0000 retitle 77878 [PATCH] pre-inst-env: Issue a warning if nor run within a gui= x shell. reassign 77878 guix-patches submitter 77878 nomike severity 77878 normal tag 77878 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 17 17:37:12 2025 Received: (at submit) by debbugs.gnu.org; 17 Apr 2025 21:37:13 +0000 Received: from localhost ([127.0.0.1]:48730 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u5Wv0-0003Vo-Ru for submit@debbugs.gnu.org; Thu, 17 Apr 2025 17:37:12 -0400 Received: from lists.gnu.org ([2001:470:142::17]:53932) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u5Wuu-0003TZ-Hf for submit@debbugs.gnu.org; Thu, 17 Apr 2025 17:37:07 -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 1u5Wul-0003sq-H5 for guix-patches@gnu.org; Thu, 17 Apr 2025 17:36:57 -0400 Received: from fly.ash.relay.mailchannels.net ([23.83.222.61]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u5Wuj-0001bV-5o for guix-patches@gnu.org; Thu, 17 Apr 2025 17:36:55 -0400 X-Sender-Id: dreamhost|x-authsender|nomike@nomike.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id A00948A4048; Thu, 17 Apr 2025 21:36:49 +0000 (UTC) Received: from pdx1-sub0-mail-a254.dreamhost.com (trex-2.trex.outbound.svc.cluster.local [100.109.34.158]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 15EB98A35E7; Thu, 17 Apr 2025 21:36:49 +0000 (UTC) ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1744925809; a=rsa-sha256; cv=none; b=SumZdTGWz/7csY0MB24inGk1NaQJJijeiwUyet7znkJRvKDqxix7iLFJALKXYjbvE8yh5O +qsTjpmIog8eZXEMM+XEaZWH6xF+dD7XrwwjmlXUJNbwlZtiVGIR+IvAfbvr6yAny6jtgV nbfnJrg3252Aw5Y90rnuBbkfEqyCwxjTvI6wogXqZ2aLq5H4z6ElGZupgaXGusuh6rBqcg hss+WoBGkcB/lZz9Igs4kmBIQeK01ZiQ29R5dxGHc7h0r5vWYAAYu16Jpxj9Ju86WlCIZ6 n0SxmJHEXLxz48P/73xXHhua/m2S6CrSyi9ELE9zGaRj+770n8Svroy2bd6B0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1744925809; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:dkim-signature; bh=oNDjdSjJFWNjwVbEpkOBqcz14Q3dmLBKr4Ea7yfMdQE=; b=ietvJnka1/9vysv2ipaolYN7A553CsBBGc4/DjMnRtavhPsMekO8JKmMSsBLbGoX6/Hs3V LYjDmXG9gS9piUB5BFsm8dPECN9Q3gPF3ig7QEYrlIxzdFRNk+My2CnpXb6x5a5/0b4mR2 N0NC9LWop8FfBIZf4oi3O+iV/sKSiM9p3bdwmMHnV9ABswO8PN5D/b8R/isLS0fUJ5ZoBQ UUMx6iHB6j9aPkbyWagnPvjHDi7aM9Vbqhd/RCK11/r21ie+gjEWYT8SzU1NfBk6+rMqYZ Yx2MNKCKQTbR/5DyRlwGuvuQdBBNizBwEa0fYXc+9CTSl3eUlr9rNoGZlEUj0Q== ARC-Authentication-Results: i=1; rspamd-7bd9ff6c58-hcmmp; auth=pass smtp.auth=dreamhost smtp.mailfrom=nomike@nomike.com X-Sender-Id: dreamhost|x-authsender|nomike@nomike.com X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|nomike@nomike.com X-MailChannels-Auth-Id: dreamhost X-Dime-Eight: 62be421b2a64dfd1_1744925809505_1773763156 X-MC-Loop-Signature: 1744925809505:2303266351 X-MC-Ingress-Time: 1744925809505 Received: from pdx1-sub0-mail-a254.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.109.34.158 (trex/7.0.3); Thu, 17 Apr 2025 21:36:49 +0000 Received: from localhost (84-112-221-106.cable.dynamic.surfer.at [84.112.221.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nomike@nomike.com) by pdx1-sub0-mail-a254.dreamhost.com (Postfix) with ESMTPSA id 4ZdrnX4FXpz6F; Thu, 17 Apr 2025 14:36:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nomike.com; s=dreamhost; t=1744925808; bh=oNDjdSjJFWNjwVbEpkOBqcz14Q3dmLBKr4Ea7yfMdQE=; h=From:To:Cc:Subject:Date:Content-Transfer-Encoding; b=UGjGWD+jgjfgvaScXz96J/bqylE6ERmNffxP8PF1dz1iDvmoWUYCZXSRt0bhriaWR OGbzCM5aJK2QTaxeWTcOd446VvaULYWwW4L2ObiBVUiZCxrlBrxKAsgZBFnRzKLh2i IKafYepElqNXRVbpr5S0QnQjtxEG+qo4+zDh0GzntFZcrJj7A5PIOH9fUawTtb+aQR 6ekWfA3/MSTYuRNG/uzRzLMYDYDrFpr2U6Mw+q0PeKMMJiO2/v6a23hLsDaU001nRX z/6jEIV/I083DUyjYwJD4w/Hto903Ey6x0sGEPLFS0JpZVWNk4v50tUzld70K3ott3 4jnq5r2rRyy+Q== From: nomike To: guix-patches@gnu.org Subject: [PATCH] pre-inst-env: Issue a warning if nor run within a guix shell. Date: Thu, 17 Apr 2025 23:36:29 +0200 Message-ID: <20250417213637.2085198-1-nomike@nomike.com> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=23.83.222.61; envelope-from=nomike@nomike.com; helo=fly.ash.relay.mailchannels.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: submit Cc: nomike X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) Change-Id: I9f212b3c665b7d8ac653c44eeafe6fc41da5b8ff --- When running ./pre-inst-env on a foreign distro not within a guix shell, weird things happen. ```plaintext $ ./pre-inst-env guix lint nano guix: lint: command not found hint: Did you mean `lint'? Try `guix --help' for more information. ``` This patch changes pre-inst-env to issue a warning in that case, which could be especially helpful for newbies. Perhaps a pointer to the right place in the documentation would be helpful here as well. build-aux/pre-inst-env.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build-aux/pre-inst-env.in b/build-aux/pre-inst-env.in index cd90a06cbc..6081d7aaa5 100644 --- a/build-aux/pre-inst-env.in +++ b/build-aux/pre-inst-env.in @@ -24,6 +24,11 @@ # Run COMMAND in a pre-installation environment. Typical use is # "./pre-inst-env guix build hello". +# Check whether we currently are in a guix shell and issue a warning if we're not +if [ -z "$GUIX_ENVIRONMENT" ]; then + echo "\e[1mWarning:\e[0m you are not in a guix shell. This may lead to unexpected results." >&2 +fi + # By default we may end up with absolute directory names that contain '..', # which get into $GUILE_LOAD_PATH, leading to '..' in the module file names # recorded by Guile. To avoid that, make sure we get a real absolute -- 2.49.0