summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-09-03 21:59:45 +0200
committerLudovic Courtès <ludo@gnu.org>2019-09-08 11:49:24 +0200
commit9fcc35c51fd579b3bb7b4f61cba6973675c3922c (patch)
tree51dcf3d81a20f2cc3330d329ccf4f8537d203578
parent0c684b7edfacada4f576855dbb09291f04a84fa2 (diff)
daemon: Run 'guix perform-download' directly.
* nix/scripts/download.in: Remove. * nix/local.mk (nodist_pkglibexec_SCRIPTS): Remove 'scripts/download'. * config-daemon.ac: Don't output 'nix/scripts/download'. * nix/libstore/builtins.cc (builtinDownload): Invoke 'guix perform-download' directly.
-rw-r--r--config-daemon.ac2
-rw-r--r--nix/libstore/builtins.cc4
-rw-r--r--nix/local.mk3
-rw-r--r--nix/scripts/download.in11
4 files changed, 3 insertions, 17 deletions
diff --git a/config-daemon.ac b/config-daemon.ac
index 907457f4785..50227e310cc 100644
--- a/config-daemon.ac
+++ b/config-daemon.ac
@@ -148,8 +148,6 @@ if test "x$guix_build_daemon" = "xyes"; then
148 AC_SUBST([GUIX_TEST_ROOT]) 148 AC_SUBST([GUIX_TEST_ROOT])
149 149
150 GUIX_CHECK_LOCALSTATEDIR 150 GUIX_CHECK_LOCALSTATEDIR
151 AC_CONFIG_FILES([nix/scripts/download],
152 [chmod +x nix/scripts/download])
153 AC_CONFIG_FILES([nix/scripts/substitute], 151 AC_CONFIG_FILES([nix/scripts/substitute],
154 [chmod +x nix/scripts/substitute]) 152 [chmod +x nix/scripts/substitute])
155 AC_CONFIG_FILES([nix/scripts/offload], 153 AC_CONFIG_FILES([nix/scripts/offload],
diff --git a/nix/libstore/builtins.cc b/nix/libstore/builtins.cc
index f7c7d424847..4111ac47609 100644
--- a/nix/libstore/builtins.cc
+++ b/nix/libstore/builtins.cc
@@ -39,7 +39,7 @@ static void builtinDownload(const Derivation &drv,
39 39
40 const char *const argv[] = 40 const char *const argv[] =
41 { 41 {
42 "download", drvPath.c_str(), output.c_str(), NULL 42 "guix", "perform-download", drvPath.c_str(), output.c_str(), NULL
43 }; 43 };
44 44
45 /* Tell the script what the store file name is, so that 45 /* Tell the script what the store file name is, so that
@@ -50,7 +50,7 @@ static void builtinDownload(const Derivation &drv,
50 /* Tell it about options such as "print-extended-build-trace". */ 50 /* Tell it about options such as "print-extended-build-trace". */
51 setenv("_NIX_OPTIONS", settings.pack().c_str(), 1); 51 setenv("_NIX_OPTIONS", settings.pack().c_str(), 1);
52 52
53 const string program = settings.nixLibexecDir + "/download"; 53 const string program = settings.guixProgram;
54 execv(program.c_str(), (char *const *) argv); 54 execv(program.c_str(), (char *const *) argv);
55 55
56 throw SysError(format("failed to run download program '%1%'") % program); 56 throw SysError(format("failed to run download program '%1%'") % program);
diff --git a/nix/local.mk b/nix/local.mk
index cdcd9eb1c2e..c4c3920fa35 100644
--- a/nix/local.mk
+++ b/nix/local.mk
@@ -155,8 +155,7 @@ noinst_HEADERS = \
155 (write (get-string-all in) out)))))" 155 (write (get-string-all in) out)))))"
156 156
157nodist_pkglibexec_SCRIPTS = \ 157nodist_pkglibexec_SCRIPTS = \
158 %D%/scripts/substitute \ 158 %D%/scripts/substitute
159 %D%/scripts/download
160 159
161if BUILD_DAEMON_OFFLOAD 160if BUILD_DAEMON_OFFLOAD
162 161
diff --git a/nix/scripts/download.in b/nix/scripts/download.in
deleted file mode 100644
index 4d7088a9933..00000000000
--- a/nix/scripts/download.in
+++ /dev/null
@@ -1,11 +0,0 @@
1#!@SHELL@
2# A shorthand for "guix perform-download", for use by the daemon.
3
4if test "x$GUIX_UNINSTALLED" = "x"
5then
6 prefix="@prefix@"
7 exec_prefix="@exec_prefix@"
8 exec "@bindir@/guix" perform-download "$@"
9else
10 exec guix perform-download "$@"
11fi