When running utils/build-script --release-debuginfo --skip-early-swift-driver, I got following error:
~/swift-project/swift
+ /home/tongjiew/swift-project/build/cmake-linux-x86_64/bin/cmake --build /home/tongjiew/swift-project/build/Ninja-RelWithDebInfoAssert/swift-linux-x86_64 -- -j16 all swift-test-stdlib-linux-x86_64
ninja: error: 'stdlib/public/StringProcessing/swift_RegexParser-swiftmodule-linux-x86_64', needed by 'stdlib/public/StringProcessing/LINUX/x86_64/_StringProcessing.o', missing and no known rule to make it
--- Building cmark ---
Building the standard library for: swift-test-stdlib-linux-x86_64
ERROR: command terminated with a non-zero exit status 1, aborting
I could build Swift last week, but I got this error when I tried to run the build script yesterday. I can't figure out the problem, so I made this post according to the get started page.
Here is the GitHub Gist link for full output and hashes: Swift Build Error · GitHub. I am working on Ubuntu 20.04 LTS via WSL2. I did rm -rf ../build before running the utils/build-script. Does anyone know what the issue is? Thanks for the help in advance.
Maybe you can cd into the swift-experimental-string-processing directory and manually update it via git pull. From the error message it looks like your swift-experimental-string-processing repo is not up to date.
Maybe something (or maybe myself) accidentally messed up my local git repositories. I just cloned the Swift into a new directory, and the git status of swift-experimental-string-processing directory (in the newly cloned swift project) says
On branch swift/main
Your branch is up to date with 'origin/swift/main'.
nothing to commit, working tree clean
I solved the issue by re-cloning the project, ensuring the branch was correct. For people in the future having this issue, it's worth trying the solutions provided by @rxwei and @LucianoPAlmeida first.
I recall that I interrupted the execution of utils/update-checkout because I forgot to set up the ssh-agent. Not sure if these are related.