`swift 构建` 中止 "Assertion `isInProgress()' failed."

`swift build` aborted with "Assertion `isInProgress()' failed."

运行 swift build 给我这些错误。

swift-build: /home/build-user/llbuild/lib/Core/BuildEngine.cpp:250: (anonymous namespace)::BuildEngineImpl::TaskInfo *(anonymous namespace)::BuildEngineImpl::RuleInfo::getPendingTaskInfo(): Assertion `isInProgress()' failed.
Aborted (core dumped)

我试过的

***   708  0.0  0.1 498876 25472 tty2     Sl   13:21   0:00 /home/***/Swift/swift-5.2.4-RELEASE-ubuntu20.04/usr/bin/lldb --repl=-disable-objc-interop -color-diagnostics
***   713  0.0  0.0 146108  7620 tty2     S    13:21   0:00 /home/***/Swift/swift-5.2.4-RELEASE-ubuntu20.04/usr/bin/lldb-server gdbserver --fd=9 --native-regs --setsid
***   720  0.0  0.0   8404   176 tty2     t    13:21   0:00 /home/***/Swift/swift-5.2.4-RELEASE-ubuntu20.04/usr/bin/repl_swift

环境

我清理了项目 .build 目录,然后构建工作正常。

.build 目录可能被 VSCode Swift Development Enviroment 扩展破坏。

可能与 sqlite 相关的错误似乎是由 运行 swift build from Electron in Swift Development Enviroment Extension 引起的。

作为临时解决方案,我通过在VS Code设置中清空“Swift ›Path: Swift_driver_bin”来解决它,这样swift build就不会被执行。