aboutsummaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorLudovic Courtès <ludovic.courtes@inria.fr>2023-09-11 14:22:44 +0200
committerLudovic Courtès <ludo@gnu.org>2023-09-26 17:36:58 +0200
commit95f21231352b66f92c466cb30f2258291e854f2f (patch)
tree74612aea6ae4bab10c4aa704296b778fc18b40d0 /nix
parent9d0e2002a54366c53bf9deb52471646529474e7d (diff)
downloadguix-95f21231352b66f92c466cb30f2258291e854f2f.tar
guix-95f21231352b66f92c466cb30f2258291e854f2f.tar.gz
daemon: Add “git-download” built-in builder.
The new builder makes it possible to break cycles that occurs when the fixed-output derivation for the source of a dependency of ‘git’ would itself depend on ‘git’. * guix/scripts/perform-download.scm (perform-git-download): New procedure. (perform-download): Move fixed-output derivation check to… (guix-perform-download): … here. Invoke ‘perform-download’ or ‘perform-git-download’ depending on what ‘derivation-builder’ returns. * nix/libstore/builtins.cc (builtins): Add “git-download”. * tests/derivations.scm ("built-in-builders"): Update. ("'git-download' built-in builder") ("'git-download' built-in builder, invalid hash") ("'git-download' built-in builder, invalid commit") ("'git-download' built-in builder, not found"): New tests.
Diffstat (limited to 'nix')
-rw-r--r--nix/libstore/builtins.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/nix/libstore/builtins.cc b/nix/libstore/builtins.cc
index 4111ac4760..6bf467354a 100644
--- a/nix/libstore/builtins.cc
+++ b/nix/libstore/builtins.cc
@@ -1,5 +1,5 @@
/* GNU Guix --- Functional package management for GNU
- Copyright (C) 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+ Copyright (C) 2016-2019, 2023 Ludovic Courtès <ludo@gnu.org>
This file is part of GNU Guix.
@@ -58,7 +58,8 @@ static void builtinDownload(const Derivation &drv,
static const std::map<std::string, derivationBuilder> builtins =
{
- { "download", builtinDownload }
+ { "download", builtinDownload },
+ { "git-download", builtinDownload }
};
derivationBuilder lookupBuiltinBuilder(const std::string & name)