Swift toolchain build failure

When I built the swift toolchain, I encountered some problems, I don't know how to solve it, and every time I execute ./swift/utils/build-toolchain com.xxxx, it will restart the build, it takes a lot of time, how can I do it Save time by not rebuilding.

The following is the error message:
-- Installing: /Users/xxx/Desktop/swift-project/build/buildbot_osx/intermediate-install/macosx-arm64/Library/Developer/Toolchains/swift-LOCAL-2023-06-16-a.xctoolchain/usr/../System/Library/PrivateFrameworks/LLDB.framework/Versions/A/Resources/Python/lldb/macosx/crashlog_scripted_process.py
CMake Error at cmake_install.cmake:49 (file):
file INSTALL cannot find
No such file or directory.
Call Stack (most recent call first):
/Users/xxx/Desktop/swift-project/build/buildbot_osx/lldb-macosx-arm64/source/cmake_install.cmake:55 (include)
/Users/xxx/Desktop/swift-project/build/buildbot_osx/lldb-macosx-arm64/cmake_install.cmake:64 (include)

FAILED: source/API/CMakeFiles/install-liblldb /Users/xxx/Desktop/swift-project/build/buildbot_osx/lldb-macosx-arm64/source/API/CMakeFiles/install-liblldb
cd /Users/xxx/Desktop/swift-project/build/buildbot_osx/lldb-macosx-arm64/source/API && /usr/local/Cellar/cmake/3.26.0/bin/cmake -DCMAKE_INSTALL_COMPONENT="liblldb" -P /Users/yjl/Desktop/swift-project/build/buildbot_osx/lldb-macosx-arm64/cmake_install.cmake
[5/8][ 62%][1.095s] Running utility command for lldb-python
ninja: build stopped: subcommand failed.
ERROR: command terminated with a non-zero exit status 1, aborting

My execution command is as follows:
git clone --branch swift-5.8.1-RELEASE GitHub - apple/swift: The Swift Programming Language swift
./swift/utils/update-checkout --clone --tag swift-5.8.1-RELEASE
./swift/utils/build-toolchain com.xxxx

cmake version 3.26.0
sccache 0.5.3
ninja 1.12.0.git
Python 3.11.4
xcode 14.3.1

To get the toolchain built it's best to invoke utils/build-script not utils/build-toolchain, following the instructions shared in GettingStarted.md, have you followed those?

I see in this doc GitHub - apple/swift: The Swift Programming Language.
I see that utils/build-toolchain internally calls utils/build-script, I don't understand what is the difference between them


While utils/build-toolchain may internally call utils/build-script, it's an implementation detail and shouldn't be relied on.

The section you've linked to is for CI setup. If you're building for local use, you should follow instructions in docs/GettingStarted.md, which explain how to build with utils/build-script end to end.

will try to use utils/build-script later, I just want to use toolchain to load llvm pass, when I use the main branch, a python error is reported:

I don't think it has anything to do with utils/build-script