From 4dbbd721eb9db75d4968a624b8cb9e75e979a144 Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Mon, 2 Sep 2024 20:09:35 +0200 Subject: treewide: consistently mark overridden settings as such Only overridden settings are sent to the daemon, and we're going to do the same for the build hook to. It needs to be ensured that overridden settings are in fact consistently marked as such, so that they actually get sent. Change-Id: I7cd58d925702f86cf2c35ad121eb191ceb62a355 --- src/libcmd/common-eval-args.cc | 2 +- src/libcmd/installables.cc | 4 ++-- src/libcmd/repl.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libcmd') diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc index cbb7edbdd..089ad31d9 100644 --- a/src/libcmd/common-eval-args.cc +++ b/src/libcmd/common-eval-args.cc @@ -137,7 +137,7 @@ MixEvalArgs::MixEvalArgs() .description = "Allow access to mutable paths and repositories.", .category = category, .handler = {[&]() { - evalSettings.pureEval = false; + evalSettings.pureEval.override(false); }}, }); diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 711cf1b07..b81d4e0fd 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -212,7 +212,7 @@ void SourceExprCommand::completeInstallable(AddCompletions & completions, std::s if (file) { completions.setType(AddCompletions::Type::Attrs); - evalSettings.pureEval = false; + evalSettings.pureEval.override(false); auto state = getEvalState(); Expr & e = state->parseExprFromFile( resolveExprPath(state->checkSourcePath(lookupFileArg(*state, *file))) @@ -435,7 +435,7 @@ Installables SourceExprCommand::parseInstallables( throw UsageError("'--file' and '--expr' are exclusive"); // FIXME: backward compatibility hack - if (file) evalSettings.pureEval = false; + if (file) evalSettings.pureEval.override(false); auto state = getEvalState(); auto vFile = state->allocValue(); diff --git a/src/libcmd/repl.cc b/src/libcmd/repl.cc index ce19bc1eb..9d7fd47dc 100644 --- a/src/libcmd/repl.cc +++ b/src/libcmd/repl.cc @@ -817,10 +817,10 @@ ProcessLineResult NixRepl::processLine(std::string line) else if (command == ":te" || command == ":trace-enable") { if (arg == "false" || (arg == "" && loggerSettings.showTrace)) { std::cout << "not showing error traces\n"; - loggerSettings.showTrace = false; + loggerSettings.showTrace.override(false); } else if (arg == "true" || (arg == "" && !loggerSettings.showTrace)) { std::cout << "showing error traces\n"; - loggerSettings.showTrace = true; + loggerSettings.showTrace.override(true); } else { throw Error("unexpected argument '%s' to %s", arg, command); }; -- cgit v1.2.3