Trouble building the compiler

Hi all,

I'm trying a fresh build of the compiler, but I'm having some trouble. I cloned master, ran utils/update-checkout --clone-with-ssh, and then ran

utils/build-script --xcode --release-debuginfo  --force-optimized-typechecker --swift-assertions --skip-build-benchmarks

which built three projects: cmark, llvm, and swift. I opened cmark and llvm and ran the ALL_BUILD scheme.

Then I opened the Swift project and built the swift scheme. The build raised four warnings, two about newlines and two like this:

ld: warning: directory not found for option '-L/...../build/Xcode-RelWithDebInfoAssert/llvm-macosx-x86_64/RelWithDebInfo/lib/Debug'

ld: warning: directory not found for option '-L/...../build/Xcode-RelWithDebInfoAssert/swift-macosx-x86_64/Debug/lib/swift/macosx'

When I run the project from Xcode, it prints the following error:

<unknown>:0: error: unable to load standard library for target 'x86_64-apple-macosx10.14'
Program ended with exit code: 1

Could someone point me towards what I'm doing wrong?

The linker warnings are a bug somewhere in the fray of the CMake that glues our build system to LLVM's. It accidentally defines extra search paths that don't happen to exist, and the fact that it's a linker warning means it's benign.

The missing stdlib error is because, well, you didn't actually build stdlib. At least, not to completion. In Xcode, you can select either ALL_BUILD or the stdlib umbrella target and build one of those. If you encounter the dreaded Error copying file (if different) from "blah" to "blerg" while doing so, just delete the directory containing "blah" (the source) and rerun that target's build action. CMake will regenerate it.

1 Like

It worked! I wonder why I never ran into this problem before. Thanks for the help :+1:t2: