mirror of
https://github.com/NixOS/nix
synced 2025-07-04 15:31:47 +02:00
libcmd/repl: Fix missing runNix
in repl
Without this :u, :sh and :i repl commands fail with: > Cannot run 'nix-shell'/`nix-env` because no method of calling the Nix > CLI was provided. This is a configuration problem pertaining to how > this program was built. Remove the default ctor argument as it evidently makes catching refactoring bugs much harder. `NixRepl` implementation lives completely in `repl.cc`, so we can be as explicit as necessary.
This commit is contained in:
parent
8066e4b0c3
commit
44055dc09d
1 changed files with 5 additions and 3 deletions
|
@ -124,7 +124,7 @@ std::string removeWhitespace(std::string s)
|
|||
|
||||
|
||||
NixRepl::NixRepl(const LookupPath & lookupPath, nix::ref<Store> store, ref<EvalState> state,
|
||||
std::function<NixRepl::AnnotatedValues()> getValues, RunNix * runNix = nullptr)
|
||||
std::function<NixRepl::AnnotatedValues()> getValues, RunNix * runNix)
|
||||
: AbstractNixRepl(state)
|
||||
, debugTraceIndex(0)
|
||||
, getValues(getValues)
|
||||
|
@ -841,7 +841,8 @@ std::unique_ptr<AbstractNixRepl> AbstractNixRepl::create(
|
|||
lookupPath,
|
||||
std::move(store),
|
||||
state,
|
||||
getValues
|
||||
getValues,
|
||||
runNix
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -859,7 +860,8 @@ ReplExitStatus AbstractNixRepl::runSimple(
|
|||
lookupPath,
|
||||
openStore(),
|
||||
evalState,
|
||||
getValues
|
||||
getValues,
|
||||
/*runNix=*/nullptr
|
||||
);
|
||||
|
||||
repl->initEnv();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue