From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UC+ZN96dql9CbQAA0tVLHw (envelope-from ) for ; Tue, 10 Nov 2020 14:04:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AInAM96dql8zVQAA1q6Kng (envelope-from ) for ; Tue, 10 Nov 2020 14:04:14 +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 7B5829403A8 for ; Tue, 10 Nov 2020 14:04:14 +0000 (UTC) Received: from localhost ([::1]:40854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcUFo-0005Fw-MO for larch@yhetil.org; Tue, 10 Nov 2020 09:04:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcUFe-0005FX-P0 for bug-guix@gnu.org; Tue, 10 Nov 2020 09:04:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:53531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcUFe-0004cL-EZ for bug-guix@gnu.org; Tue, 10 Nov 2020 09:04:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcUFe-0001AP-An for bug-guix@gnu.org; Tue, 10 Nov 2020 09:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#43893: [PATCH] maint: update-guix-package: Optionally add sources to store. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Tue, 10 Nov 2020 14:04:02 +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: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 43893-submit@debbugs.gnu.org id=B43893.16050169884397 (code B ref 43893); Tue, 10 Nov 2020 14:04:02 +0000 Received: (at 43893) by debbugs.gnu.org; 10 Nov 2020 14:03:08 +0000 Received: from localhost ([127.0.0.1]:36844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcUEl-00018q-Mr for submit@debbugs.gnu.org; Tue, 10 Nov 2020 09:03:07 -0500 Received: from mail-qk1-f195.google.com ([209.85.222.195]:45940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcUEk-000186-N0 for 43893@debbugs.gnu.org; Tue, 10 Nov 2020 09:03:07 -0500 Received: by mail-qk1-f195.google.com with SMTP id q5so7255849qkc.12 for <43893@debbugs.gnu.org>; Tue, 10 Nov 2020 06:03:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=uNZVqRtEUTEfoYlQfRYFJY2Ww1zRXAgdsGlAT4RDtwk=; b=Fz/jzgtLFaL3oKK1pBDGVNhcd6r5Lm6sjcCSlhuRB5OA7CqwgZRgzbUK04Dp4Y1xgh mxfQMP+rAiyoz0C2zAg3kuDTnNSOd0jGFRc8FgQmNHs/mNJjxcnuXquk9pQQ3E7PQ68Y x8xMilxrE1z3LmZ6rJVD1BkZO0XSHS/pTaHJs6jMB6zREByBFy3i9mvuCdbpLU74LS/l /xrLkptPv2Ra1TTRTC4s5GQE2jKy6ABZKbAad/Sc7slY+yIzdD5Hj9RO8B2IBRZQYekG DSR3SlIUFZD0EW/JD1IWFGjETOu3mVXrP/JMnXBC3ts3QhCHp5ePAMMXazeIsGvpVJp+ kXMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=uNZVqRtEUTEfoYlQfRYFJY2Ww1zRXAgdsGlAT4RDtwk=; b=KCubdNDEdBuoVEgyygJZIHivGNtFCpIzlVyDeTYtrb/OMKQ9V0+wmQQYAeFiuhPWqS S3zKVXgTwr7r+lmmZ0IuZdTPuOtst2Og+OV9nhsOF4UQEFSDITqPbRXTHL5tp5FAYMVO 220o40uhwKe3jbofmUmv0nOrlr9XmRwIkDJCaxUcCpxbIxgyou8HE4d/2wa++I97wEgW e6RNlX5KbEDk/9/W1oiz2mYTNSZUTymw/Yi/PaLh/kzJTYouRqsRKQf8gZMvDPRubVd4 QLiqvQu7vAp6NOdCYAponUcyn5Dq7p21FjyoEZhXt0tI/2UhCH2bEK0ElLvYl3EJKlu7 KCDw== X-Gm-Message-State: AOAM530WuD6PSUooYfUVVVYHBq1KB0HtBGquH5su73Sx+lkS6Jt2Bo+P kKscLLIezL5qvJ3qFMzUkNxOnokCWWw= X-Google-Smtp-Source: ABdhPJzXzNSbJsV9dgtrwjkidGFPZisrJoGo9lt+LgvtmUo6R7iVuf6HO/ziLtsC5UJTWK5Y9y8DVw== X-Received: by 2002:a37:a915:: with SMTP id s21mr20189338qke.38.1605016979978; Tue, 10 Nov 2020 06:02:59 -0800 (PST) Received: from hurd (dsl-10-133-153.b2b2c.ca. [72.10.133.153]) by smtp.gmail.com with ESMTPSA id y65sm4043356qkc.60.2020.11.10.06.02.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Nov 2020 06:02:59 -0800 (PST) From: Maxim Cournoyer References: <871rhevfpp.fsf@gnu.org> <20201109192923.29580-1-maxim.cournoyer@gmail.com> <87pn4mqime.fsf@gnu.org> Date: Tue, 10 Nov 2020 09:02:58 -0500 In-Reply-To: <87pn4mqime.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Mon, 09 Nov 2020 23:18:33 +0100") Message-ID: <87zh3pgvhp.fsf@gmail.com> 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: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=Fz/jzgtL; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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.09 X-TUID: XzNpHEMt2uyv Hello Ludovic, Ludovic Court=C3=A8s writes: > Maxim Cournoyer skribis: [...] >> -(define-syntax-rule (with-temporary-git-worktree commit body ...) >> - "Execute BODY in the context of a temporary git worktree created from= COMMIT." >> +(define-syntax-rule (call-with-temporary-git-worktree commit proc) >> + "Execute PROC in the context of a temporary git worktree created from >> +COMMIT. PROC receives the temporary directory file name as an argument= ." > > This could be a procedure rather a macro now. I've changed it to a plain define in the latest version (now merged). > [...] > >> + (call-with-temporary-git-worktree commit >> + (lambda (tmp-directory) >> + (let* ((hash (nix-base32-string->bytevector >> + (string-trim-both >> + (with-output-to-string >> + (lambda () >> + (guix-hash "-rx" tmp-directory)))))) >> + (location (package-definition-location)) >> + (old-hash (content-hash-value >> + (origin-hash (package-source guix))))) >> + (edit-expression location >> + (update-definition commit hash >> + #:old-hash old-hash >> + #:version version)) >> + ;; When GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set, the = sources are >> + ;; added to the store. This is used as part of 'make re= lease'. >> + (when (getenv "GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT") >> + (with-store store >> + (keep-source-in-store store tmp-directory)))))))) > > OK, that should do the job. > > Thanks for the patch, that should break the deadlock and allow us to > proceed with the release! > > Next we need to update the =E2=80=98release=E2=80=99 target so > GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set. Done! > I like that the initial issue is fixed, but I still don=E2=80=99t buy [...] Hehe. Last round of weighing the + and - of this change > the extra dependency on Git, To me, this script (update-guix-package), is an extension of the Make-based build system (that's currently it's sole entry-point). There are already calls to git in this build system (for example, to get the commit corresponding to HEAD), so I don't perceive it as nasty in this context. It can also be used as a reminder of things that are missing in (guile git), for the purists ;-). > the extra copies of the whole tree, There used to be 3 copies required in total (the Guix checkout, a first dummy copy in the store, and a final copy in the store). Now, we have 2 copies unless GUIX_ALLOW_ME_TO_USE_PRIVATE_COMMIT is set, in which case we get a third one in the store. Seems pretty even to me! > the extra code The extra code make things smoother (better/faster diagnostic), causes less friction in the workflow (I don't need to go paranoid about my tree being in pristine condition before 'make update-guix-package' -- I can rely on Guix computing it deterministically from the last commit). > and the shell pipelines, something avoided in the rest of Guix. Again, to me this script is a standalone extension of the build system. It's not defined as a module, cannot be used in the rest of the code base, so that it does things a bit differently doesn't strike me as bad. > Perhaps that suggests there are unwritten coding guidelines we should > eventually discuss and write. We=E2=80=99ll see! That could be nice. Although a linter included with Guile (ala Rust or Go) and configurable through a config file could have even more impact, in my opinion. In any case I'd be honored that my code got to be the spark behind such guidelines/tool, eh :-). Thank you, Maxim