From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6D2DLuYUgl/UCgAA0tVLHw (envelope-from ) for ; Sat, 10 Oct 2020 20:09:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2OJ5KuYUgl/TZwAAbx9fmQ (envelope-from ) for ; Sat, 10 Oct 2020 20:09: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 67FFE94053C for ; Sat, 10 Oct 2020 20:09:10 +0000 (UTC) Received: from localhost ([::1]:59288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRLAz-0002wy-D6 for larch@yhetil.org; Sat, 10 Oct 2020 16:09:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRLAs-0002va-UX for bug-guix@gnu.org; Sat, 10 Oct 2020 16:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:55314) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRLAs-0003PL-0X for bug-guix@gnu.org; Sat, 10 Oct 2020 16:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kRLAr-0007jV-SG for bug-guix@gnu.org; Sat, 10 Oct 2020 16:09:01 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#43893: [PATCH] maint: update-guix-package: Ensure sources are clean. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 10 Oct 2020 20:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43893 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Maxim Cournoyer Received: via spool by 43893-submit@debbugs.gnu.org id=B43893.160236050829687 (code B ref 43893); Sat, 10 Oct 2020 20:09:01 +0000 Received: (at 43893) by debbugs.gnu.org; 10 Oct 2020 20:08:28 +0000 Received: from localhost ([127.0.0.1]:38627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRLAK-0007il-A6 for submit@debbugs.gnu.org; Sat, 10 Oct 2020 16:08:28 -0400 Received: from eggs.gnu.org ([209.51.188.92]:39318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRLAI-0007iV-Vk for 43893@debbugs.gnu.org; Sat, 10 Oct 2020 16:08:27 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41719) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRLAD-0003NU-PV; Sat, 10 Oct 2020 16:08:21 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47060 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kRLAD-0007BV-Bh; Sat, 10 Oct 2020 16:08:21 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87eem7qcxc.fsf@gmail.com> <20201010050852.19975-1-maxim.cournoyer@gmail.com> Date: Sat, 10 Oct 2020 22:08:19 +0200 In-Reply-To: <20201010050852.19975-1-maxim.cournoyer@gmail.com> (Maxim Cournoyer's message of "Sat, 10 Oct 2020 01:08:52 -0400") Message-ID: <871ri5j13g.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: 43893@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: D45ULJtAei3L Hi, Maxim Cournoyer skribis: > By using a fresh copy of the last commit, we ensure the computed hash is > stable in the face of local edits. This change also computes the hash > externally from the store, which allows to verify that the hashes are val= id > using, e.g.: > > #FIXME: This doesn't work (recursion?) > ./pre-inst-env guix build guix --with-git-url=3Dguix=3Dfile://$PWD Works for me, please open a separate bug report. :-) > * build-aux/update-guix-package.scm (git-add-worktree): New procedure. > (main): Use it to checkout a clean copy of the used commit, and compute t= he > hash from it. Print a user warning after completion. I=E2=80=99m not quite enthusiastic about the tool creating a worktree behin= d my back. > - ;; Re-add SOURCE to the store, but this time under the real nam= e used > - ;; in the 'origin'. This allows us to build the package without > - ;; having to make a real checkout; thus, it also works when wor= king > - ;; on a private branch. So this preserves this possibility, right? > + (format #t "Updated Guix to commit ~s. You must ensure this > +commit hash exists in the public repository, else 'guix pull' will break. > +Beware of 'git rebase'~%" commit)))))) I think this is the most important bit. :-) I could also suggest running =E2=80=98guix build guix --check=E2=80=99. Honestly, I would simply add this last message; better yet, we could use Guile-Git to (1) check whether we=E2=80=99re on a dirty tree and stop right= away if we are, and (2) check whether the commit exists in the official Git repo and error out if it doesn=E2=80=99t, unless GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set. #2 could also be implemented by building the derivation of (package-source guix) in =E2=80=98check=E2=80=99 mode (perhaps easier). WDYT? Thanks for looking into it, experience has shown that this really needs to be addressed! Ludo=E2=80=99.