Unable to compile and generate Xcode project

I cloned the swift repo per the instructions in the README. When I run this command on the command line:

swift/utils/build-script --release-debuginfo --debug-swift --xcode

The build-script fails with this message:


Check dependencies

Write auxiliary files
write-file /Users/kiel/work/swift-source/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/LLVM.build/RelWithDebInfo/ALL_BUILD.build/Script-9D62FFEDF281451CAD874256.sh
chmod 0755 /Users/kiel/work/swift-source/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/LLVM.build/RelWithDebInfo/ALL_BUILD.build/Script-9D62FFEDF281451CAD874256.sh

PhaseScriptExecution CMake\ Rules /Users/kiel/work/swift-source/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/LLVM.build/RelWithDebInfo/ALL_BUILD.build/Script-9D62FFEDF281451CAD874256.sh
    cd /Users/kiel/work/swift-source/llvm
    /bin/sh -c /Users/kiel/work/swift-source/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/LLVM.build/RelWithDebInfo/ALL_BUILD.build/Script-9D62FFEDF281451CAD874256.sh
echo ""

echo Build\ all\ projects
Build all projects

** BUILD SUCCEEDED ** [3879.589 sec]

ls: /Users/kiel/work/swift-source/build/Xcode-RelWithDebInfoAssert+swift-DebugAssert/llvm-macosx-x86_64/lib/clang: No such file or directory
swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

What am I doing wrong?

Do you have the latest Xcode beta installed and enabled with xcode-select? I wonder if your issue is caused by using Xcode 10 if that's the case.

I have the Xcode 11 beta installed but it seems the script (and Xcode select) use Xcode 10.2.

That might be the reason for the failure, the README specifies that Xcode 11 is now a requirement when building for macOS. You can switch with sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

1 Like

I missed that. I’ll give it a try. Thanks so much!

1 Like

Hi Kiel, (thanks Max), I am having similar issues ... where to place the various components, and how to switch pathing backwards and forwards as I move from production work to beta work.

Is your Xcode-beta.app installed under /Applications as Max suggests ?
How did you "install" it there using the Xcode_11_Beta_2.xip ?

I have posed other questions in my own thread, perhaps you could give me an insight into how you addressed these installation steps? Thanks In Advance -- Ed

Q1: where did you install/run the Xcode_11_beta_2.XIP file ?
Q2: similarly where did you install the "Trunk Development (Master) Snapshot", if at all ?
Q3: similarly, using home-brew, where (i.e. what's the best place) did you install ninja ?
Q4: similarly, using home-brew, where did you install CMake ?
Q5. similarly, where did you clone, debug, build, and test Swift 5.1 from GitHub ?
in a home directory like /swift-master/swift ?

I think it's possible there may be an issue with latest master even if building with the correct version of Xcode selected. I'm seeing the same clang: No such file or directory error as @kiel after rebasing a branch which previously built fine with Xcode 11.

Currently trying a build with ./utils/build-script --debug --xcode to see if it makes any difference

Edit: FWIW, the full debug build seems to be working

Mine crashed the first time ... not enough space ! some of the free space estimates were too low ... hence rebuilding my system ... and wanting to know what are best practices

Looks like SR-10998 / this PR will fix my build issues.

Related thread.

Terms of Service

Privacy Policy

Cookie Policy