From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id UGhGJNatjWGFsAAAgWs5BA (envelope-from ) for ; Fri, 12 Nov 2021 00:57:10 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SJj1H9atjWFEWgAAB5/wlQ (envelope-from ) for ; Thu, 11 Nov 2021 23:57:10 +0000 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 3963E9C94 for ; Fri, 12 Nov 2021 00:57:10 +0100 (CET) Received: from localhost ([::1]:43106 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlJwK-0007AD-LQ for larch@yhetil.org; Thu, 11 Nov 2021 18:57:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlJwE-0007A4-RC for guix-patches@gnu.org; Thu, 11 Nov 2021 18:57:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:59231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlJwE-00068y-If for guix-patches@gnu.org; Thu, 11 Nov 2021 18:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlJwE-00007t-Do for guix-patches@gnu.org; Thu, 11 Nov 2021 18:57:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#51780] [PATCH] environment: Fix =?UTF-8?Q?=E2=80=98--check=E2=80=99?= with exported PS1 variable. Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 11 Nov 2021 23:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51780 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51780@debbugs.gnu.org Cc: Thiago Jung Bauermann X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.1636675018473 (code B ref -1); Thu, 11 Nov 2021 23:57:02 +0000 Received: (at submit) by debbugs.gnu.org; 11 Nov 2021 23:56:58 +0000 Received: from localhost ([127.0.0.1]:42544 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlJwA-00007Z-91 for submit@debbugs.gnu.org; Thu, 11 Nov 2021 18:56:58 -0500 Received: from lists.gnu.org ([209.51.188.17]:44762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlJw8-00007R-Dx for submit@debbugs.gnu.org; Thu, 11 Nov 2021 18:56:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlJw8-00079v-65 for guix-patches@gnu.org; Thu, 11 Nov 2021 18:56:56 -0500 Received: from mx.kolabnow.com ([212.103.80.154]:33798) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlJw6-00068L-0w for guix-patches@gnu.org; Thu, 11 Nov 2021 18:56:55 -0500 Received: from localhost (unknown [127.0.0.1]) by mx.kolabnow.com (Postfix) with ESMTP id A5638709 for ; Fri, 12 Nov 2021 00:56:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :message-id:date:date:subject:subject:from:from:received :received:received; s=dkim20160331; t=1636675010; x=1638489411; bh=L+36DT02j+6dBoaNJt5S9t+2YBVTDvk4kKW0EEmXXDo=; b=wQpTLcRE7638 T9NJjruPGp/J+q+yD0+PvVTA7oys/h9fg98/98/vC4ytn+ump5yNB8XlzZwy/XYc uH+lFVSD+0Sz1emWNMYmWOyrcqPLsqvOCh3Dy9XQaWbyF6ffbaUhbKIJYinUacBj o92n9vwIYIGdEizopcwn6gGqNZOWAiKlZ8lse8x0vC8W3ixvOOgixvTfIa243cF3 1EP4jicxqhlR4I/hM8RqQK1y4DYxHuxch1vXdwhm0tqMPNlWEShlLQszWituVeIu 2M2/26tJIjfx7O4UsZ2sEE3meNSF/okKfkzKb/hW+zkw73/rXfkT3X+Vmiy0Pozb qKcdQvPIb1N6k7etiDmzG+oty8K+xswPM7CZrKLf8TeBR4IF8HxI9SvfkS4rEW3I wDKgtVWAPRC/bLObzEuhb8VMg/JvGUGr2UKEgC6v5VP1OemaTrIwi3Hf3JWR1bIw RNNi4FEV5CYSqlQY4kgwQfBK6yhXslp8vemAT5r/24EH00vpHFUFABbeytIs+K0i mi1XvZ1aBX/8illPRw+s9csKUopiGlPXQlkK3U2GaFG6iud4GswXvosa0fyuy5Zi hums0kr3frVWP55J5SXObZDDp/0cmPCftdMVnf/e7Kj5/AcQvOVNz5OplKPGrp1L Ire1CfhyNwvEG/QW6D6zPz8irXJcwY0= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZkA8AJ0B5rS9 for ; Fri, 12 Nov 2021 00:56:50 +0100 (CET) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by mx.kolabnow.com (Postfix) with ESMTPS id F1F7E5C1 for ; Fri, 12 Nov 2021 00:56:49 +0100 (CET) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id E8CDF901; Fri, 12 Nov 2021 00:47:05 +0100 (CET) Date: Thu, 11 Nov 2021 20:46:48 -0300 Message-Id: <20211111234648.672963-1-bauermann@kolabnow.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=212.103.80.154; envelope-from=bauermann@kolabnow.com; helo=mx.kolabnow.com 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches From: Thiago Jung Bauermann via Guix-patches via X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636675030; h=from:from:sender:sender:reply-to: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:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=L+36DT02j+6dBoaNJt5S9t+2YBVTDvk4kKW0EEmXXDo=; b=Kk+Yoc/gaafiWvvooAHqmhoiAwLQn+4JXbcMBVbL2EUAXlkUad+P6WAhBSDhcK5qM+ZNtH sixJSOI5MkliCSiqt/hHykg6XIxV2C+BIJje+ZHjOoGCM3qHxSqOu2vcAzCXDTPJyUvLR6 XVa1VM0eiY92Ziti3BjQ7QDg50NYfiios9+M4U/32dxkJa5YfTQYw2SOtDIBeN/nRKZCZY LDYgGyLuSomlKxgUwCBCe98XOfLNR/lbDU765RrT7TWYNAxXMq7XhjumjvMKmIKe9dKBl0 PpGzSgOVHSoMCiiThWFDRR7StRL98wa6QV74yFFicHRN+y5oTOxNY4Ow0Ak/Bw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636675030; a=rsa-sha256; cv=none; b=fxRwNvC0VvLaFIupT4vTL9/s2eiIsOgADFNmJPeszcnO/brg22Av29dyW350Zjsmtd4ks+ HfJIe+5MU09cYdWK7H+2Lk3qDeAr7Ah34G379GObn6DZaykUUHL3lQIm827XjtPAgCjE8S YlGlRnWTgA+3LSRJToI/xhKOKqKj0N5qsHHmJIsC/pd1wGjuRVSCWi/W+FY9Qe8rh3O5ID CxGdbRbOs16sfIAqxOg9GaQcKB5XtYD8QtXzqb7zG7qIRuAibCZSOCOHjQje2ra2MLgrPc tX1N3xMX8yw9R7NeGq1qF6q+Pr8LqFvv1l4FkfNHloSt2MOAfZOHWAAMO9Bgrw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=wQpTLcRE; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -3.53 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kolabnow.com header.s=dkim20160331 header.b=wQpTLcRE; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 3963E9C94 X-Spam-Score: -3.53 X-Migadu-Scanner: scn1.migadu.com X-TUID: qTZ6+lykh5YP If your .bashrc (unnecessarily) exports PS1 and you’re in a non-login shell, Guix crashes: --8<---------------cut here---------------start------------->8--- user@popigai:~$ guix shell --check coreutils guix shell: checking the environment variables visible from shell '/bin/bash'... Backtrace: 14 (primitive-load "/home/user/.config/guix/current/bin/g…") In guix/ui.scm: 2206:7 13 (run-guix . _) 2169:10 12 (run-guix-command _ . _) In ice-9/boot-9.scm: 1752:10 11 (with-exception-handler _ _ #:unwind? _ # _) 1752:10 10 (with-exception-handler _ _ #:unwind? _ # _) In guix/store.scm: 658:37 9 (thunk) 1320:8 8 (call-with-build-handler _ _) 1320:8 7 (call-with-build-handler # …) In guix/status.scm: 800:4 6 (call-with-status-report _ _) In guix/scripts/environment.scm: 951:12 5 (_) In guix/store.scm: 2119:24 4 (run-with-store # …) In guix/scripts/environment.scm: 521:35 3 (_ _) In unknown file: 2 (string=? ("PS1" . "${debian_chroot:+($debian_chroot)…") …) In ice-9/boot-9.scm: 1685:16 1 (raise-exception _ #:continuable? _) 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: In procedure string=: Wrong type argument in position 1 (expecting string): ("PS1" . "${debian_chroot:+($debian_chroot)}\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\w\\[\\033[00m\\]${EXTRA}\\$ ") user@popigai:~$ --8<---------------cut here---------------end--------------->8--- This is because the match pattern doesn’t expect `(vhash-assoc "PS1" actual)` to return a pair. * guix/scripts/environment.scm (validate-child-shell-environment): Change match pattern to expect a pair. --- guix/scripts/environment.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 8176de4a5e8c..821f20e2f223 100644 --- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -517,7 +517,7 @@ (define-syntax-rule (warn exp ...) (unless warned? (match (vhash-assoc "PS1" actual) (#f #f) - (str + ((_ . str) (when (and (getenv "PS1") (string=? str (getenv "PS1"))) (warning (G_ "'PS1' is the same in sub-shell~%")) (display-hint (G_ "Consider setting a different prompt for base-commit: 893a31ec20f47b979c1be9fb8b942809228ba4c9