From unknown Tue Sep 09 18:39:26 2025 X-Loop: help-debbugs@gnu.org Subject: bug#35776: Test guix-pack-localstatedir.sh and guix-pack-relocatable.sh crash when /gnu/store doesn't exist Resent-From: Ting-Wei Lan Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Fri, 17 May 2019 13:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35776 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 35776@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.155810085218490 (code B ref -1); Fri, 17 May 2019 13:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 May 2019 13:47:32 +0000 Received: from localhost ([127.0.0.1]:57809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRdCu-0004oA-DQ for submit@debbugs.gnu.org; Fri, 17 May 2019 09:47:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRdCs-0004nx-UD for submit@debbugs.gnu.org; Fri, 17 May 2019 09:47:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:57524) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRdCn-0002z3-CI for submit@debbugs.gnu.org; Fri, 17 May 2019 09:47:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRdCl-00085g-Tt for bug-guix@gnu.org; Fri, 17 May 2019 09:47:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRdCj-0002uy-T7 for bug-guix@gnu.org; Fri, 17 May 2019 09:47:23 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:34770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRdCj-0002u8-En for bug-guix@gnu.org; Fri, 17 May 2019 09:47:21 -0400 Received: by mail-pf1-x42b.google.com with SMTP id n19so3736542pfa.1 for ; Fri, 17 May 2019 06:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:user-agent:mime-version :content-language; bh=sn8KI6W7Lq3AB5as/o6Rc/j7z34DbewaecpKDkcaPqQ=; b=bFXeJWiQcwHq+Kxjk8c7BgBbvd39Z6wiYikFffKf6bDYf8QbIRBgb9Dc8kOLwEbsih INbCLHMS27u7l4FAxBsyOMFH9CGDimy9cUYqYGmvNO/QvkC/5OoNym1ftOwutAAgFIu5 En3BsasrSzOEgth/mGHUcD/qrS4jNWkCa5u3To44j7rJ5Zp5CCHGxoTbB0DkBs8uxxs4 3Bt3D628Sd5V//JVGdDWSjRUf5N1z1eeIl4nIXzhV/JFBMjJcGWQRHchJFuJuGOvni/R uMG/kPtiLYCwVgnt8C+ieVcvIUJZZ1JWq4JLqLpqg3caU0pq5NN/GapGYr5j7Pxujzsh oPxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language; bh=sn8KI6W7Lq3AB5as/o6Rc/j7z34DbewaecpKDkcaPqQ=; b=Zc/8LtTDZ1xu55aaSnGEW/by86Ck2FDrBNtPmsxcYYvjTv7w/s2M9ra4VGxmRgsKOC b64rReUrl98uttRpN8T/GdRGyry4M1qA0ZW/piqb2pJqAkpE+L/mvWPNJx4zPbsEY2Zr Tot7D6SksY7Jg2Hi3a2X8jLwwJ4eqga59Hb/xFvyDmcmCLQUJZ0ixZbxmhnxfO2tq6G8 xEzd1GvzFYfna71LcuZZE+uHe9nrj2vh2lYvZ4D+q7+VuG9xMZYwMKGuZ5HYDFmz8Biu J6J/DHnzH79Jo6BjMw1qKBBLJRqw420NNsCVeC2vvjGl867uiZHxdutu7feEgc1V9M3I ctIA== X-Gm-Message-State: APjAAAUQPR9Z02DSaPWAIp8ylnznEcWN4lIiOQDq5ubCIh8cwCrfUdSl CJbauVB2DtiW+qWy84p3xSJEr7Tp X-Google-Smtp-Source: APXvYqxqT3ZiIIjkPmwYj5r24y2gdyf+56eYVtqAk14y654bCxWCWNXP38gc717kN6M60WtSmxIZ6A== X-Received: by 2002:a65:4907:: with SMTP id p7mr56702057pgs.288.1558100839847; Fri, 17 May 2019 06:47:19 -0700 (PDT) Received: from wn.lant.com.tw ([106.104.151.171]) by smtp.gmail.com with ESMTPSA id b16sm16589915pfd.12.2019.05.17.06.47.18 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 06:47:19 -0700 (PDT) From: Ting-Wei Lan Message-ID: <1e5db66d-99b3-5926-e107-5c63413eb641@gmail.com> Date: Fri, 17 May 2019 21:47:17 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1BDD2236DE8406A8134F077E" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.1 (-) 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: -2.1 (--) This is a multi-part message in MIME format. --------------1BDD2236DE8406A8134F077E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit When running these two tests in a clean environment without having Guix installed first, they crash when trying to obtain the value of localstatedir. + guix pack --version guix pack (GNU Guix) 1.0.0.711-f52e8-dirty Copyright (C) 2019 the Guix authors License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ++ guile2.2 -c '(use-modules (guix config))(display %storedir)' + NIX_STORE_DIR=/gnu/store ++ guile2.2 -c '(use-modules (guix config))(display %localstatedir)' Backtrace: In ice-9/eval.scm:     619:8 19 (_ #(#(#))) In ice-9/command-line.scm:    181:18 18 (_ #) In unknown file:           17 (eval (use-modules (guix config)) #) In ice-9/eval.scm:    721:20 16 (primitive-eval (use-modules (guix config))) In ice-9/psyntax.scm:   1235:36 15 (expand-top-sequence ((use-modules (guix config))) _ _ # …)   1182:24 14 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)    285:10 13 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) …) In ice-9/boot-9.scm:   3377:20 12 (process-use-modules _)    222:17 11 (map1 (((guix config))))   3378:31 10 (_ ((guix config)))   2800:17  9 (resolve-interface (guix config) #:select _ #:hide _ # _ …) In ice-9/threads.scm:     390:8  8 (_ _) In ice-9/boot-9.scm:   2726:13  7 (_) In ice-9/threads.scm:     390:8  6 (_ _) In ice-9/boot-9.scm:   2994:20  5 (_)    2312:4  4 (save-module-excursion #)   3014:26  3 (_) In unknown file:            2 (primitive-load-path "guix/config" #) In guix/config.scm:      71:6  1 (_) In unknown file:            0 (canonicalize-path "/gnu/store") ERROR: In procedure canonicalize-path: In procedure canonicalize-path: No such file or directory + localstatedir= FAIL tests/guix-pack-localstatedir.sh (exit status: 1) It seems to me that the reason is that NIX_STORE_DIR is exported by test-env script, so the line NIX_STORE_DIR="`guile -c '(use-modules (guix config))(display %storedir)'`" not only changes the value of shell variable NIX_STORE_DIR but also exports it to the environment. Therefore, the next line localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`" crashes at guix/config.scm when running the code (define %store-directory   (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)       %storedir)) because NIX_STORE_DIR points to a non-existent path /gnu/store. I attached a patch to avoid the crash by delaying the modification to NIX_STORE_DIR, but I am not sure if it is correct to do so. --------------1BDD2236DE8406A8134F077E Content-Type: text/x-patch; name="guix-1.0.0-tests-guix-pack-localstatedir.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="guix-1.0.0-tests-guix-pack-localstatedir.patch" diff --git a/tests/guix-pack-localstatedir.sh b/tests/guix-pack-localstatedir.sh index b734b0f..41afda1 100644 --- a/tests/guix-pack-localstatedir.sh +++ b/tests/guix-pack-localstatedir.sh @@ -27,8 +27,9 @@ guix pack --version # the test in the user's global store if possible, on the grounds that # binaries may already be there or can be built or downloaded inexpensively. -NIX_STORE_DIR="`guile -c '(use-modules (guix config))(display %storedir)'`" +nix_store_dir="`guile -c '(use-modules (guix config))(display %storedir)'`" localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`" +NIX_STORE_DIR="$nix_store_dir" GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket" export NIX_STORE_DIR GUIX_DAEMON_SOCKET diff --git a/tests/guix-pack-relocatable.sh b/tests/guix-pack-relocatable.sh index 38dcf1e..b276fdc 100644 --- a/tests/guix-pack-relocatable.sh +++ b/tests/guix-pack-relocatable.sh @@ -27,8 +27,9 @@ guix pack --version # run it on the user's global store if possible, on the grounds that binaries # may already be there or can be built or downloaded inexpensively. -NIX_STORE_DIR="`guile -c '(use-modules (guix config))(display %storedir)'`" +nix_store_dir="`guile -c '(use-modules (guix config))(display %storedir)'`" localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`" +NIX_STORE_DIR="$nix_store_dir" GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket" export NIX_STORE_DIR GUIX_DAEMON_SOCKET --------------1BDD2236DE8406A8134F077E-- From unknown Tue Sep 09 18:39:26 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Ting-Wei Lan Subject: bug#35776: closed (Re: bug#35776: Test guix-pack-localstatedir.sh and guix-pack-relocatable.sh crash when /gnu/store doesn't exist) Message-ID: References: <87tvdsvywx.fsf@gnu.org> <1e5db66d-99b3-5926-e107-5c63413eb641@gmail.com> X-Gnu-PR-Message: they-closed 35776 X-Gnu-PR-Package: guix Reply-To: 35776@debbugs.gnu.org Date: Sat, 18 May 2019 10:30:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1558175403-23519-1" This is a multi-part message in MIME format... ------------=_1558175403-23519-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #35776: Test guix-pack-localstatedir.sh and guix-pack-relocatable.sh crash = when /gnu/store doesn't exist which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 35776@debbugs.gnu.org. --=20 35776: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D35776 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1558175403-23519-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 35776-done) by debbugs.gnu.org; 18 May 2019 10:29:28 +0000 Received: from localhost ([127.0.0.1]:59882 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRwam-00066L-16 for submit@debbugs.gnu.org; Sat, 18 May 2019 06:29:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35713) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRwak-000668-BN for 35776-done@debbugs.gnu.org; Sat, 18 May 2019 06:29:26 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRwaf-0002lC-7L; Sat, 18 May 2019 06:29:21 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33854 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1hRwad-00024t-U4; Sat, 18 May 2019 06:29:20 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Ting-Wei Lan Subject: Re: bug#35776: Test guix-pack-localstatedir.sh and guix-pack-relocatable.sh crash when /gnu/store doesn't exist References: <1e5db66d-99b3-5926-e107-5c63413eb641@gmail.com> Date: Sat, 18 May 2019 12:29:18 +0200 In-Reply-To: <1e5db66d-99b3-5926-e107-5c63413eb641@gmail.com> (Ting-Wei Lan's message of "Fri, 17 May 2019 21:47:17 +0800") Message-ID: <87tvdsvywx.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 35776-done Cc: 35776-done@debbugs.gnu.org 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: -3.3 (---) Ting-Wei Lan skribis: > It seems to me that the reason is that NIX_STORE_DIR is exported by > test-env script, so the line > NIX_STORE_DIR=3D"`guile -c '(use-modules (guix config))(display %storedir= )'`" > not only changes the value of shell variable NIX_STORE_DIR but also > exports it to the environment. > Therefore, the next line > localstatedir=3D"`guile -c '(use-modules (guix config))(display > %localstatedir)'`" > crashes at guix/config.scm when running the code > (define %store-directory > =C2=A0 (or (and=3D> (getenv "NIX_STORE_DIR") canonicalize-path) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0%storedir)) > because NIX_STORE_DIR points to a non-existent path /gnu/store. > I attached a patch to avoid the crash by delaying the modification > to=C2=A0NIX_STORE_DIR, but I am not sure if it is correct to do so. Indeed. Pushed as baab87ac49e3f0f873e17eb16db9781189b1f2d1, thanks! Ludo=E2=80=99. ------------=_1558175403-23519-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 May 2019 13:47:32 +0000 Received: from localhost ([127.0.0.1]:57809 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRdCu-0004oA-DQ for submit@debbugs.gnu.org; Fri, 17 May 2019 09:47:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hRdCs-0004nx-UD for submit@debbugs.gnu.org; Fri, 17 May 2019 09:47:31 -0400 Received: from lists.gnu.org ([209.51.188.17]:57524) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hRdCn-0002z3-CI for submit@debbugs.gnu.org; Fri, 17 May 2019 09:47:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hRdCl-00085g-Tt for bug-guix@gnu.org; Fri, 17 May 2019 09:47:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hRdCj-0002uy-T7 for bug-guix@gnu.org; Fri, 17 May 2019 09:47:23 -0400 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]:34770) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hRdCj-0002u8-En for bug-guix@gnu.org; Fri, 17 May 2019 09:47:21 -0400 Received: by mail-pf1-x42b.google.com with SMTP id n19so3736542pfa.1 for ; Fri, 17 May 2019 06:47:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:message-id:date:user-agent:mime-version :content-language; bh=sn8KI6W7Lq3AB5as/o6Rc/j7z34DbewaecpKDkcaPqQ=; b=bFXeJWiQcwHq+Kxjk8c7BgBbvd39Z6wiYikFffKf6bDYf8QbIRBgb9Dc8kOLwEbsih INbCLHMS27u7l4FAxBsyOMFH9CGDimy9cUYqYGmvNO/QvkC/5OoNym1ftOwutAAgFIu5 En3BsasrSzOEgth/mGHUcD/qrS4jNWkCa5u3To44j7rJ5Zp5CCHGxoTbB0DkBs8uxxs4 3Bt3D628Sd5V//JVGdDWSjRUf5N1z1eeIl4nIXzhV/JFBMjJcGWQRHchJFuJuGOvni/R uMG/kPtiLYCwVgnt8C+ieVcvIUJZZ1JWq4JLqLpqg3caU0pq5NN/GapGYr5j7Pxujzsh oPxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version:content-language; bh=sn8KI6W7Lq3AB5as/o6Rc/j7z34DbewaecpKDkcaPqQ=; b=Zc/8LtTDZ1xu55aaSnGEW/by86Ck2FDrBNtPmsxcYYvjTv7w/s2M9ra4VGxmRgsKOC b64rReUrl98uttRpN8T/GdRGyry4M1qA0ZW/piqb2pJqAkpE+L/mvWPNJx4zPbsEY2Zr Tot7D6SksY7Jg2Hi3a2X8jLwwJ4eqga59Hb/xFvyDmcmCLQUJZ0ixZbxmhnxfO2tq6G8 xEzd1GvzFYfna71LcuZZE+uHe9nrj2vh2lYvZ4D+q7+VuG9xMZYwMKGuZ5HYDFmz8Biu J6J/DHnzH79Jo6BjMw1qKBBLJRqw420NNsCVeC2vvjGl867uiZHxdutu7feEgc1V9M3I ctIA== X-Gm-Message-State: APjAAAUQPR9Z02DSaPWAIp8ylnznEcWN4lIiOQDq5ubCIh8cwCrfUdSl CJbauVB2DtiW+qWy84p3xSJEr7Tp X-Google-Smtp-Source: APXvYqxqT3ZiIIjkPmwYj5r24y2gdyf+56eYVtqAk14y654bCxWCWNXP38gc717kN6M60WtSmxIZ6A== X-Received: by 2002:a65:4907:: with SMTP id p7mr56702057pgs.288.1558100839847; Fri, 17 May 2019 06:47:19 -0700 (PDT) Received: from wn.lant.com.tw ([106.104.151.171]) by smtp.gmail.com with ESMTPSA id b16sm16589915pfd.12.2019.05.17.06.47.18 for (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Fri, 17 May 2019 06:47:19 -0700 (PDT) From: Ting-Wei Lan Subject: Test guix-pack-localstatedir.sh and guix-pack-relocatable.sh crash when /gnu/store doesn't exist To: bug-guix@gnu.org Message-ID: <1e5db66d-99b3-5926-e107-5c63413eb641@gmail.com> Date: Fri, 17 May 2019 21:47:17 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------1BDD2236DE8406A8134F077E" Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::42b X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: -1.1 (-) X-Debbugs-Envelope-To: submit 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: -2.1 (--) This is a multi-part message in MIME format. --------------1BDD2236DE8406A8134F077E Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit When running these two tests in a clean environment without having Guix installed first, they crash when trying to obtain the value of localstatedir. + guix pack --version guix pack (GNU Guix) 1.0.0.711-f52e8-dirty Copyright (C) 2019 the Guix authors License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. ++ guile2.2 -c '(use-modules (guix config))(display %storedir)' + NIX_STORE_DIR=/gnu/store ++ guile2.2 -c '(use-modules (guix config))(display %localstatedir)' Backtrace: In ice-9/eval.scm:     619:8 19 (_ #(#(#))) In ice-9/command-line.scm:    181:18 18 (_ #) In unknown file:           17 (eval (use-modules (guix config)) #) In ice-9/eval.scm:    721:20 16 (primitive-eval (use-modules (guix config))) In ice-9/psyntax.scm:   1235:36 15 (expand-top-sequence ((use-modules (guix config))) _ _ # …)   1182:24 14 (parse _ (("placeholder" placeholder)) ((top) #(# # …)) …)    285:10 13 (parse _ (("placeholder" placeholder)) (()) _ c&e (eval) …) In ice-9/boot-9.scm:   3377:20 12 (process-use-modules _)    222:17 11 (map1 (((guix config))))   3378:31 10 (_ ((guix config)))   2800:17  9 (resolve-interface (guix config) #:select _ #:hide _ # _ …) In ice-9/threads.scm:     390:8  8 (_ _) In ice-9/boot-9.scm:   2726:13  7 (_) In ice-9/threads.scm:     390:8  6 (_ _) In ice-9/boot-9.scm:   2994:20  5 (_)    2312:4  4 (save-module-excursion #)   3014:26  3 (_) In unknown file:            2 (primitive-load-path "guix/config" #) In guix/config.scm:      71:6  1 (_) In unknown file:            0 (canonicalize-path "/gnu/store") ERROR: In procedure canonicalize-path: In procedure canonicalize-path: No such file or directory + localstatedir= FAIL tests/guix-pack-localstatedir.sh (exit status: 1) It seems to me that the reason is that NIX_STORE_DIR is exported by test-env script, so the line NIX_STORE_DIR="`guile -c '(use-modules (guix config))(display %storedir)'`" not only changes the value of shell variable NIX_STORE_DIR but also exports it to the environment. Therefore, the next line localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`" crashes at guix/config.scm when running the code (define %store-directory   (or (and=> (getenv "NIX_STORE_DIR") canonicalize-path)       %storedir)) because NIX_STORE_DIR points to a non-existent path /gnu/store. I attached a patch to avoid the crash by delaying the modification to NIX_STORE_DIR, but I am not sure if it is correct to do so. --------------1BDD2236DE8406A8134F077E Content-Type: text/x-patch; name="guix-1.0.0-tests-guix-pack-localstatedir.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="guix-1.0.0-tests-guix-pack-localstatedir.patch" diff --git a/tests/guix-pack-localstatedir.sh b/tests/guix-pack-localstatedir.sh index b734b0f..41afda1 100644 --- a/tests/guix-pack-localstatedir.sh +++ b/tests/guix-pack-localstatedir.sh @@ -27,8 +27,9 @@ guix pack --version # the test in the user's global store if possible, on the grounds that # binaries may already be there or can be built or downloaded inexpensively. -NIX_STORE_DIR="`guile -c '(use-modules (guix config))(display %storedir)'`" +nix_store_dir="`guile -c '(use-modules (guix config))(display %storedir)'`" localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`" +NIX_STORE_DIR="$nix_store_dir" GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket" export NIX_STORE_DIR GUIX_DAEMON_SOCKET diff --git a/tests/guix-pack-relocatable.sh b/tests/guix-pack-relocatable.sh index 38dcf1e..b276fdc 100644 --- a/tests/guix-pack-relocatable.sh +++ b/tests/guix-pack-relocatable.sh @@ -27,8 +27,9 @@ guix pack --version # run it on the user's global store if possible, on the grounds that binaries # may already be there or can be built or downloaded inexpensively. -NIX_STORE_DIR="`guile -c '(use-modules (guix config))(display %storedir)'`" +nix_store_dir="`guile -c '(use-modules (guix config))(display %storedir)'`" localstatedir="`guile -c '(use-modules (guix config))(display %localstatedir)'`" +NIX_STORE_DIR="$nix_store_dir" GUIX_DAEMON_SOCKET="$localstatedir/guix/daemon-socket/socket" export NIX_STORE_DIR GUIX_DAEMON_SOCKET --------------1BDD2236DE8406A8134F077E-- ------------=_1558175403-23519-1--