From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uJ2SMLSRCWKwDAEAgWs5BA (envelope-from ) for ; Mon, 14 Feb 2022 00:18:12 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qHcSLbSRCWLaRwEAauVa8A (envelope-from ) for ; Mon, 14 Feb 2022 00:18:12 +0100 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 E7AF51B49A for ; Mon, 14 Feb 2022 00:18:11 +0100 (CET) Received: from localhost ([::1]:48018 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJO8B-000632-0s for larch@yhetil.org; Sun, 13 Feb 2022 18:18:11 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60334) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJO82-00062t-7O for bug-guix@gnu.org; Sun, 13 Feb 2022 18:18:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45235) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJO81-0002hC-TN for bug-guix@gnu.org; Sun, 13 Feb 2022 18:18:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJO81-0007YY-Lj for bug-guix@gnu.org; Sun, 13 Feb 2022 18:18:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#51466: bug#53355: guix shell --check: confusing error message Resent-From: Chris Marusich Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sun, 13 Feb 2022 23:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51466 X-GNU-PR-Package: guix X-GNU-PR-Keywords: moreinfo To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 51466-submit@debbugs.gnu.org id=B51466.164479425829016 (code B ref 51466); Sun, 13 Feb 2022 23:18:01 +0000 Received: (at 51466) by debbugs.gnu.org; 13 Feb 2022 23:17:38 +0000 Received: from localhost ([127.0.0.1]:39132 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJO7c-0007Xv-Tx for submit@debbugs.gnu.org; Sun, 13 Feb 2022 18:17:38 -0500 Received: from mail-pl1-f177.google.com ([209.85.214.177]:38615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJO7Z-0007Xg-Sd for 51466@debbugs.gnu.org; Sun, 13 Feb 2022 18:17:35 -0500 Received: by mail-pl1-f177.google.com with SMTP id c3so9201448pls.5 for <51466@debbugs.gnu.org>; Sun, 13 Feb 2022 15:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=iiEVZTE5lTju0+EWi7oRZo+JjgUrJeOHwGfwt7I/41o=; b=lRVDHQCC97ra2GqG8tQiJwL+fW+altPKWGJdsyVn7ta8c6TyiFo1I5y/qEaTSMRrP+ VGmcjlFTpFnOQ5+P43JN6hJxYFHhp5t+K33LtSixRs8DCwBxU9pAh0x4TWP7dvdiVDDt tpdv5U8aOJGO8zezHxaYnNvaBTnPPSNohPuRXq3nyu0eOuA/n64QOK6I1P7EOTUqmRDg 8GTIka3qgiA46RvDZozqUtM1P5pX/uEw8eGE3aSXT2fYtKaTAZaDFdb9v6neppZKiex/ YVXgk/J91hIYl4oK+O8PSFBuUy2e8P6cxgx4vWtD+UhGawJFwKZhDoKGLQOl4CSYqELT lWNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=iiEVZTE5lTju0+EWi7oRZo+JjgUrJeOHwGfwt7I/41o=; b=ettNd3DGc0/5v/TcnhNuvGyW4/4/PnG69/5wdnnE4pyibOdxmCFlAebwlwN3PxMdrO WUruhrJOn9GhiLKQHHdW4JKZCfLvSuBPie+m5EG55fJ8TuDJmnhSecRMKmvl5RaMEs6h n2MxFeWNPFiANoGJxQNSdoUB8qXPGccthzKt+okwX4jymqjIubowz3ovqVq8HBGfH+8G 0axk1JRm9tIIdaTmd3frwbY28OKhbW7/M/IK4rf2lcjPrpg75QmyrviHJDraTDrrPkhB mfEaQQryG33kgQw+sNby+2QM6IsEPpRL6wG0giECQ+T/6U2JXudQ1CWIwyUee1BScHLw eajg== X-Gm-Message-State: AOAM533ORySephsE++zHxGp/P5VUAuugsN/xPK4f2dZx3/z72X/EBA2Y icxYKilL/AGWEOZmw02StcGz3UjiLBs= X-Google-Smtp-Source: ABdhPJyNVCaQ4HMTNzA2Re9uzBIaO734glRjMSPooDdj662QrSZE1t9f38JujYtV3nHKxWHrOlFvhw== X-Received: by 2002:a17:902:ecc1:: with SMTP id a1mr7873173plh.111.1644794245942; Sun, 13 Feb 2022 15:17:25 -0800 (PST) Received: from garuda-lan (c-71-231-157-28.hsd1.wa.comcast.net. [71.231.157.28]) by smtp.gmail.com with ESMTPSA id 13sm12041058pje.50.2022.02.13.15.17.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Feb 2022 15:17:25 -0800 (PST) From: Chris Marusich References: <87h7a08kub.fsf@gmail.com> <87lez5td4n.fsf@gnu.org> <87sftc4osu.fsf@gmail.com> <87h79slysd.fsf@gnu.org> <87sft13dyv.fsf@gmail.com> <874k59d802.fsf@gnu.org> Date: Sun, 13 Feb 2022 15:17:20 -0800 In-Reply-To: <874k59d802.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Tue, 08 Feb 2022 10:26:21 +0100") Message-ID: <87wnhy2w73.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 51466@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1644794292; 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:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=iiEVZTE5lTju0+EWi7oRZo+JjgUrJeOHwGfwt7I/41o=; b=B3ISBAVcWX8et+XUdj2VuAycNyl02aEIDNWpFeOiPB9HhoJh8oClg0pvn3m0QmtezPai5S +L1QdwoaJ2bdEqWMx8Hxwm10KY6e3UO342KzI7BYRl0aDKmvxebH31hIuXs9vFVREKl0Qg Laa76/q8yqeQLM1S3/B/sUTU2D5jhnUbU8qp0SjQPvmaL02o44dFg7Pb4hPta5NoX4AWMW TV+tVSry4v4hadyiCsEZux+hOU3VHTnEAFpfyLcCCmP/QTeeoPUCkmvN+RV7AIkL20W+7G 5M35ulaXZu80+vNPYNuECDlmcElSajjqaS4hGpdzFN/yeWGYohFF05TYZ/1u/g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1644794292; a=rsa-sha256; cv=none; b=C8l13ejvZ97sPQUpS1BAN6w0IkQHsk8MDD1tGk8/pwv+uMQxmuLNLaecrb4RQHL1yhYOxv BxGSdaUly8UpgprUCdz9BEYCVsXv504BWMDCD+L1LP2sa9qBVoG3bBZJ6PvnB2TxfL17Yj jV9khj9L5msdM0PtymplWfDg0AqJ5l7nIvqfi+2Pq5IbfN25ndWafi/GD6LJRae7TTPjDX 4gWZTIc0sR1pLdXE9cMoWaBQMjCjwTwb8EyNxF/vnRSJIGpvt+gtTqAzmgBf3BUX9w9HpN osfoOEhvbnirScewShAwjtDZU4B+7w9+NNJn2n8KtkGX347qoQvAn+TAKhGUyw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=lRVDHQCC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=lRVDHQCC; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E7AF51B49A X-Spam-Score: -4.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: LiKaN8d09I3o --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Ludo, Ludovic Court=C3=A8s writes: > How about this: > > diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm > index ec071402f4..ac2c79ab65 100644 > --- a/guix/scripts/environment.scm > +++ b/guix/scripts/environment.scm > @@ -420,7 +420,7 @@ (define script > ;; Script to obtain the list of environment variable values. On a P= OSIX > ;; shell we can rely on 'set', but on fish we have to use 'env' (fis= h's > ;; 'set' truncates values and prints them in a different format.) > - "env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") > + "PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; e= xit\n") >=20=20 > (define lines > (match (primitive-fork) Unfortunately, this doesn't quite work. I tried this patch: =2D-8<---------------cut here---------------start------------->8--- diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 510cee727f..4399a5dd04 100644 =2D-- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -420,7 +420,7 @@ (define script ;; Script to obtain the list of environment variable values. On a POS= IX ;; shell we can rely on 'set', but on fish we have to use 'env' (fish's ;; 'set' truncates values and prints them in a different format.) =2D "env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") + "PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exi= t\n") =20 (define lines (match (primitive-fork) @@ -440,7 +440,7 @@ (define lines (result (begin (display script port) (let loop ((lines '())) =2D (match (read-line port) + (match (pk 'read-line (read-line port)) ((? eof-object?) (reverse lines)) ("GUIX-CHECK-DONE\r" (display "done\n" port) @@ -458,10 +458,10 @@ (define lines ;; but it also truncates values anyway, so don't try to support = it. (let ((index (string-index line #\=3D))) (if index =2D (vhash-cons (string-take line index) + (vhash-cons (pk 'variable line (string-take line index)) (string-drop line (+ 1 index)) table) =2D table))) + (pk 'dropped line table)))) vlist-null lines)) =2D-8<---------------cut here---------------end--------------->8--- Here is the output: =2D-8<---------------cut here---------------start------------->8--- [0] [env] marusich@suzaku:~/guix-master $ ./pre-inst-env guix shell --check --pure --development guix guix shell: checking the environment variables visible from shell '/bin/bas= h'... ;;; (read-line "PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; r= ead x; exit\r") ;;; (read-line "\x1b[?2004h[0] [env] marusich@suzaku:~/guix-master\r\r") ;;; (read-line "$ PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE;= read x; exit\r") ;;; (read-line "\x1b[?2004l\rPKG_CONFIG_PATH=3D/gnu/store/hvcq6yjfjjc7060pq= 09zm1rj02mivg4h-profile/lib/pkgconfig\r") ;;; (read-line "PWD=3D/home/marusich/guix-master\r") ;;; (read-line "LOGNAME=3Dmarusich\r") ;;; (read-line "GUILE_LOAD_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg= 4h-profile/share/guile/site/3.0\r") ;;; (read-line "HOME=3D/home/marusich\r") ;;; (read-line "LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36:mh=3D00:pi=3D40;33= :so=3D01;35:do=3D01;35:bd=3D40;33;01:cd=3D40;33;01:or=3D40;31;01:mi=3D00:su= =3D37;41:sg=3D30;43:ca=3D30;41:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D01;32:= *.tar=3D01;31:*.tgz=3D01;31:*.arc=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*.lha= =3D01;31:*.lz4=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D01;31:*.txz=3D0= 1;31:*.tzo=3D01;31:*.t7z=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.dz=3D01;31:*.g= z=3D01;31:*.lrz=3D01;31:*.lz=3D01;31:*.lzo=3D01;31:*.xz=3D01;31:*.zst=3D01;= 31:*.tzst=3D01;31:*.bz2=3D01;31:*.bz=3D01;31:*.tbz=3D01;31:*.tbz2=3D01;31:*= .tz=3D01;31:*.deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.war=3D01;31:*.ear= =3D01;31:*.sar=3D01;31:*.rar=3D01;31:*.alz=3D01;31:*.ace=3D01;31:*.zoo=3D01= ;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:*.cab=3D01;31:*.wim=3D01;31:*.= swm=3D01;31:*.dwm=3D01;31:*.esd=3D01;31:*.jpg=3D01;35:*.jpeg=3D01;35:*.mjpg= =3D01;35:*.mjpeg=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=3D01;35:*.pgm=3D= 01;35:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.tif=3D01;35= :*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svgz=3D01;35:*.mng=3D01;35:*.= pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.mpeg=3D01;35:*.m2v=3D01;35:*.mkv= =3D01;35:*.webm=3D01;35:*.webp=3D01;35:*.ogm=3D01;35:*.mp4=3D01;35:*.m4v=3D= 01;35:*.mp4v=3D01;35:*.vob=3D01;35:*.qt=3D01;35:*.nuv=3D01;35:*.wmv=3D01;35= :*.asf=3D01;35:*.rm=3D01;35:*.rmvb=3D01;35:*.flc=3D01;35:*.avi=3D01;35:*.fl= i=3D01;35:*.flv=3D01;35:*.gl=3D01;35:*.dl=3D01;35:*.xcf=3D01;35:*.xwd=3D01;= 35:*.yuv=3D01;35:*.cgm=3D01;35:*.emf=3D01;35:*.ogv=3D01;35:*.ogx=3D01;35:*.= aac=3D00;36:*.au=3D00;36:*.flac=3D00;36:*.m4a=3D00;36:*.mid=3D00;36:*.midi= =3D00;36:*.mka=3D00;36:*.mp3=3D00;36:*.mpc=3D00;36:*.ogg=3D00;36:*.ra=3D00;= 36:*.wav=3D00;36:*.oga=3D00;36:*.opus=3D00;36:*.spx=3D00;36:*.xspf=3D00;36:= \r") ;;; (read-line "GUILE_LOAD_COMPILED_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm= 1rj02mivg4h-profile/lib/guile/3.0/site-ccache:/gnu/store/hvcq6yjfjjc7060pq0= 9zm1rj02mivg4h-profile/share/guile/site/3.0\r") ;;; (read-line "INFOPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-prof= ile/share/info\r") ;;; (read-line "TERM=3Dscreen.xterm-256color\r") ;;; (read-line "CPLUS_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02m= ivg4h-profile/include/c++:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profi= le/include\r") ;;; (read-line "ACLOCAL_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-= profile/share/aclocal\r") ;;; (read-line "USER=3Dmarusich\r") ;;; (read-line "LIBRARY_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-= profile/lib\r") ;;; (read-line "SHLVL=3D1\r") ;;; (read-line "GUIX_LOCPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-= profile/lib/locale\r") ;;; (read-line "GUIX_ENVIRONMENT=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02miv= g4h-profile\r") ;;; (read-line "PS1=3D\r") ;;; (read-line "PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/= bin:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/sbin\r") ;;; (read-line "C_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4= h-profile/include\r") ;;; (read-line "_=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/bin= /env\r") ;;; (read-line "GUIX-CHECK-DONE\r") ;;; (variable "PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; re= ad x; exit" "PS1") ;;; (dropped "\x1b[?2004h[0] [env] marusich@suzaku:~/guix-master\r" #) ;;; (variable "$ PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; = read x; exit" "$ PS1") ;;; (variable "\x1b[?2004l\rPKG_CONFIG_PATH=3D/gnu/store/hvcq6yjfjjc7060pq0= 9zm1rj02mivg4h-profile/lib/pkgconfig" "\x1b[?2004l\rPKG_CONFIG_PATH") ;;; (variable "PWD=3D/home/marusich/guix-master" "PWD") ;;; (variable "LOGNAME=3Dmarusich" "LOGNAME") ;;; (variable "GUILE_LOAD_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4= h-profile/share/guile/site/3.0" "GUILE_LOAD_PATH") ;;; (variable "HOME=3D/home/marusich" "HOME") ;;; (variable "LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36:mh=3D00:pi=3D40;33:= so=3D01;35:do=3D01;35:bd=3D40;33;01:cd=3D40;33;01:or=3D40;31;01:mi=3D00:su= =3D37;41:sg=3D30;43:ca=3D30;41:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D01;32:= *.tar=3D01;31:*.tgz=3D01;31:*.arc=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*.lha= =3D01;31:*.lz4=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D01;31:*.txz=3D0= 1;31:*.tzo=3D01;31:*.t7z=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.dz=3D01;31:*.g= z=3D01;31:*.lrz=3D01;31:*.lz=3D01;31:*.lzo=3D01;31:*.xz=3D01;31:*.zst=3D01;= 31:*.tzst=3D01;31:*.bz2=3D01;31:*.bz=3D01;31:*.tbz=3D01;31:*.tbz2=3D01;31:*= .tz=3D01;31:*.deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.war=3D01;31:*.ear= =3D01;31:*.sar=3D01;31:*.rar=3D01;31:*.alz=3D01;31:*.ace=3D01;31:*.zoo=3D01= ;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:*.cab=3D01;31:*.wim=3D01;31:*.= swm=3D01;31:*.dwm=3D01;31:*.esd=3D01;31:*.jpg=3D01;35:*.jpeg=3D01;35:*.mjpg= =3D01;35:*.mjpeg=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=3D01;35:*.pgm=3D= 01;35:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.tif=3D01;35= :*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svgz=3D01;35:*.mng=3D01;35:*.= pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.mpeg=3D01;35:*.m2v=3D01;35:*.mkv= =3D01;35:*.webm=3D01;35:*.webp=3D01;35:*.ogm=3D01;35:*.mp4=3D01;35:*.m4v=3D= 01;35:*.mp4v=3D01;35:*.vob=3D01;35:*.qt=3D01;35:*.nuv=3D01;35:*.wmv=3D01;35= :*.asf=3D01;35:*.rm=3D01;35:*.rmvb=3D01;35:*.flc=3D01;35:*.avi=3D01;35:*.fl= i=3D01;35:*.flv=3D01;35:*.gl=3D01;35:*.dl=3D01;35:*.xcf=3D01;35:*.xwd=3D01;= 35:*.yuv=3D01;35:*.cgm=3D01;35:*.emf=3D01;35:*.ogv=3D01;35:*.ogx=3D01;35:*.= aac=3D00;36:*.au=3D00;36:*.flac=3D00;36:*.m4a=3D00;36:*.mid=3D00;36:*.midi= =3D00;36:*.mka=3D00;36:*.mp3=3D00;36:*.mpc=3D00;36:*.ogg=3D00;36:*.ra=3D00;= 36:*.wav=3D00;36:*.oga=3D00;36:*.opus=3D00;36:*.spx=3D00;36:*.xspf=3D00;36:= " "LS_COLORS") ;;; (variable "GUILE_LOAD_COMPILED_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1= rj02mivg4h-profile/lib/guile/3.0/site-ccache:/gnu/store/hvcq6yjfjjc7060pq09= zm1rj02mivg4h-profile/share/guile/site/3.0" "GUILE_LOAD_COMPILED_PATH") ;;; (variable "INFOPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profi= le/share/info" "INFOPATH") ;;; (variable "TERM=3Dscreen.xterm-256color" "TERM") ;;; (variable "CPLUS_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mi= vg4h-profile/include/c++:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profil= e/include" "CPLUS_INCLUDE_PATH") ;;; (variable "ACLOCAL_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-p= rofile/share/aclocal" "ACLOCAL_PATH") ;;; (variable "USER=3Dmarusich" "USER") ;;; (variable "LIBRARY_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-p= rofile/lib" "LIBRARY_PATH") ;;; (variable "SHLVL=3D1" "SHLVL") ;;; (variable "GUIX_LOCPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-p= rofile/lib/locale" "GUIX_LOCPATH") ;;; (variable "GUIX_ENVIRONMENT=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg= 4h-profile" "GUIX_ENVIRONMENT") ;;; (variable "PS1=3D" "PS1") ;;; (variable "PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/b= in:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/sbin" "PATH") ;;; (variable "C_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h= -profile/include" "C_INCLUDE_PATH") ;;; (variable "_=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/bin/= env" "_") guix shell: warning: variable 'PKG_CONFIG_PATH' is missing from shell envir= onment hint: One or more environment variables have a different value in the shell= than the one we set. This means that you may find yourself running code in an environment different from the one you asked Guix to prepare. This usually indicates that your shell startup files are unexpectedly modifying those environment variables. For example, if you are using Bash, make sure that environment variables are set or modified in `~/.bash_profile' and _not_ in `~/.bashrc'. For more information on Bash startup files, run: info "(bash) Bash Startup Files" Alternatively, you can avoid the problem by passing the `--container' or `-C' option. That will give you a fully isolated environment running in a "container", immune to the issue described above. [1] [env] marusich@suzaku:~/guix-master $=20 =2D-8<---------------cut here---------------end--------------->8--- Most of the interesting stuff happened in the first few lines: =2D-8<---------------cut here---------------start------------->8--- ;;; (read-line "PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; r= ead x; exit\r") ;;; (read-line "\x1b[?2004h[0] [env] marusich@suzaku:~/guix-master\r\r") ;;; (read-line "$ PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE;= read x; exit\r") ;;; (read-line "\x1b[?2004l\rPKG_CONFIG_PATH=3D/gnu/store/hvcq6yjfjjc7060pq= 09zm1rj02mivg4h-profile/lib/pkgconfig\r") =2D-8<---------------cut here---------------end--------------->8--- As you can see, nothing good is happening when the code parses this later on: =2D-8<---------------cut here---------------start------------->8--- ;;; (variable "PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; re= ad x; exit" "PS1") ;;; (dropped "\x1b[?2004h[0] [env] marusich@suzaku:~/guix-master\r" #) ;;; (variable "$ PS1=3D; env || /usr/bin/env || set; echo GUIX-CHECK-DONE; = read x; exit" "$ PS1") ;;; (variable "\x1b[?2004l\rPKG_CONFIG_PATH=3D/gnu/store/hvcq6yjfjjc7060pq0= 9zm1rj02mivg4h-profile/lib/pkgconfig" "\x1b[?2004l\rPKG_CONFIG_PATH") =2D-8<---------------cut here---------------end--------------->8--- Although I'm sure you see it, for clarity I will explain why the above is bad: The first variable was actually just the entire script being echoed back; it is not actually an environment variable. The second variable "$ PS1" is also not really an environment variable. And the variable "\x1b[?2004l\rPKG_CONFIG_PATH", again, appears to contain garbage at the start, probably from my PS1 value. Basically, I think we can work around these issues if we just read and discard all that junk at the start. I wasn't able to figure out a graceful way to force that to happen, but I did find that simply printing a few lines at the start of the script was good enough to work around the issue on my computer. Here's my proposed patch, with debugging statements included: =2D-8<---------------cut here---------------start------------->8--- diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index 510cee727f..35669b39cd 100644 =2D-- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -420,7 +420,8 @@ (define script ;; Script to obtain the list of environment variable values. On a POS= IX ;; shell we can rely on 'set', but on fish we have to use 'env' (fish's ;; 'set' truncates values and prints them in a different format.) =2D "env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") + "PS1=3D; for i in 1 2 3; do echo GUIX_FLUSH_$i; done; \ +env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") =20 (define lines (match (primitive-fork) @@ -439,8 +440,10 @@ (define lines (let* ((port (fdopen controller "r+l")) (result (begin (display script port) + (while (not (string=3D? "GUIX_FLUSH_3\r" + (read-line port)))) (let loop ((lines '())) =2D (match (read-line port) + (match (pk 'read-line (read-line port)) ((? eof-object?) (reverse lines)) ("GUIX-CHECK-DONE\r" (display "done\n" port) @@ -458,10 +461,10 @@ (define lines ;; but it also truncates values anyway, so don't try to support = it. (let ((index (string-index line #\=3D))) (if index =2D (vhash-cons (string-take line index) + (vhash-cons (pk 'variable line (string-take line index)) (string-drop line (+ 1 index)) table) =2D table))) + (pk 'dropped line table)))) vlist-null lines)) =20 =2D-8<---------------cut here---------------end--------------->8--- And here's the output: =2D-8<---------------cut here---------------start------------->8--- [0] [env] marusich@suzaku:~/guix-master $ ./pre-inst-env guix shell --check --pure --development guix guix shell: checking the environment variables visible from shell '/bin/bas= h'... ;;; (read-line "PKG_CONFIG_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg= 4h-profile/lib/pkgconfig\r") ;;; (read-line "PWD=3D/home/marusich/guix-master\r") ;;; (read-line "LOGNAME=3Dmarusich\r") ;;; (read-line "GUILE_LOAD_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg= 4h-profile/share/guile/site/3.0\r") ;;; (read-line "HOME=3D/home/marusich\r") ;;; (read-line "LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36:mh=3D00:pi=3D40;33= :so=3D01;35:do=3D01;35:bd=3D40;33;01:cd=3D40;33;01:or=3D40;31;01:mi=3D00:su= =3D37;41:sg=3D30;43:ca=3D30;41:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D01;32:= *.tar=3D01;31:*.tgz=3D01;31:*.arc=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*.lha= =3D01;31:*.lz4=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D01;31:*.txz=3D0= 1;31:*.tzo=3D01;31:*.t7z=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.dz=3D01;31:*.g= z=3D01;31:*.lrz=3D01;31:*.lz=3D01;31:*.lzo=3D01;31:*.xz=3D01;31:*.zst=3D01;= 31:*.tzst=3D01;31:*.bz2=3D01;31:*.bz=3D01;31:*.tbz=3D01;31:*.tbz2=3D01;31:*= .tz=3D01;31:*.deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.war=3D01;31:*.ear= =3D01;31:*.sar=3D01;31:*.rar=3D01;31:*.alz=3D01;31:*.ace=3D01;31:*.zoo=3D01= ;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:*.cab=3D01;31:*.wim=3D01;31:*.= swm=3D01;31:*.dwm=3D01;31:*.esd=3D01;31:*.jpg=3D01;35:*.jpeg=3D01;35:*.mjpg= =3D01;35:*.mjpeg=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=3D01;35:*.pgm=3D= 01;35:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.tif=3D01;35= :*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svgz=3D01;35:*.mng=3D01;35:*.= pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.mpeg=3D01;35:*.m2v=3D01;35:*.mkv= =3D01;35:*.webm=3D01;35:*.webp=3D01;35:*.ogm=3D01;35:*.mp4=3D01;35:*.m4v=3D= 01;35:*.mp4v=3D01;35:*.vob=3D01;35:*.qt=3D01;35:*.nuv=3D01;35:*.wmv=3D01;35= :*.asf=3D01;35:*.rm=3D01;35:*.rmvb=3D01;35:*.flc=3D01;35:*.avi=3D01;35:*.fl= i=3D01;35:*.flv=3D01;35:*.gl=3D01;35:*.dl=3D01;35:*.xcf=3D01;35:*.xwd=3D01;= 35:*.yuv=3D01;35:*.cgm=3D01;35:*.emf=3D01;35:*.ogv=3D01;35:*.ogx=3D01;35:*.= aac=3D00;36:*.au=3D00;36:*.flac=3D00;36:*.m4a=3D00;36:*.mid=3D00;36:*.midi= =3D00;36:*.mka=3D00;36:*.mp3=3D00;36:*.mpc=3D00;36:*.ogg=3D00;36:*.ra=3D00;= 36:*.wav=3D00;36:*.oga=3D00;36:*.opus=3D00;36:*.spx=3D00;36:*.xspf=3D00;36:= \r") ;;; (read-line "GUILE_LOAD_COMPILED_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm= 1rj02mivg4h-profile/lib/guile/3.0/site-ccache:/gnu/store/hvcq6yjfjjc7060pq0= 9zm1rj02mivg4h-profile/share/guile/site/3.0\r") ;;; (read-line "INFOPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-prof= ile/share/info\r") ;;; (read-line "TERM=3Dscreen.xterm-256color\r") ;;; (read-line "CPLUS_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02m= ivg4h-profile/include/c++:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profi= le/include\r") ;;; (read-line "ACLOCAL_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-= profile/share/aclocal\r") ;;; (read-line "USER=3Dmarusich\r") ;;; (read-line "LIBRARY_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-= profile/lib\r") ;;; (read-line "SHLVL=3D1\r") ;;; (read-line "GUIX_LOCPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-= profile/lib/locale\r") ;;; (read-line "GUIX_ENVIRONMENT=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02miv= g4h-profile\r") ;;; (read-line "PS1=3D\r") ;;; (read-line "PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/= bin:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/sbin\r") ;;; (read-line "C_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4= h-profile/include\r") ;;; (read-line "_=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/bin= /env\r") ;;; (read-line "GUIX-CHECK-DONE\r") ;;; (variable "PKG_CONFIG_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4= h-profile/lib/pkgconfig" "PKG_CONFIG_PATH") ;;; (variable "PWD=3D/home/marusich/guix-master" "PWD") ;;; (variable "LOGNAME=3Dmarusich" "LOGNAME") ;;; (variable "GUILE_LOAD_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4= h-profile/share/guile/site/3.0" "GUILE_LOAD_PATH") ;;; (variable "HOME=3D/home/marusich" "HOME") ;;; (variable "LS_COLORS=3Drs=3D0:di=3D01;34:ln=3D01;36:mh=3D00:pi=3D40;33:= so=3D01;35:do=3D01;35:bd=3D40;33;01:cd=3D40;33;01:or=3D40;31;01:mi=3D00:su= =3D37;41:sg=3D30;43:ca=3D30;41:tw=3D30;42:ow=3D34;42:st=3D37;44:ex=3D01;32:= *.tar=3D01;31:*.tgz=3D01;31:*.arc=3D01;31:*.arj=3D01;31:*.taz=3D01;31:*.lha= =3D01;31:*.lz4=3D01;31:*.lzh=3D01;31:*.lzma=3D01;31:*.tlz=3D01;31:*.txz=3D0= 1;31:*.tzo=3D01;31:*.t7z=3D01;31:*.zip=3D01;31:*.z=3D01;31:*.dz=3D01;31:*.g= z=3D01;31:*.lrz=3D01;31:*.lz=3D01;31:*.lzo=3D01;31:*.xz=3D01;31:*.zst=3D01;= 31:*.tzst=3D01;31:*.bz2=3D01;31:*.bz=3D01;31:*.tbz=3D01;31:*.tbz2=3D01;31:*= .tz=3D01;31:*.deb=3D01;31:*.rpm=3D01;31:*.jar=3D01;31:*.war=3D01;31:*.ear= =3D01;31:*.sar=3D01;31:*.rar=3D01;31:*.alz=3D01;31:*.ace=3D01;31:*.zoo=3D01= ;31:*.cpio=3D01;31:*.7z=3D01;31:*.rz=3D01;31:*.cab=3D01;31:*.wim=3D01;31:*.= swm=3D01;31:*.dwm=3D01;31:*.esd=3D01;31:*.jpg=3D01;35:*.jpeg=3D01;35:*.mjpg= =3D01;35:*.mjpeg=3D01;35:*.gif=3D01;35:*.bmp=3D01;35:*.pbm=3D01;35:*.pgm=3D= 01;35:*.ppm=3D01;35:*.tga=3D01;35:*.xbm=3D01;35:*.xpm=3D01;35:*.tif=3D01;35= :*.tiff=3D01;35:*.png=3D01;35:*.svg=3D01;35:*.svgz=3D01;35:*.mng=3D01;35:*.= pcx=3D01;35:*.mov=3D01;35:*.mpg=3D01;35:*.mpeg=3D01;35:*.m2v=3D01;35:*.mkv= =3D01;35:*.webm=3D01;35:*.webp=3D01;35:*.ogm=3D01;35:*.mp4=3D01;35:*.m4v=3D= 01;35:*.mp4v=3D01;35:*.vob=3D01;35:*.qt=3D01;35:*.nuv=3D01;35:*.wmv=3D01;35= :*.asf=3D01;35:*.rm=3D01;35:*.rmvb=3D01;35:*.flc=3D01;35:*.avi=3D01;35:*.fl= i=3D01;35:*.flv=3D01;35:*.gl=3D01;35:*.dl=3D01;35:*.xcf=3D01;35:*.xwd=3D01;= 35:*.yuv=3D01;35:*.cgm=3D01;35:*.emf=3D01;35:*.ogv=3D01;35:*.ogx=3D01;35:*.= aac=3D00;36:*.au=3D00;36:*.flac=3D00;36:*.m4a=3D00;36:*.mid=3D00;36:*.midi= =3D00;36:*.mka=3D00;36:*.mp3=3D00;36:*.mpc=3D00;36:*.ogg=3D00;36:*.ra=3D00;= 36:*.wav=3D00;36:*.oga=3D00;36:*.opus=3D00;36:*.spx=3D00;36:*.xspf=3D00;36:= " "LS_COLORS") ;;; (variable "GUILE_LOAD_COMPILED_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1= rj02mivg4h-profile/lib/guile/3.0/site-ccache:/gnu/store/hvcq6yjfjjc7060pq09= zm1rj02mivg4h-profile/share/guile/site/3.0" "GUILE_LOAD_COMPILED_PATH") ;;; (variable "INFOPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profi= le/share/info" "INFOPATH") ;;; (variable "TERM=3Dscreen.xterm-256color" "TERM") ;;; (variable "CPLUS_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mi= vg4h-profile/include/c++:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profil= e/include" "CPLUS_INCLUDE_PATH") ;;; (variable "ACLOCAL_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-p= rofile/share/aclocal" "ACLOCAL_PATH") ;;; (variable "USER=3Dmarusich" "USER") ;;; (variable "LIBRARY_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-p= rofile/lib" "LIBRARY_PATH") ;;; (variable "SHLVL=3D1" "SHLVL") ;;; (variable "GUIX_LOCPATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-p= rofile/lib/locale" "GUIX_LOCPATH") ;;; (variable "GUIX_ENVIRONMENT=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg= 4h-profile" "GUIX_ENVIRONMENT") ;;; (variable "PS1=3D" "PS1") ;;; (variable "PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/b= in:/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/sbin" "PATH") ;;; (variable "C_INCLUDE_PATH=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h= -profile/include" "C_INCLUDE_PATH") ;;; (variable "_=3D/gnu/store/hvcq6yjfjjc7060pq09zm1rj02mivg4h-profile/bin/= env" "_") guix shell: All is good! The shell gets correct environment variables. [0] [env] marusich@suzaku:~/guix-master $=20 =2D-8<---------------cut here---------------end--------------->8--- As you can see, it seems to be working correctly here. Here's a version of the patch that is ready for committing, with the debug statements removed and comments added: --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-environment-Prevent-PS1-from-clobbering-output-in-ch.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH] environment: Prevent PS1 from clobbering output in 'check'. From=20c3eea81846ae71a246e6b592be74062f4bf26474 Mon Sep 17 00:00:00 2001 From: Chris Marusich Date: Sun, 13 Feb 2022 14:15:14 -0800 Subject: [PATCH] environment: Prevent PS1 from clobbering output in 'check'. Fixes: . * guix/scripts/environment.scm (child-shell-environment): In the script executed the child shell, set PS1 to an empty value and then echo three sentinel lines to try to "flush" the original PS1 value before printing the environment variables. In the parent process, read and discard all lines up to and including the last sentinel line. After that, read the remaining li= nes as usual. =2D-- guix/scripts/environment.scm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm index ec071402f4..0b137467f9 100644 =2D-- a/guix/scripts/environment.scm +++ b/guix/scripts/environment.scm @@ -2,6 +2,7 @@ ;;; Copyright =C2=A9 2014, 2015, 2018 David Thompson ;;; Copyright =C2=A9 2015-2022 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2018 Mike Gerwitz +;;; Copyright =C2=A9 2022 Chris Marusich ;;; ;;; This file is part of GNU Guix. ;;; @@ -420,7 +421,16 @@ by running 'set' in the shell." ;; Script to obtain the list of environment variable values. On a POS= IX ;; shell we can rely on 'set', but on fish we have to use 'env' (fish's ;; 'set' truncates values and prints them in a different format.) =2D "env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") + ;; + ;; Why print "GUIX_FLUSH" a few times? We are trying to "flush" the + ;; original PS1 value to the port so we can read it (and discard it) + ;; before we start reading the environment variables from the port. I= f we + ;; don't do this, the original PS1 value can sometimes get interleaved + ;; into the output, which interferes with our parsing logic. It's a h= ack, + ;; but in practice it seems to do the job. If you know of a more grac= eful + ;; solution, please implement it! See: https://issues.guix.gnu.org/51= 466 + "PS1=3D; for i in 1 2 3; do echo GUIX_FLUSH_$i; done; \ +env || /usr/bin/env || set; echo GUIX-CHECK-DONE; read x; exit\n") =20 (define lines (match (primitive-fork) @@ -439,6 +449,12 @@ by running 'set' in the shell." (let* ((port (fdopen controller "r+l")) (result (begin (display script port) + ;; Ignore all lines up to and including the final + ;; "GUIX_FLUSH" line. + (while (not (string=3D? "GUIX_FLUSH_3\r" + (read-line port)))) + ;; Now (hopefully) the original PS1 value will not= be + ;; interleaved in the remaining lines. (let loop ((lines '())) (match (read-line port) ((? eof-object?) (reverse lines)) base-commit: d65979c46c99dc36324ca94aa9650b9de37f22de =2D-=20 2.26.3 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable And here's its output: =2D-8<---------------cut here---------------start------------->8--- [0] [env] marusich@suzaku:~/guix-master $ ./pre-inst-env guix shell --check --pure --development guix guix shell: checking the environment variables visible from shell '/bin/bas= h'... guix shell: All is good! The shell gets correct environment variables. [0] [env] marusich@suzaku:~/guix-master $=20 =2D-8<---------------cut here---------------end--------------->8--- WDYT? =2D-=20 Chris PGP: https://savannah.gnu.org/people/viewgpg.php?user_id=3D106836 --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJJBAEBCAAzFiEEy/WXVcvn5+/vGD+x3UCaFdgiRp0FAmIJkYAVHGNtbWFydXNp Y2hAZ21haWwuY29tAAoJEN1AmhXYIkad/DIP/0cK4RtFfWrzLm87ZjPnWDKVkUN8 12GYm6uWgFAImqcmS8ZH9lep6o6lhyJSYqQ1Vpv15XdUrg5o7jwQlCWU595JaWZH AxwhAjZA2rOaibtftiuKJN7awJUoSt+XJpYWEJVoajz0DS7hh6HVMLbmf441S+HB fX5eY7JPQSbJk9o0owXyZB3KkGl5fkwy2XNLnPqUXIH+bcU3xL4CO2qH3EUzmFKN K5UVSo7IzyVBj6DH0w3CQWxTioQxfdZJvy9W5qK4DPx4r+c+teEnGqoHm0RO0e6x r5Woy5v0bC3rOSrT1jxcQW7S4ClzxmTbPfwVyvPN09IB1fTabGoqBVAFDTdn0tCv K3OQnTK+0PwSMdlcVX3QvZGSByylTu/AqMM7UFgt+kd867Og5hOHHWRdHfm1t9Lv 61BGcS6tg0qTSQZbwCcilBHWm5ZhnJyLD6BL3c7gzvPt6I+UyM3XdBARHOyUMoVB DrZ9T5jh+RGw65oRnDLnIQdYCZk7cS3dZ5YFH+5xrpNf7kltdCPGZnNT+mORsGxJ tqiEhZF+XF2aoaGiP7FdK2gl/p2A4A3Ouoo0uoStWjal0WhVD0oE7GNueC/nqnst y36MQBnU0IX5BXZF9uPxPklRFhMc1XkAGo3o1mxD5Oczua/0Mrg+A1svi8oaFVaz S1G97WFENNuMlvNL =CTxU -----END PGP SIGNATURE----- --==-=-=--