From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 21 04:53:21 2020 Received: (at 43893) by debbugs.gnu.org; 21 Oct 2020 08:53:21 +0000 Received: from localhost ([127.0.0.1]:47909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kV9s1-0004Y8-8S for submit@debbugs.gnu.org; Wed, 21 Oct 2020 04:53:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45438) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kV9rz-0004Xr-5i for 43893@debbugs.gnu.org; Wed, 21 Oct 2020 04:53:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44875) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kV9rs-0008Uo-ME; Wed, 21 Oct 2020 04:53:13 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=43028 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kV9rs-0002Gl-0V; Wed, 21 Oct 2020 04:53:12 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Maxim Cournoyer Subject: Re: bug#43893: [PATCH v3] maint: update-guix-package: Prevent accidentally breaking guix pull. References: <87imbedsko.fsf@gnu.org> <20201014031705.4516-1-maxim.cournoyer@gmail.com> <87lfg0bo9m.fsf@gnu.org> <87v9f44852.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 30 =?utf-8?Q?Vend=C3=A9miaire?= an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 21 Oct 2020 10:53:10 +0200 In-Reply-To: <87v9f44852.fsf@gmail.com> (Maxim Cournoyer's message of "Tue, 20 Oct 2020 22:36:57 -0400") Message-ID: <875z749czt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43893 Cc: 43893@debbugs.gnu.org, marius@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 (---) Hi, Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: [...] >>> - ;; Re-add SOURCE to the store, but this time under the real n= ame used >>> - ;; in the 'origin'. This allows us to build the package with= out >>> - ;; having to make a real checkout; thus, it also works when w= orking >>> - ;; on a private branch. >>> - (reload-module >>> - (resolve-module '(gnu packages package-management))) >>> - >>> - (let* ((source (add-to-store store >>> - (origin-file-name (package-sourc= e guix)) >>> - #t "sha256" source)) >>> - (root (store-path-package-name source))) >>> - >>> - ;; Add an indirect GC root for SOURCE in the current direct= ory. >>> - (false-if-exception (delete-file root)) >>> - (symlink source root) >>> - (add-indirect-root store >>> - (string-append (getcwd) "/" root)) >>> - >>> - (format #t "source code for commit ~a: ~a (GC root: ~a)~%" >>> - commit source root))))) >> >> I realize it was maybe enough to wrap this whole portion (starting from >> =E2=80=9CRe-add SOURCE=E2=80=9D) in (unless (getenv >> "GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT") =E2=80=A6)? Running =E2=80=98gui= x build guix=E2=80=99 >> would have forced the source derivation to be built. >> >> Anyhow, thanks for working on it! > > Sorry, I'm a bit lost. Are you suggesting that we should restore the > code following the ;; Re-add SOURCE [...], but wrapped with unless to > make it conditional to GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT being > defined? That part depends on SOURCE, a store file name, which we don't > have anymore since we no longer add the sources to the store to compute > the hash. I=E2=80=99m saying that the solution to the initial problem (that if you do= n=E2=80=99t run =E2=80=98guix build guix -S --check=E2=80=99 you=E2=80=99re not sure = =E2=80=98guix=E2=80=99 is referring to a valid upstream commit) could have been to simply not do the trick above. The trick at =E2=80=9CRe-add SOURCE=E2=80=9D is here precisely to p= revent attempts to re-download, as the comment explains, and this is what has been causing these troubles. The advantages (to me) would have been simpler code, no shelling out to =E2=80=98git=E2=80=99, and no fiddling with files under $PWD. BTW, in =E2=80=98make release=E2=80=99 does =E2=80=98make update-guix-packa= ge=E2=80=99 and expects it to work with a not-pushed-yet commit. So it=E2=80=99s a case where we need GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT=3Dyes. Thanks, Ludo=E2=80=99.