From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 10 09:03:08 2020 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 To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: [PATCH] maint: update-guix-package: Optionally add sources to store. 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=22'?= =?utf-8?Q?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-Debbugs-Envelope-To: 43893 Cc: 43893@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: -1.0 (-) 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