daemon: Remove the 'NIX_SUBSTITUTERS' environment variable.
* nix/libstore/globals.cc (Settings:update): Remove changes to 'substituters'. * nix/nix-daemon/guix-daemon.cc (main): Set 'settings.substituters' directly instead of changing the 'NIX_SUBSTITUTERS' environment variable. * build-aux/pre-inst-env.in: Remove reference to 'NIX_SUBSTITUTERS'.
This commit is contained in:
parent
44cfbb6233
commit
4d4a38f620
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# GNU Guix --- Functional package management for GNU
|
# GNU Guix --- Functional package management for GNU
|
||||||
# Copyright © 2012, 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
# Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||||
# Copyright © 2017 Eric Bavier <bavier@cray.com>
|
# Copyright © 2017 Eric Bavier <bavier@cray.com>
|
||||||
#
|
#
|
||||||
# This file is part of GNU Guix.
|
# This file is part of GNU Guix.
|
||||||
|
@ -45,10 +45,9 @@ export PATH
|
||||||
# Daemon helpers.
|
# Daemon helpers.
|
||||||
|
|
||||||
NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
|
NIX_ROOT_FINDER="$abs_top_builddir/nix/scripts/list-runtime-roots"
|
||||||
NIX_SUBSTITUTERS="$abs_top_builddir/nix/scripts/substitute"
|
|
||||||
NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'
|
NIX_LIBEXEC_DIR="@abs_top_builddir@/nix/scripts" # for 'guix-authenticate'
|
||||||
|
|
||||||
export NIX_ROOT_FINDER NIX_SUBSTITUTERS NIX_LIBEXEC_DIR
|
export NIX_ROOT_FINDER NIX_LIBEXEC_DIR
|
||||||
|
|
||||||
NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
|
NIX_BUILD_HOOK="$abs_top_builddir/nix/scripts/offload"
|
||||||
@BUILD_DAEMON_OFFLOAD_TRUE@export NIX_BUILD_HOOK
|
@BUILD_DAEMON_OFFLOAD_TRUE@export NIX_BUILD_HOOK
|
||||||
|
|
|
@ -141,18 +141,6 @@ void Settings::update()
|
||||||
_get(gcKeepDerivations, "gc-keep-derivations");
|
_get(gcKeepDerivations, "gc-keep-derivations");
|
||||||
_get(autoOptimiseStore, "auto-optimise-store");
|
_get(autoOptimiseStore, "auto-optimise-store");
|
||||||
_get(envKeepDerivations, "env-keep-derivations");
|
_get(envKeepDerivations, "env-keep-derivations");
|
||||||
|
|
||||||
string subs = getEnv("NIX_SUBSTITUTERS", "default");
|
|
||||||
if (subs == "default") {
|
|
||||||
substituters.clear();
|
|
||||||
#if 0
|
|
||||||
if (getEnv("NIX_OTHER_STORES") != "")
|
|
||||||
substituters.push_back(nixLibexecDir + "/nix/substituters/copy-from-other-stores.pl");
|
|
||||||
#endif
|
|
||||||
substituters.push_back(nixLibexecDir + "/nix/substituters/download-using-manifests.pl");
|
|
||||||
substituters.push_back(nixLibexecDir + "/nix/substituters/download-from-binary-cache.pl");
|
|
||||||
} else
|
|
||||||
substituters = tokenizeString<Strings>(subs, ":");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* GNU Guix --- Functional package management for GNU
|
/* GNU Guix --- Functional package management for GNU
|
||||||
Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
|
Copyright (C) 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
|
||||||
Copyright (C) 2006, 2010, 2012, 2014 Eelco Dolstra <e.dolstra@tudelft.nl>
|
Copyright (C) 2006, 2010, 2012, 2014 Eelco Dolstra <e.dolstra@tudelft.nl>
|
||||||
|
|
||||||
This file is part of GNU Guix.
|
This file is part of GNU Guix.
|
||||||
|
@ -499,22 +499,19 @@ main (int argc, char *argv[])
|
||||||
|
|
||||||
if (settings.useSubstitutes)
|
if (settings.useSubstitutes)
|
||||||
{
|
{
|
||||||
string subs = getEnv ("NIX_SUBSTITUTERS", "default");
|
/* XXX: Hack our way to use the 'substitute' script from
|
||||||
|
'LIBEXECDIR/guix' or just 'LIBEXECDIR', depending on whether
|
||||||
|
we're running uninstalled or not. */
|
||||||
|
const string subdir = getenv("GUIX_UNINSTALLED") != NULL
|
||||||
|
? "" : "/guix";
|
||||||
|
|
||||||
if (subs == "default")
|
settings.substituters.push_back (settings.nixLibexecDir
|
||||||
{
|
+ subdir + "/substitute");
|
||||||
string subst =
|
|
||||||
settings.nixLibexecDir + "/guix/substitute";
|
|
||||||
setenv ("NIX_SUBSTITUTERS", subst.c_str (), 1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
/* Clear the substituter list to make sure nothing ever gets
|
/* Clear the substituter list to make sure nothing ever gets
|
||||||
substituted, regardless of the client's settings. */
|
substituted, regardless of the client's settings. */
|
||||||
setenv ("NIX_SUBSTITUTERS", "", 1);
|
settings.substituters.clear ();
|
||||||
|
|
||||||
/* Effect the $NIX_SUBSTITUTERS change. */
|
|
||||||
settings.update ();
|
|
||||||
|
|
||||||
if (geteuid () == 0 && settings.buildUsersGroup.empty ())
|
if (geteuid () == 0 && settings.buildUsersGroup.empty ())
|
||||||
fprintf (stderr, _("warning: daemon is running as root, so \
|
fprintf (stderr, _("warning: daemon is running as root, so \
|
||||||
|
|
Loading…
Reference in New Issue