From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id +JJvNyoODmUaSQEA9RJhRA:P1 (envelope-from ) for ; Fri, 22 Sep 2023 23:59:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id +JJvNyoODmUaSQEA9RJhRA (envelope-from ) for ; Fri, 22 Sep 2023 23:59:07 +0200 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 9977245A5C for ; Fri, 22 Sep 2023 23:59:06 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TUcqe6m1; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1695419946; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Zx4yZ6pXoK9nHzG2+mHrMKyGNWpj8auU94W1jtJ1bXM=; b=CboS7majlWFKoan3DubZpz8h8R40a3e5HKdFErMXfBaa0CVbZZPRVnZFuBfxGBRIO6a5hE hSDJj+a0bVm+yNr3wCrgzy45oVKoCX3dYL8LRd3sFXmD3DHSZM+juFSdBKtiM4wq9heeY0 Egpfh0AKIVQKedlwywfsUnduAwjX5WmdYznGo8eFKRcycFMCAPZzrAJa/bJMiE9Ck6cHSC /DF+oU0KrUnfyAJvWx/XBMg0SzvFcuIMUKoKr4j1lTZZXQ8pkmAjs3oGvTkpTpXe5WDpmn GLkJ5jHBwpYsEX48si/7HRE7dmdViIiPDD4GBMFm5bwJ6nkL9WnxZxRPXnlZQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1695419946; a=rsa-sha256; cv=none; b=f7FzlsPWuzzeHeR8ND2d7w3HNtHWMEHTPwssrQefdzovZMiJLKOqYkHE/2i2vmW0Ncv9l4 gtOlA+AjeIow0dComQSKQMNuIqK8MAFxk8u8gM16WE+6sKPN0hJqlpKYZ0NfPMxL5JMzBq Aj7E3EV23NZt6BWUC8+eX+AYLPgWmgHYzPADpi4Lv2SJlgeG/ZsezC+CGHUzNi0rQbz47x 84I2uhUfAoN8Bl/rbycAYOoMrs7uQyrTHKyeRPc3BWCBSJfS9rxCwde6v+y3at8jYMC3C9 RgsuSk5I6bSbpsRpSJW7c8rkY4xVfPVxrgOanK4D4QLUH5yns5SRJP3dWaaRfA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=TUcqe6m1; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qjoAo-0006vM-18; Fri, 22 Sep 2023 17:58:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjoAl-0006uz-Je for guix-patches@gnu.org; Fri, 22 Sep 2023 17:58:51 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qjoAl-0000wL-Bm for guix-patches@gnu.org; Fri, 22 Sep 2023 17:58:51 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qjoAw-00061m-59 for guix-patches@gnu.org; Fri, 22 Sep 2023 17:59:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65866] [PATCH 0/8] Add built-in builder for Git checkouts Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 22 Sep 2023 21:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65866 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: Josselin Poiret , Simon Tournier , Mathieu Othacehe , Tobias Geerinckx-Rice , Ricardo Wurmus , 65866@debbugs.gnu.org, Christopher Baines Received: via spool by 65866-submit@debbugs.gnu.org id=B65866.169541992923149 (code B ref 65866); Fri, 22 Sep 2023 21:59:02 +0000 Received: (at 65866) by debbugs.gnu.org; 22 Sep 2023 21:58:49 +0000 Received: from localhost ([127.0.0.1]:37374 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjoAj-00061I-6z for submit@debbugs.gnu.org; Fri, 22 Sep 2023 17:58:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qjoAg-000615-NV for 65866@debbugs.gnu.org; Fri, 22 Sep 2023 17:58:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qjoAQ-0000vF-8H; Fri, 22 Sep 2023 17:58:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Zx4yZ6pXoK9nHzG2+mHrMKyGNWpj8auU94W1jtJ1bXM=; b=TUcqe6m1UY5lNRtgHBgu jeSYvcfpZC/SZ+1msMEtFcQ5IsX8iLYqCplae3399fVRl7M1mgmaVF5GYWf8fuoqQz6X6CdzucNOB y9X/KG06/qNOfa+4lWbj//B9uDjLXPvpgS2QXcXsDW4jvrUH8iqmULUOSW+XhSMTrhH4rW9YDfdHK Jv+jSfCj6ga6NVPhODkamvPaEKcJ0EsQ03aFcMjPbXyWOxsvuQx1SZ/CCwP8PvaKwI3w8i7sfz/NE 4v/j2nT6YFfbwrebsJGTm4koBhOpMTUZ+0kbOFfw8eejn6QgE+xzbPWzqjlLKRsha7ubGTK8OZy0p H+hswD3rJ+nbvQ==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <2cd5b127be6d64e640e569f262cef3bbb89f58a6.1694441831.git.ludo@gnu.org> <87ttro4tv2.fsf_-_@gmail.com> Date: Fri, 22 Sep 2023 23:58:27 +0200 In-Reply-To: <87ttro4tv2.fsf_-_@gmail.com> (Maxim Cournoyer's message of "Wed, 20 Sep 2023 13:50:09 -0400") Message-ID: <87fs35an0c.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -5.48 X-Migadu-Spam-Score: -5.48 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 9977245A5C X-TUID: ps8nNsGtUcxu Maxim Cournoyer skribis: > Ludovic Court=C3=A8s writes: > >> Fixes . >> >> Longer-term this will remove Git from the derivation graph when its sole >> use is to perform a checkout for a fixed-output derivation, thereby >> breaking dependency cycles that can arise in these situations. >> >> * guix/git-download.scm (git-fetch): Rename to=E2=80=A6 >> (git-fetch/in-band): =E2=80=A6 this. Deal with GIT or GUILE being #f. > > Nitpick, but I find this usage of dynamic default argument on top of > default arguments inelegant; see my comments below for an > alternative. Ah, let me explain=E2=80=A6 >> +(define* (git-fetch/in-band ref hash-algo hash >> + #:optional name >> + #:key (system (%current-system)) >> + (guile (default-guile)) >> + (git (git-package))) >> + "Return a fixed-output derivation that performs a Git checkout of REF= , using >> +GIT and GUILE (thus, said derivation depends on GIT and GUILE). >> + >> +This method is deprecated in favor of the \"builtin:git-download\" buil= der. >> +It will be removed when versions of guix-daemon implementing >> +\"builtin:git-download\" will be sufficiently widespread." >> (define inputs >> - `(("git" ,git) >> + `(("git" ,(or git (git-package))) > > Instead of using 'or' here to ensure git has a value, the default values > should have been copied to the new definition of git-fetch. [...] >> +(define* (git-fetch ref hash-algo hash >> + #:optional name >> + #:key (system (%current-system)) >> + guile git) > > As mentioned above, I'd have kept the default values for guile and git > here. The reason =E2=80=98guile=E2=80=99 and =E2=80=98git=E2=80=99 default to #f = here is because we don=E2=80=99t need them in what we expect to be the common case eventually: >> + "Return a fixed-output derivation that fetches REF, a >> +object. The output is expected to have recursive hash HASH of type >> +HASH-ALGO (a symbol). Use NAME as the file name, or a generic name if = #f." >> + (mlet %store-monad ((builtins (built-in-builders*))) >> + (if (member "git-download" builtins) >> + (git-fetch/built-in ref hash-algo hash name >> + #:system system) So it=E2=80=99s an optimization to avoid module lookups when they=E2=80=99re unnecessary. I hope that makes sense! Ludo=E2=80=99.