I apologize if this is the wrong category.
I've built Swift from source, and was using only the REPL. Only now I found out swiftc fails to compile any program at all with message:
<unknown>:0: error: unable to execute command: <unknown>
Using swiftc to emit-lllvm though works fine.
Digging at the source-code, this error seems to be thrown in method runTaskQueueToCompletion
of class PerformJobsState
, file Compilation.cpp
:
void runTaskQueueToCompletion() {
do {
using namespace std::placeholders;
// Ask the TaskQueue to execute.
if (TQ->execute(std::bind(&PerformJobsState::taskBegan, this, _1, _2),
std::bind(&PerformJobsState::taskFinished, this, _1, _2,
_3, _4, _5, _6),
std::bind(&PerformJobsState::taskSignalled, this, _1,
_2, _3, _4, _5, _6, _7))) {
if (Result == EXIT_SUCCESS) {
// FIXME: Error from task queue while Result == EXIT_SUCCESS most
// likely means some fork/exec or posix_spawn failed; TaskQueue saw
// "an error" at some stage before even calling us with a process
// exit / signal (or else a poll failed); unfortunately the task
// causing it was dropped on the floor and we have no way to recover
// it here, so we report a very poor, generic error.
Comp.getDiags().diagnose(SourceLoc(),
diag::error_unable_to_execute_command,
"<unknown>");
// ...
I tried rebuilding swift but I get the same error. I built it with the command:
utils/build-script --release-debuginfo --lldb --host-cc ~/Developer/llvm/build_9/bin/clang --host-cxx ~/Developer/llvm/build_9/bin/clang++
How can I fix this? Is there some something I should do in my OS to get the compiler to work?