libstore: send all changed settings to builtin-builder
this includes logger verbosity, which isn't a setting for some reason. fixes #1111 Change-Id: Ib078205b41069628010273645e26baf33b1c6d14
This commit is contained in:
@@ -34,6 +34,12 @@ static int main_builtin_builder(AsyncIoRoot & aio, std::string programName, Stri
|
||||
return *argvIt++;
|
||||
};
|
||||
|
||||
if (auto val = string2Int<int>(getArg("verbosity"))) {
|
||||
verbosity = verbosityFromIntClamped(*val);
|
||||
} else {
|
||||
throw Error("expected a verbosity argument");
|
||||
}
|
||||
|
||||
while (argvIt != argvEnd) {
|
||||
const auto arg = getArg("option");
|
||||
if (arg == "--") {
|
||||
@@ -41,7 +47,8 @@ static int main_builtin_builder(AsyncIoRoot & aio, std::string programName, Stri
|
||||
} else if (!arg.starts_with("--")) {
|
||||
throw Error("unexpected builtin option %s", arg);
|
||||
}
|
||||
settings.set(arg.substr(2), unescapeNul(getArg(arg)));
|
||||
auto value = unescapeNul(getArg(arg));
|
||||
globalConfig.set(arg.substr(2), value);
|
||||
}
|
||||
|
||||
while (argvIt != argvEnd) {
|
||||
|
||||
@@ -872,9 +872,13 @@ try {
|
||||
|
||||
if (drv->isBuiltin()) {
|
||||
args.push_back("builtin-builder");
|
||||
args.push_back(std::to_string(verbosity));
|
||||
|
||||
std::map<std::string, AbstractConfig::SettingInfo> overriddenSettings;
|
||||
settings.getSettings(overriddenSettings, true);
|
||||
std::map<std::string, AbstractConfig::SettingInfo> changedSettings;
|
||||
globalConfig.getChangedSettings(changedSettings);
|
||||
|
||||
// we won't need them since we're launching *into* a sandbox, and the list is quite large
|
||||
changedSettings.erase(settings.builtinBuilderSandboxPaths.name);
|
||||
|
||||
/* Make the contents of netrc and the CA certificate bundle
|
||||
available to builtin:fetchurl (which may run under a
|
||||
@@ -888,7 +892,7 @@ try {
|
||||
}
|
||||
|
||||
if (!data.empty()) {
|
||||
overriddenSettings[thing.name].value = tmpDirInSandbox + "/" + thing.name;
|
||||
changedSettings[thing.name].value = tmpDirInSandbox + "/" + thing.name;
|
||||
auto path = tmpDir + "/" + thing.name;
|
||||
writeFile(path, data, 0600);
|
||||
chownToBuilder(path);
|
||||
@@ -899,7 +903,7 @@ try {
|
||||
expose(settings.caFile);
|
||||
}
|
||||
|
||||
for (const auto & [setting, value] : overriddenSettings) {
|
||||
for (const auto & [setting, value] : changedSettings) {
|
||||
args.push_back("--" + setting);
|
||||
args.push_back(escapeNul(value.value));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user