Compiling swift with xcode fails

Hi everyone, today I've been trying to compile swift using the readme from github, I get source from swift-swfit-5.2.3-RELEASE.tar.gz and ran update-checkout --clone and I have Xcode 12 beta 4 installed on macOS 10.15, cmake version 3.18.1. However when I run the utils/build-script --release-debuginfo --xcode I get this error:

=== BUILD AGGREGATE TARGET symlink_clang_headers OF PROJECT Swift WITH CONFIGURATION RelWithDebInfo ===
Check dependencies

PhaseScriptExecution CMake\ Rules /Users/huangzhonglv/Develop/swift/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/SwiftShims/Swift.build/RelWithDebInfo/symlink_clang_headers.build/Script-50EAE4C1163A437FA1F0C5D7.sh
cd /Users/huangzhonglv/Develop/swift/swift
/bin/sh -c /Users/huangzhonglv/Develop/swift/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/SwiftShims/Swift.build/RelWithDebInfo/symlink_clang_headers.build/Script-50EAE4C1163A437FA1F0C5D7.sh

=== BUILD TARGET swiftRuntime-macosx-arm64 OF PROJECT Swift WITH CONFIGURATION RelWithDebInfo ===

Check dependencies

** BUILD FAILED **

The following build commands failed:
Libtool /Users/huangzhonglv/Develop/swift/build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/stdlib/public/LLVMSupport/Swift.build/RelWithDebInfo/swiftLLVMSupport-macosx-arm64.build/libswiftLLVMSupport-macosx-arm64.a normal x86_64
(1 failure)
ERROR: command terminated with a non-zero exit status 65, aborting

Can someone help me out here? Thanks.

Does xcode-select path points to the Xcode beta app and not the released one?

Yes I did xcode-select-ed the beta version.

1 Like

Hi,

You should use Xcode beta 1 and compile with the following command:

swift/utils/build-script --release-debuginfo --xcode --extra-cmake-options="-DCMAKE_OSX_ARCHITECTURES=x86_64"