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.
This commit is contained in:
Ludovic Courtès 2019-09-03 21:59:45 +02:00
parent 0c684b7edf
commit 9fcc35c51f
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
4 changed files with 3 additions and 17 deletions

View file

@ -148,8 +148,6 @@ if test "x$guix_build_daemon" = "xyes"; then
AC_SUBST([GUIX_TEST_ROOT]) AC_SUBST([GUIX_TEST_ROOT])
GUIX_CHECK_LOCALSTATEDIR GUIX_CHECK_LOCALSTATEDIR
AC_CONFIG_FILES([nix/scripts/download],
[chmod +x nix/scripts/download])
AC_CONFIG_FILES([nix/scripts/substitute], AC_CONFIG_FILES([nix/scripts/substitute],
[chmod +x nix/scripts/substitute]) [chmod +x nix/scripts/substitute])
AC_CONFIG_FILES([nix/scripts/offload], AC_CONFIG_FILES([nix/scripts/offload],

View file

@ -39,7 +39,7 @@ static void builtinDownload(const Derivation &drv,
const char *const argv[] = const char *const argv[] =
{ {
"download", drvPath.c_str(), output.c_str(), NULL "guix", "perform-download", drvPath.c_str(), output.c_str(), NULL
}; };
/* Tell the script what the store file name is, so that /* Tell the script what the store file name is, so that
@ -50,7 +50,7 @@ static void builtinDownload(const Derivation &drv,
/* Tell it about options such as "print-extended-build-trace". */ /* Tell it about options such as "print-extended-build-trace". */
setenv("_NIX_OPTIONS", settings.pack().c_str(), 1); setenv("_NIX_OPTIONS", settings.pack().c_str(), 1);
const string program = settings.nixLibexecDir + "/download"; const string program = settings.guixProgram;
execv(program.c_str(), (char *const *) argv); execv(program.c_str(), (char *const *) argv);
throw SysError(format("failed to run download program '%1%'") % program); throw SysError(format("failed to run download program '%1%'") % program);

View file

@ -155,8 +155,7 @@ noinst_HEADERS = \
(write (get-string-all in) out)))))" (write (get-string-all in) out)))))"
nodist_pkglibexec_SCRIPTS = \ nodist_pkglibexec_SCRIPTS = \
%D%/scripts/substitute \ %D%/scripts/substitute
%D%/scripts/download
if BUILD_DAEMON_OFFLOAD if BUILD_DAEMON_OFFLOAD

View file

@ -1,11 +0,0 @@
#!@SHELL@
# A shorthand for "guix perform-download", for use by the daemon.
if test "x$GUIX_UNINSTALLED" = "x"
then
prefix="@prefix@"
exec_prefix="@exec_prefix@"
exec "@bindir@/guix" perform-download "$@"
else
exec guix perform-download "$@"
fi