daemon: Run 'guix substitute' directly and assume a single substituter.
The daemon had a mechanism that allows it to handle a list of substituters and try them sequentially; this removes it. * nix/scripts/substitute.in: Remove. * nix/local.mk (nodist_pkglibexec_SCRIPTS): Remove. * config-daemon.ac: Don't output 'nix/scripts/substitute'. * nix/libstore/build.cc (SubstitutionGoal)[subs, sub, hasSubstitute]: Remove. [tryNext]: Make private. (SubstitutionGoal::SubstitutionGoal, SubstitutionGoal::init): Remove now unneeded initializers. (SubstitutionGoal::tryNext): Adjust to assume a single substituter: call 'amDone' upfront when we couldn't find substitutes. (SubstitutionGoal::tryToRun): Adjust to run 'guix substitute' via 'settings.guixProgram'. (SubstitutionGoal::finished): Call 'amDone(ecFailed)' upon failure instead of setting 'state' to 'tryNext'. * nix/libstore/globals.hh (Settings)[substituters]: Remove. * nix/libstore/local-store.cc (LocalStore::~LocalStore): Adjust to handle a single substituter. (LocalStore::startSubstituter): Remove 'path' parameter. Adjust to invoke 'settings.guixProgram'. Don't refer to 'run.program', which no longer exists. (LocalStore::querySubstitutablePaths): Adjust for 'runningSubstituters' being a singleton instead of a list. (LocalStore::querySubstitutablePathInfos): Likewise, and remove 'substituter' parameter. * nix/libstore/local-store.hh (RunningSubstituter)[program]: Remove. (LocalStore)[runningSubstituters]: Remove. [runningSubstituter]: New field. [querySubstitutablePathInfos]: Remove 'substituter' parameter. [startSubstituter]: Remove 'substituter' parameter. * nix/nix-daemon/guix-daemon.cc (main): Remove references to 'settings.substituters'. * nix/nix-daemon/nix-daemon.cc (performOp): Ignore the user's "build-use-substitutes" value when 'settings.useSubstitutes' is false.
This commit is contained in:
parent
bc69ea2d60
commit
f6919ebdc6
|
@ -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/substitute],
|
|
||||||
[chmod +x nix/scripts/substitute])
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AM_CONDITIONAL([HAVE_LIBBZ2], [test "x$HAVE_LIBBZ2" = "xyes"])
|
AM_CONDITIONAL([HAVE_LIBBZ2], [test "x$HAVE_LIBBZ2" = "xyes"])
|
||||||
|
|
|
@ -2863,15 +2863,6 @@ private:
|
||||||
/* The store path that should be realised through a substitute. */
|
/* The store path that should be realised through a substitute. */
|
||||||
Path storePath;
|
Path storePath;
|
||||||
|
|
||||||
/* The remaining substituters. */
|
|
||||||
Paths subs;
|
|
||||||
|
|
||||||
/* The current substituter. */
|
|
||||||
Path sub;
|
|
||||||
|
|
||||||
/* Whether any substituter can realise this path */
|
|
||||||
bool hasSubstitute;
|
|
||||||
|
|
||||||
/* Path info returned by the substituter's query info operation. */
|
/* Path info returned by the substituter's query info operation. */
|
||||||
SubstitutablePathInfo info;
|
SubstitutablePathInfo info;
|
||||||
|
|
||||||
|
@ -2897,6 +2888,8 @@ private:
|
||||||
typedef void (SubstitutionGoal::*GoalState)();
|
typedef void (SubstitutionGoal::*GoalState)();
|
||||||
GoalState state;
|
GoalState state;
|
||||||
|
|
||||||
|
void tryNext();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SubstitutionGoal(const Path & storePath, Worker & worker, bool repair = false);
|
SubstitutionGoal(const Path & storePath, Worker & worker, bool repair = false);
|
||||||
~SubstitutionGoal();
|
~SubstitutionGoal();
|
||||||
|
@ -2914,7 +2907,6 @@ public:
|
||||||
|
|
||||||
/* The states. */
|
/* The states. */
|
||||||
void init();
|
void init();
|
||||||
void tryNext();
|
|
||||||
void gotInfo();
|
void gotInfo();
|
||||||
void referencesValid();
|
void referencesValid();
|
||||||
void tryToRun();
|
void tryToRun();
|
||||||
|
@ -2930,7 +2922,6 @@ public:
|
||||||
|
|
||||||
SubstitutionGoal::SubstitutionGoal(const Path & storePath, Worker & worker, bool repair)
|
SubstitutionGoal::SubstitutionGoal(const Path & storePath, Worker & worker, bool repair)
|
||||||
: Goal(worker)
|
: Goal(worker)
|
||||||
, hasSubstitute(false)
|
|
||||||
, repair(repair)
|
, repair(repair)
|
||||||
{
|
{
|
||||||
this->storePath = storePath;
|
this->storePath = storePath;
|
||||||
|
@ -2980,37 +2971,31 @@ void SubstitutionGoal::init()
|
||||||
if (settings.readOnlyMode)
|
if (settings.readOnlyMode)
|
||||||
throw Error(format("cannot substitute path `%1%' - no write access to the store") % storePath);
|
throw Error(format("cannot substitute path `%1%' - no write access to the store") % storePath);
|
||||||
|
|
||||||
subs = settings.substituters;
|
|
||||||
|
|
||||||
tryNext();
|
tryNext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void SubstitutionGoal::tryNext()
|
void SubstitutionGoal::tryNext()
|
||||||
{
|
{
|
||||||
trace("trying next substituter");
|
trace("trying substituter");
|
||||||
|
|
||||||
if (subs.size() == 0) {
|
SubstitutablePathInfos infos;
|
||||||
|
PathSet dummy(singleton<PathSet>(storePath));
|
||||||
|
worker.store.querySubstitutablePathInfos(dummy, infos);
|
||||||
|
SubstitutablePathInfos::iterator k = infos.find(storePath);
|
||||||
|
if (k == infos.end()) {
|
||||||
/* None left. Terminate this goal and let someone else deal
|
/* None left. Terminate this goal and let someone else deal
|
||||||
with it. */
|
with it. */
|
||||||
debug(format("path `%1%' is required, but there is no substituter that can build it") % storePath);
|
debug(format("path `%1%' is required, but there is no substituter that can build it") % storePath);
|
||||||
/* Hack: don't indicate failure if there were no substituters.
|
/* Hack: don't indicate failure if there were no substituters.
|
||||||
In that case the calling derivation should just do a
|
In that case the calling derivation should just do a
|
||||||
build. */
|
build. */
|
||||||
amDone(hasSubstitute ? ecFailed : ecNoSubstituters);
|
amDone(ecNoSubstituters);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sub = subs.front();
|
/* Found a substitute. */
|
||||||
subs.pop_front();
|
|
||||||
|
|
||||||
SubstitutablePathInfos infos;
|
|
||||||
PathSet dummy(singleton<PathSet>(storePath));
|
|
||||||
worker.store.querySubstitutablePathInfos(sub, dummy, infos);
|
|
||||||
SubstitutablePathInfos::iterator k = infos.find(storePath);
|
|
||||||
if (k == infos.end()) { tryNext(); return; }
|
|
||||||
info = k->second;
|
info = k->second;
|
||||||
hasSubstitute = true;
|
|
||||||
|
|
||||||
/* To maintain the closure invariant, we first have to realise the
|
/* To maintain the closure invariant, we first have to realise the
|
||||||
paths referenced by this one. */
|
paths referenced by this one. */
|
||||||
|
@ -3098,7 +3083,8 @@ void SubstitutionGoal::tryToRun()
|
||||||
|
|
||||||
/* Fill in the arguments. */
|
/* Fill in the arguments. */
|
||||||
Strings args;
|
Strings args;
|
||||||
args.push_back(baseNameOf(sub));
|
args.push_back("guix");
|
||||||
|
args.push_back("substitute");
|
||||||
args.push_back("--substitute");
|
args.push_back("--substitute");
|
||||||
args.push_back(storePath);
|
args.push_back(storePath);
|
||||||
args.push_back(destPath);
|
args.push_back(destPath);
|
||||||
|
@ -3111,9 +3097,9 @@ void SubstitutionGoal::tryToRun()
|
||||||
if (dup2(outPipe.writeSide, STDOUT_FILENO) == -1)
|
if (dup2(outPipe.writeSide, STDOUT_FILENO) == -1)
|
||||||
throw SysError("cannot dup output pipe into stdout");
|
throw SysError("cannot dup output pipe into stdout");
|
||||||
|
|
||||||
execv(sub.c_str(), stringsToCharPtrs(args).data());
|
execv(settings.guixProgram.c_str(), stringsToCharPtrs(args).data());
|
||||||
|
|
||||||
throw SysError(format("executing `%1%'") % sub);
|
throw SysError(format("executing `%1% substitute'") % settings.guixProgram);
|
||||||
});
|
});
|
||||||
|
|
||||||
pid.setSeparatePG(true);
|
pid.setSeparatePG(true);
|
||||||
|
@ -3126,7 +3112,9 @@ void SubstitutionGoal::tryToRun()
|
||||||
state = &SubstitutionGoal::finished;
|
state = &SubstitutionGoal::finished;
|
||||||
|
|
||||||
if (settings.printBuildTrace)
|
if (settings.printBuildTrace)
|
||||||
printMsg(lvlError, format("@ substituter-started %1% %2%") % storePath % sub);
|
/* The second element in the message used to be the name of the
|
||||||
|
substituter but we're left with only one. */
|
||||||
|
printMsg(lvlError, format("@ substituter-started %1% substitute") % storePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3192,9 +3180,7 @@ void SubstitutionGoal::finished()
|
||||||
% storePath % status % e.msg());
|
% storePath % status % e.msg());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Try the next substitute. */
|
amDone(ecFailed);
|
||||||
state = &SubstitutionGoal::tryNext;
|
|
||||||
worker.wakeUp(shared_from_this());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -115,11 +115,6 @@ struct Settings {
|
||||||
means infinity. */
|
means infinity. */
|
||||||
time_t buildTimeout;
|
time_t buildTimeout;
|
||||||
|
|
||||||
/* The substituters. There are programs that can somehow realise
|
|
||||||
a store path without building, e.g., by downloading it or
|
|
||||||
copying it from a CD. */
|
|
||||||
Paths substituters;
|
|
||||||
|
|
||||||
/* Whether to use build hooks (for distributed builds). Sometimes
|
/* Whether to use build hooks (for distributed builds). Sometimes
|
||||||
users want to disable this from the command-line. */
|
users want to disable this from the command-line. */
|
||||||
bool useBuildHook;
|
bool useBuildHook;
|
||||||
|
|
|
@ -184,13 +184,15 @@ LocalStore::LocalStore(bool reserveSpace)
|
||||||
LocalStore::~LocalStore()
|
LocalStore::~LocalStore()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
foreach (RunningSubstituters::iterator, i, runningSubstituters) {
|
if (runningSubstituter) {
|
||||||
if (i->second.disabled) continue;
|
RunningSubstituter &i = *runningSubstituter;
|
||||||
i->second.to.close();
|
if (!i.disabled) {
|
||||||
i->second.from.close();
|
i.to.close();
|
||||||
i->second.error.close();
|
i.from.close();
|
||||||
if (i->second.pid != -1)
|
i.error.close();
|
||||||
i->second.pid.wait(true);
|
if (i.pid != -1)
|
||||||
|
i.pid.wait(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
ignoreException();
|
ignoreException();
|
||||||
|
@ -808,11 +810,12 @@ void LocalStore::setSubstituterEnv()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter & run)
|
void LocalStore::startSubstituter(RunningSubstituter & run)
|
||||||
{
|
{
|
||||||
if (run.disabled || run.pid != -1) return;
|
if (run.disabled || run.pid != -1) return;
|
||||||
|
|
||||||
debug(format("starting substituter program `%1%'") % substituter);
|
debug(format("starting substituter program `%1% substitute'")
|
||||||
|
% settings.guixProgram);
|
||||||
|
|
||||||
Pipe toPipe, fromPipe, errorPipe;
|
Pipe toPipe, fromPipe, errorPipe;
|
||||||
|
|
||||||
|
@ -829,11 +832,10 @@ void LocalStore::startSubstituter(const Path & substituter, RunningSubstituter &
|
||||||
throw SysError("dupping stdout");
|
throw SysError("dupping stdout");
|
||||||
if (dup2(errorPipe.writeSide, STDERR_FILENO) == -1)
|
if (dup2(errorPipe.writeSide, STDERR_FILENO) == -1)
|
||||||
throw SysError("dupping stderr");
|
throw SysError("dupping stderr");
|
||||||
execl(substituter.c_str(), substituter.c_str(), "--query", NULL);
|
execl(settings.guixProgram.c_str(), "guix", "substitute", "--query", NULL);
|
||||||
throw SysError(format("executing `%1%'") % substituter);
|
throw SysError(format("executing `%1%'") % settings.guixProgram);
|
||||||
});
|
});
|
||||||
|
|
||||||
run.program = baseNameOf(substituter);
|
|
||||||
run.to = toPipe.writeSide.borrow();
|
run.to = toPipe.writeSide.borrow();
|
||||||
run.from = run.fromBuf.fd = fromPipe.readSide.borrow();
|
run.from = run.fromBuf.fd = fromPipe.readSide.borrow();
|
||||||
run.error = errorPipe.readSide.borrow();
|
run.error = errorPipe.readSide.borrow();
|
||||||
|
@ -889,13 +891,14 @@ string LocalStore::getLineFromSubstituter(RunningSubstituter & run)
|
||||||
if (errno == EINTR) continue;
|
if (errno == EINTR) continue;
|
||||||
throw SysError("reading from substituter's stderr");
|
throw SysError("reading from substituter's stderr");
|
||||||
}
|
}
|
||||||
if (n == 0) throw EndOfFile(format("substituter `%1%' died unexpectedly") % run.program);
|
if (n == 0) throw EndOfFile(format("`%1% substitute' died unexpectedly")
|
||||||
|
% settings.guixProgram);
|
||||||
err.append(buf, n);
|
err.append(buf, n);
|
||||||
string::size_type p;
|
string::size_type p;
|
||||||
while (((p = err.find('\n')) != string::npos)
|
while (((p = err.find('\n')) != string::npos)
|
||||||
|| ((p = err.find('\r')) != string::npos)) {
|
|| ((p = err.find('\r')) != string::npos)) {
|
||||||
string thing(err, 0, p + 1);
|
string thing(err, 0, p + 1);
|
||||||
writeToStderr(run.program + ": " + thing);
|
writeToStderr("substitute: " + thing);
|
||||||
err = string(err, p + 1);
|
err = string(err, p + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -907,7 +910,7 @@ string LocalStore::getLineFromSubstituter(RunningSubstituter & run)
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
run.fromBuf(&c, 1);
|
run.fromBuf(&c, 1);
|
||||||
if (c == '\n') {
|
if (c == '\n') {
|
||||||
if (!err.empty()) printMsg(lvlError, run.program + ": " + err);
|
if (!err.empty()) printMsg(lvlError, "substitute: " + err);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
res += c;
|
res += c;
|
||||||
|
@ -930,13 +933,17 @@ PathSet LocalStore::querySubstitutablePaths(const PathSet & paths)
|
||||||
{
|
{
|
||||||
PathSet res;
|
PathSet res;
|
||||||
|
|
||||||
if (!settings.useSubstitutes) return res;
|
if (!settings.useSubstitutes || paths.empty()) return res;
|
||||||
|
|
||||||
foreach (Paths::iterator, i, settings.substituters) {
|
if (!runningSubstituter) {
|
||||||
if (res.size() == paths.size()) break;
|
std::unique_ptr<RunningSubstituter>fresh(new RunningSubstituter);
|
||||||
RunningSubstituter & run(runningSubstituters[*i]);
|
runningSubstituter.swap(fresh);
|
||||||
startSubstituter(*i, run);
|
}
|
||||||
if (run.disabled) continue;
|
|
||||||
|
RunningSubstituter & run = *runningSubstituter;
|
||||||
|
startSubstituter(run);
|
||||||
|
|
||||||
|
if (!run.disabled) {
|
||||||
string s = "have ";
|
string s = "have ";
|
||||||
foreach (PathSet::const_iterator, j, paths)
|
foreach (PathSet::const_iterator, j, paths)
|
||||||
if (res.find(*j) == res.end()) { s += *j; s += " "; }
|
if (res.find(*j) == res.end()) { s += *j; s += " "; }
|
||||||
|
@ -951,17 +958,22 @@ PathSet LocalStore::querySubstitutablePaths(const PathSet & paths)
|
||||||
res.insert(path);
|
res.insert(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void LocalStore::querySubstitutablePathInfos(const Path & substituter,
|
void LocalStore::querySubstitutablePathInfos(PathSet & paths, SubstitutablePathInfos & infos)
|
||||||
PathSet & paths, SubstitutablePathInfos & infos)
|
|
||||||
{
|
{
|
||||||
if (!settings.useSubstitutes) return;
|
if (!settings.useSubstitutes) return;
|
||||||
|
|
||||||
RunningSubstituter & run(runningSubstituters[substituter]);
|
if (!runningSubstituter) {
|
||||||
startSubstituter(substituter, run);
|
std::unique_ptr<RunningSubstituter>fresh(new RunningSubstituter);
|
||||||
|
runningSubstituter.swap(fresh);
|
||||||
|
}
|
||||||
|
|
||||||
|
RunningSubstituter & run = *runningSubstituter;
|
||||||
|
startSubstituter(run);
|
||||||
if (run.disabled) return;
|
if (run.disabled) return;
|
||||||
|
|
||||||
string s = "info ";
|
string s = "info ";
|
||||||
|
@ -993,10 +1005,9 @@ void LocalStore::querySubstitutablePathInfos(const Path & substituter,
|
||||||
void LocalStore::querySubstitutablePathInfos(const PathSet & paths,
|
void LocalStore::querySubstitutablePathInfos(const PathSet & paths,
|
||||||
SubstitutablePathInfos & infos)
|
SubstitutablePathInfos & infos)
|
||||||
{
|
{
|
||||||
|
if (!paths.empty()) {
|
||||||
PathSet todo = paths;
|
PathSet todo = paths;
|
||||||
foreach (Paths::iterator, i, settings.substituters) {
|
querySubstitutablePathInfos(todo, infos);
|
||||||
if (todo.empty()) break;
|
|
||||||
querySubstitutablePathInfos(*i, todo, infos);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,6 @@ struct OptimiseStats
|
||||||
|
|
||||||
struct RunningSubstituter
|
struct RunningSubstituter
|
||||||
{
|
{
|
||||||
Path program;
|
|
||||||
Pid pid;
|
Pid pid;
|
||||||
AutoCloseFD to, from, error;
|
AutoCloseFD to, from, error;
|
||||||
FdSource fromBuf;
|
FdSource fromBuf;
|
||||||
|
@ -52,8 +51,8 @@ struct RunningSubstituter
|
||||||
class LocalStore : public StoreAPI
|
class LocalStore : public StoreAPI
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef std::map<Path, RunningSubstituter> RunningSubstituters;
|
/* The currently running substituter or empty. */
|
||||||
RunningSubstituters runningSubstituters;
|
std::unique_ptr<RunningSubstituter> runningSubstituter;
|
||||||
|
|
||||||
Path linksDir;
|
Path linksDir;
|
||||||
|
|
||||||
|
@ -93,8 +92,8 @@ public:
|
||||||
|
|
||||||
PathSet querySubstitutablePaths(const PathSet & paths);
|
PathSet querySubstitutablePaths(const PathSet & paths);
|
||||||
|
|
||||||
void querySubstitutablePathInfos(const Path & substituter,
|
void querySubstitutablePathInfos(PathSet & paths,
|
||||||
PathSet & paths, SubstitutablePathInfos & infos);
|
SubstitutablePathInfos & infos);
|
||||||
|
|
||||||
void querySubstitutablePathInfos(const PathSet & paths,
|
void querySubstitutablePathInfos(const PathSet & paths,
|
||||||
SubstitutablePathInfos & infos);
|
SubstitutablePathInfos & infos);
|
||||||
|
@ -261,8 +260,7 @@ private:
|
||||||
|
|
||||||
void removeUnusedLinks(const GCState & state);
|
void removeUnusedLinks(const GCState & state);
|
||||||
|
|
||||||
void startSubstituter(const Path & substituter,
|
void startSubstituter(RunningSubstituter & runningSubstituter);
|
||||||
RunningSubstituter & runningSubstituter);
|
|
||||||
|
|
||||||
string getLineFromSubstituter(RunningSubstituter & run);
|
string getLineFromSubstituter(RunningSubstituter & run);
|
||||||
|
|
||||||
|
|
|
@ -154,9 +154,6 @@ noinst_HEADERS = \
|
||||||
(lambda (in) \
|
(lambda (in) \
|
||||||
(write (get-string-all in) out)))))"
|
(write (get-string-all in) out)))))"
|
||||||
|
|
||||||
nodist_pkglibexec_SCRIPTS = \
|
|
||||||
%D%/scripts/substitute
|
|
||||||
|
|
||||||
# The '.service' files for systemd.
|
# The '.service' files for systemd.
|
||||||
systemdservicedir = $(libdir)/systemd/system
|
systemdservicedir = $(libdir)/systemd/system
|
||||||
nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service
|
nodist_systemdservice_DATA = etc/guix-daemon.service etc/guix-publish.service
|
||||||
|
|
|
@ -466,8 +466,7 @@ main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
settings.processEnvironment ();
|
settings.processEnvironment ();
|
||||||
|
|
||||||
/* Use our substituter by default. */
|
/* Enable substitutes by default. */
|
||||||
settings.substituters.clear ();
|
|
||||||
settings.set ("build-use-substitutes", "true");
|
settings.set ("build-use-substitutes", "true");
|
||||||
|
|
||||||
/* Use our substitute server by default. */
|
/* Use our substitute server by default. */
|
||||||
|
@ -490,14 +489,6 @@ main (int argc, char *argv[])
|
||||||
printMsg(lvlDebug,
|
printMsg(lvlDebug,
|
||||||
format ("build log compression: %1%") % settings.logCompression);
|
format ("build log compression: %1%") % settings.logCompression);
|
||||||
|
|
||||||
if (settings.useSubstitutes)
|
|
||||||
settings.substituters.push_back (settings.nixLibexecDir
|
|
||||||
+ "/substitute");
|
|
||||||
else
|
|
||||||
/* Clear the substituter list to make sure nothing ever gets
|
|
||||||
substituted, regardless of the client's settings. */
|
|
||||||
settings.substituters.clear ();
|
|
||||||
|
|
||||||
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 \
|
||||||
using `--build-users-group' is highly recommended\n"));
|
using `--build-users-group' is highly recommended\n"));
|
||||||
|
|
|
@ -596,8 +596,12 @@ static void performOp(bool trusted, unsigned int clientVersion,
|
||||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 6
|
if (GET_PROTOCOL_MINOR(clientVersion) >= 6
|
||||||
&& GET_PROTOCOL_MINOR(clientVersion) < 0x61)
|
&& GET_PROTOCOL_MINOR(clientVersion) < 0x61)
|
||||||
settings.set("build-cores", std::to_string(readInt(from)));
|
settings.set("build-cores", std::to_string(readInt(from)));
|
||||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 10)
|
if (GET_PROTOCOL_MINOR(clientVersion) >= 10) {
|
||||||
|
if (settings.useSubstitutes)
|
||||||
settings.set("build-use-substitutes", readInt(from) ? "true" : "false");
|
settings.set("build-use-substitutes", readInt(from) ? "true" : "false");
|
||||||
|
else
|
||||||
|
readInt(from); // substitutes remain disabled
|
||||||
|
}
|
||||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 12) {
|
if (GET_PROTOCOL_MINOR(clientVersion) >= 12) {
|
||||||
unsigned int n = readInt(from);
|
unsigned int n = readInt(from);
|
||||||
for (unsigned int i = 0; i < n; i++) {
|
for (unsigned int i = 0; i < n; i++) {
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
#!@SHELL@
|
|
||||||
# A shorthand for "guix substitute", for use by the daemon.
|
|
||||||
|
|
||||||
if test "x$GUIX_UNINSTALLED" = "x"
|
|
||||||
then
|
|
||||||
prefix="@prefix@"
|
|
||||||
exec_prefix="@exec_prefix@"
|
|
||||||
exec "@bindir@/guix" substitute "$@"
|
|
||||||
else
|
|
||||||
exec guix substitute "$@"
|
|
||||||
fi
|
|
Loading…
Reference in New Issue