diff options
author | Guillaume Maudoux <guillaume.maudoux@tweag.io> | 2022-09-07 00:34:03 +0200 |
---|---|---|
committer | Guillaume Maudoux <guillaume.maudoux@tweag.io> | 2022-09-07 00:34:03 +0200 |
commit | eb460a9529dd79995b6b788d59322fbc8f989214 (patch) | |
tree | 2dec54ef6b3096d787cb49cb0f2f6b7041b1f6c1 /src/nix/main.cc | |
parent | 9ff892aad4ee13532ea84cb6e4a2a53d70945efe (diff) | |
parent | 96001098796c9011d1670cc8a7acd00ef49b2d7a (diff) |
WIP: broken merge but need a git checkpoint
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r-- | src/nix/main.cc | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc index 9fab1d6e3..85a3835c2 100644 --- a/src/nix/main.cc +++ b/src/nix/main.cc @@ -82,7 +82,7 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs .shortName = 'L', .description = "Print full build logs on standard error.", .category = loggingCategory, - .handler = {[&]() {setLogFormat(LogFormat::barWithLogs); }}, + .handler = {[&]() { logger->setPrintBuildLogs(true); }}, }); addFlag({ @@ -261,9 +261,16 @@ void mainWrapped(int argc, char * * argv) } #endif + Finally f([] { logger->stop(); }); + programPath = argv[0]; auto programName = std::string(baseNameOf(programPath)); + if (argc > 0 && std::string_view(argv[0]) == "__build-remote") { + programName = "build-remote"; + argv++; argc--; + } + { auto legacy = (*RegisterLegacyCommand::commands)[programName]; if (legacy) return legacy(argc, argv); @@ -279,8 +286,6 @@ void mainWrapped(int argc, char * * argv) verbosity = lvlInfo; } - Finally f([] { logger->stop(); }); - NixArgs args; if (argc == 2 && std::string(argv[1]) == "__dump-args") { @@ -342,7 +347,10 @@ void mainWrapped(int argc, char * * argv) if (!completions) throw; } - if (completions) return; + if (completions) { + args.completionHook(); + return; + } if (args.showVersion) { printVersion(programName); @@ -380,6 +388,9 @@ void mainWrapped(int argc, char * * argv) settings.ttlPositiveNarInfoCache = 0; } + if (args.command->second->forceImpureByDefault() && !evalSettings.pureEval.overridden) { + evalSettings.pureEval = false; + } args.command->second->prepare(); args.command->second->run(); } |