Skip to content

Commit 9f8a904

Browse files
authored
Merge pull request #205 from DeterminateSystems/fix-debugger
Disable parallel eval if the debugger is enabled
2 parents 766f43a + 520aae5 commit 9f8a904

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/libcmd/command.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ ref<Store> EvalCommand::getEvalStore()
125125
ref<EvalState> EvalCommand::getEvalState()
126126
{
127127
if (!evalState) {
128+
if (startReplOnEvalErrors && evalSettings.evalCores != 1U) {
129+
// Disable parallel eval if the debugger is enabled, since
130+
// they're incompatible at the moment.
131+
warn("using the debugger disables multi-threaded evaluation");
132+
evalSettings.evalCores = 1;
133+
}
134+
128135
evalState = std::allocate_shared<EvalState>(
129136
traceable_allocator<EvalState>(), lookupPath, getEvalStore(), fetchSettings, evalSettings, getStore());
130137

src/libexpr/include/nix/expr/eval-settings.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,8 @@ struct EvalSettings : Config
377377
* Any evaluation that uses `builtins.parallel`
378378
379379
The value `0` causes Nix to use all available CPU cores in the system.
380+
381+
Note that enabling the debugger (`--debugger`) disables multi-threaded evaluation.
380382
)"};
381383
};
382384

0 commit comments

Comments
 (0)