From patchwork Mon Sep 11 14:23:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 1783 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B6B7F27BBE2; Mon, 11 Sep 2023 15:25:16 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AE2AF27BBE9 for ; Mon, 11 Sep 2023 15:25:11 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfhqV-00039H-Si; Mon, 11 Sep 2023 10:24:59 -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 1qfhqU-00038t-6q for guix-patches@gnu.org; Mon, 11 Sep 2023 10:24:58 -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 1qfhqT-0002hm-V1 for guix-patches@gnu.org; Mon, 11 Sep 2023 10:24:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qfhqX-0006dY-Vo for guix-patches@gnu.org; Mon, 11 Sep 2023 10:25: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: Mon, 11 Sep 2023 14:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 65866 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 65866@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169444226225461 (code B ref -1); Mon, 11 Sep 2023 14:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 11 Sep 2023 14:24:22 +0000 Received: from localhost ([127.0.0.1]:54249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhpq-0006cX-17 for submit@debbugs.gnu.org; Mon, 11 Sep 2023 10:24:21 -0400 Received: from lists.gnu.org ([2001:470:142::17]:32830) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qfhpl-0006cE-CH for submit@debbugs.gnu.org; Mon, 11 Sep 2023 10:24:17 -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 1qfhpX-0002l0-9K for guix-patches@gnu.org; Mon, 11 Sep 2023 10:23:59 -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 1qfhpW-0002cM-Ac; Mon, 11 Sep 2023 10:23:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=lgd1VrghGcFnkob0HT8OwrhqRwdtNyRBFmXiiUyfdSU=; b=ry2Fq4eZIW4m+u ckRi/NvUvzqtUTLztFlwsmEDUZ8pI4er9qiJLcyDGFjFwKB5KtRFtOffBrsjaZ/nT+dE5PAH/qTCf RGlpWmsERgGTbJUDTJu69ylZdsUiTQG8s0E3Ts44E1nZiOBTJ0FqhWJFPJHy92TcfWlxIp6c53v54 vZirMioyN5rEzYjwkgBosJGzGl0UxV8NmHSkiXuBB/OjUmTndBiBTB3OhuTxBmETqRYNb3w1321MW bm8U08xz8WOIpSWA8jjwICMHQDPJoRZbzoJF9/2IacBLb2s8T3s+UKmOH+l//KLtMjQ1sxL3vTQd4 OEC7ok7hPC/w7VrwCQGw==; From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 11 Sep 2023 16:23:42 +0200 Message-ID: X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hello Guix! This patch series is a first step towards getting Git out of derivation graphs when it’s only used to fetch source code (origins with ‘git-fetch’), with the goal of fixing: https://issues.guix.gnu.org/63331 The is similar to how we solved the problem for regular file downloads: we add a new “builtin:git-download” builder for derivations, which is implemented on the daemon size by the ‘guix perform-download’ helper. That command uses the same code that is currently used by ‘git-fetch’. Eventually, when users are all running recent versions of ‘guix-daemon’ with support for “builtin:git-download” (2–4 years from now?), we’ll be able to use “builtin:git-download” unconditionally and thus be sure there are no risks of derivation cycles. Note that the patch series adds a hard dependency on Git. This is because the existing ‘git-fetch’ code depends on Git, which is itself motivated by the fact that Git supports shallow clones and libgit2/Guile-Git doesn’t. As a side effect, this dependency will prove useful to address . Thoughts? Ludo’. Ludovic Courtès (8): git-download: Move fallback code to (guix build git). git-download: Honor the ‘GUIX_DOWNLOAD_FALLBACK_TEST’ environment variable. perform-download: Remove unused one-argument clause. daemon: Add “git-download” built-in builder. build: Add dependency on Git. perform-git-download: Use the ‘git’ command captured at configure time. git-download: Use “builtin:git-download” when available. tests: Assume ‘git’ is always available. configure.ac | 7 ++ doc/guix.texi | 1 + guix/build/git.scm | 44 ++++++++++- guix/config.scm.in | 6 +- guix/git-download.scm | 122 ++++++++++++++++++------------ guix/scripts/perform-download.scm | 59 +++++++++++---- guix/self.scm | 10 ++- nix/libstore/builtins.cc | 5 +- tests/builders.scm | 29 ++++++- tests/channels.scm | 7 +- tests/derivations.scm | 94 ++++++++++++++++++++++- tests/git-authenticate.scm | 1 - tests/git.scm | 10 --- tests/import-git.scm | 18 ----- 14 files changed, 308 insertions(+), 105 deletions(-) base-commit: a4c35c607cfd7d6b0bad90cfcc46188d489e1754