From unknown Thu Aug 14 17:29:10 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#77703 <77703@debbugs.gnu.org> To: bug#77703 <77703@debbugs.gnu.org> Subject: Status: [PATCH] guix-install.sh: Add to GITHUB_PATH in CI Reply-To: bug#77703 <77703@debbugs.gnu.org> Date: Fri, 15 Aug 2025 00:29:10 +0000 retitle 77703 [PATCH] guix-install.sh: Add to GITHUB_PATH in CI reassign 77703 guix-patches submitter 77703 Rik Huijzer severity 77703 normal tag 77703 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Apr 10 10:08:32 2025 Received: (at submit) by debbugs.gnu.org; 10 Apr 2025 14:08:32 +0000 Received: from localhost ([127.0.0.1]:46124 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u2sZz-00085T-Ka for submit@debbugs.gnu.org; Thu, 10 Apr 2025 10:08:32 -0400 Received: from lists.gnu.org ([2001:470:142::17]:49722) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u2lqg-0000uD-TI for submit@debbugs.gnu.org; Thu, 10 Apr 2025 02:57:19 -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 1u2lqb-0002c9-IP for guix-patches@gnu.org; Thu, 10 Apr 2025 02:57:13 -0400 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u2lqZ-00072Y-Pa for guix-patches@gnu.org; Thu, 10 Apr 2025 02:57:13 -0400 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5eb92df4fcbso919998a12.0 for ; Wed, 09 Apr 2025 23:57:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1744268230; x=1744873030; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Hn5neirDngzN/PPCN+LNqcdtgkeFIdcwh1puP0FO7DA=; b=aMQ1MkyRIXWe/v/l5tny/kdzErwMkJscMW8c/YljswyKSFeWDaO6d6Kfip9hJsuLMF lfBfID8qMcvxuw2CyLBkjEMZ3Skx7qcBirQkAVscfXrdQJnBsoGRhFS/NnJrMsmRMuWf tdU5K0vN2rI/DWV5sJE50QwjWOZhMEKyOICk1/BmibPIJJrJFfab/+b6ZwbUIqFJToTb DT9kCnM8U4zxDrABWKosCRhSp5T7Gfi0PxiPLaA1y5aoZ71BvzIX2eClu5jj9aNPcx/K bPejJuo7QKZ+/w7XpdxgXwtqEyJ7RuffpiD1R4C3JrraA4/caXTPEjCHCbt3d2Ey+UaU gsJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1744268230; x=1744873030; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Hn5neirDngzN/PPCN+LNqcdtgkeFIdcwh1puP0FO7DA=; b=LVr8JSOve2eyaFEATpqYznGxOYuNOduLcale+9Mtw6awbTZ8JZ2eo1RuSY6eP/+SNi PVA9VQfhi+lzBE3mCMPY+cIxC5ZV81etYq9DiQYuyZxi9V+phO6Vzu4sxeabk/Z+DsQz rJbYOi6Gk36FwvRCsrkJOiyCC+AAjoBe/foU+KKvAHR7icJPi49MvlEC0Mo6632gGj5g Le/SmRyiumIQVlZSbWIWWAu4EPQTeGhSVJ8WHxvzHBi5cVhETM12jPLmmPSwpViKKTic 8Pn9DSlC5SdnloGB6xMnVldyO+BXXsVRQpwtqaBQHDtE0vr3vIzrNKGoeWbOYnaflCLQ fN3g== X-Gm-Message-State: AOJu0Yws2XNPgKJXZeNOuccJgmc0R6t1eav1tNqPY8UOVVTFPmGFcCqv hU8/rhXtzBE/HRexhbZgr2EaYc0FZZvKE70UvPGnXL72Z55R9ZSlOHqn8w== X-Gm-Gg: ASbGnctZBorUO2lFvv67gYciq0iT1bpmFIccI7isKgzF3Hl9eicn22805q6cUwNIua3 XuUlrpRAPsdf0fvgeYmt/MSEVZs+K/d8h0M+TxnM+H+Bp6yQvpS+VKB4/VTo6QkNuiVE0ReIpka HRVDxBNLax0u6fAG2y4lFBUVK85UXFotUZuZ83Vfi9ftWWYUlyN5Rz6shyAY04LTnJBKtscbr5Q Q1idZjsKvlh/8LDDaEsACnWD+iStnp94kY6Mpw1WNLNxJUv4VDUuq3QB6cIwxxaeXfu91KqX8Ck g1Lmo7F9xVX+AARZQlktxrfwS/e1x1KKdPAS0gBraV+lPMisHpg8qi8SboInpDPYawlREdoa6fp lexflosDbe7MBKyiUlc9r1yWs/mMVHpLu5CKniYJYNq6CkhrJKjIdbV4LGUkX25C1L2NGW29KH9 zxOtFO9kJKF95DO+H0iwY= X-Google-Smtp-Source: AGHT+IElFwwdvBPcwEcevA+I3bl/7EV1U3LfrSK8nqHGVvhfWztLY5Kntkneqdzenzkl8zEtoGIkdQ== X-Received: by 2002:a05:6402:26d0:b0:5e5:3610:8b7a with SMTP id 4fb4d7f45d1cf-5f329292a1dmr1003365a12.17.1744268229400; Wed, 09 Apr 2025 23:57:09 -0700 (PDT) Received: from localhost.localdomain (2001-1c01-3881-6600-dcc6-8839-0a60-485d.cable.dynamic.v6.ziggo.nl. [2001:1c01:3881:6600:dcc6:8839:a60:485d]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5f2fbd17734sm1822222a12.54.2025.04.09.23.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Apr 2025 23:57:08 -0700 (PDT) From: Rik Huijzer To: guix-patches@gnu.org Subject: [PATCH] guix-install.sh: Add to GITHUB_PATH in CI Date: Thu, 10 Apr 2025 08:55:57 +0200 Message-ID: <20250410065645.4242-1-rik.huijzer@gmail.com> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::52f; envelope-from=rik.huijzer@gmail.com; helo=mail-ed1-x52f.google.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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Thu, 10 Apr 2025 10:08:30 -0400 Cc: Rik Huijzer 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.0 (/) I was trying to use guix inside a GitHub CI runner, and saw that this code works: ```yaml - uses: actions/checkout@v4 - run: sudo apt install guix - run: echo "$HOME/.guix-profile/bin" >> $GITHUB_PATH - run: guix install hello - run: hello ``` But, I wonder if the line that adds `.guix-profile/bin` to the path can be avoided. Without it the run fails. Normally, `apt install` also modifies the PATH, so for me as a naive user it would be more intuitive if the installer could do so here too. For security reasons, GitHub has switched to the `$GITHUB_PATH` environment variable in 2020 (https://stackoverflow.com/a/64831469/5056635). This PR suggests to add it to the installer. The code verifies that the CI env var is set to "true", which is always true in GitHub Runners (see first entry in table at https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables). Then it also checks that GITHUB_PATH is set. I think it's a reasonable assumption that if a system sets CI to true and GITHUB_PATH to something, then it must be a GitHub Runner or at least a system that looks like a GitHub Runner. But of course I could be wrong. --- etc/guix-install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/etc/guix-install.sh b/etc/guix-install.sh index b5d833c..c6a2c54 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -752,6 +752,9 @@ export XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" # `guix pull` profile GUIX_PROFILE="$HOME/.config/guix/current" export PATH="$GUIX_PROFILE/bin${PATH:+:}$PATH" +if [ "${CI}" == "true" ] && [ -n "${GITHUB_PATH}" ]; then + echo "$GUIX_PROFILE/bin" >> $GITHUB_PATH +fi # Add to INFOPATH and MANPATH so the latest Guix documentation is available to # info and man readers. When INFOPATH is unset, add a trailing colon so Emacs # searches 'Info-default-directory-list'. When MANPATH is unset, add a base-commit: 2934de1447f87b361608ef3a2a756b8a5d2f42e6 -- 2.48.1