diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2020-07-30 14:59:57 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2020-07-30 14:59:57 -0500 |
commit | d7ffe327aeab94ad1c7a27ca0c83436b92ac60fa (patch) | |
tree | 25cf09e48e5c42a320be1df2e4e9511883ad93ec /src/nix/repl.cc | |
parent | baaab2aab58aa3c47517d4ba9121a29a7ad73078 (diff) | |
parent | a785b3eddf8c02750b1715939069d20980bd5125 (diff) |
Merge remote-tracking branch 'origin/master' into fix-and-ci-static-builds
Diffstat (limited to 'src/nix/repl.cc')
-rw-r--r-- | src/nix/repl.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/nix/repl.cc b/src/nix/repl.cc index 617d49614..fb9050d0d 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -211,12 +211,12 @@ void NixRepl::mainLoop(const std::vector<std::string> & files) // input without clearing the input so far. continue; } else { - printMsg(lvlError, error + "%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg()); + printMsg(lvlError, e.msg()); } } catch (Error & e) { - printMsg(lvlError, error + "%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg()); + printMsg(lvlError, e.msg()); } catch (Interrupted & e) { - printMsg(lvlError, error + "%1%%2%", (settings.showTrace ? e.prefix() : ""), e.msg()); + printMsg(lvlError, e.msg()); } // We handled the current input fully, so we should clear it @@ -483,10 +483,10 @@ bool NixRepl::processLine(string line) but doing it in a child makes it easier to recover from problems / SIGINT. */ if (runProgram(settings.nixBinDir + "/nix", Strings{"build", "--no-link", drvPath}) == 0) { - auto drv = readDerivation(*state->store, drvPath); + auto drv = readDerivation(*state->store, drvPath, Derivation::nameFromPath(state->store->parseStorePath(drvPath))); std::cout << std::endl << "this derivation produced the following outputs:" << std::endl; for (auto & i : drv.outputs) - std::cout << fmt(" %s -> %s\n", i.first, state->store->printStorePath(i.second.path)); + std::cout << fmt(" %s -> %s\n", i.first, state->store->printStorePath(i.second.path(*state->store, drv.name))); } } else if (command == ":i") { runProgram(settings.nixBinDir + "/nix-env", Strings{"-i", drvPath}); @@ -760,7 +760,11 @@ struct CmdRepl : StoreCommand, MixEvalArgs CmdRepl() { - expectArgs("files", &files); + expectArgs({ + .label = "files", + .handler = {&files}, + .completer = completePath + }); } std::string description() override @@ -780,6 +784,7 @@ struct CmdRepl : StoreCommand, MixEvalArgs void run(ref<Store> store) override { + evalSettings.pureEval = false; auto repl = std::make_unique<NixRepl>(searchPath, openStore()); repl->autoArgs = getAutoArgs(*repl->state); repl->mainLoop(files); |