Build fails for 3.1.1

Hi all, I wonder if anyone can help? I'm trying to build Swift 3.1.1 from source code on a Mac and getting errors.

I've tried it with Xcode 9, Xcode 8.3.3, Xcode 8.2.1 and the latest attempt was with Xcode 7.2.1.

(In each case, I moved all other Xcode versions aside in the Applications folder and put the appropriate Xcode there instead.)

I checked out tag swift-3.1.1-RELEASE in a folder called swift in my test area then used the update-checkout as follows to check out related projects and dependencies:

utils/update-checkout --clone --tag swift-3.1.1-RELEASE

Finally, I used the build script as so:

utils/build-script -R --clean

I think it's capable of building swift/swiftc itself but is failing to build the standard library.

Here are the build errors when building with Xcode 7.2.1...

(see the bottom of the post for the build errors with Xcode 8)

-- Build files have been written to: /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64

  • popd

~/avr/swift/swift

  • /usr/local/bin/cmake --build /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64 -- -j8 all swift-test-stdlib-macosx-x86_64 swift-benchmark-macosx-x86_64

[95/1170] Building CXX object lib/Basic/CMakeFiles/swiftBasic.dir/Version.cpp.o

/Users/carlpeto/avr/swift/swift/lib/Basic/Version.cpp:55:13: warning: unused function 'printFullRevisionString' [-Wunused-function]

static void printFullRevisionString(raw_ostream &out) {

^

1 warning generated.

[616/1170] Generating /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64/Swift.swiftmodule

FAILED: lib/swift/macosx/x86_64/Swift.swiftmodule lib/swift/macosx/x86_64/Swift.swiftdoc

cd /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core && /Users/carlpeto/avr/swift/swift/utils/line-directive /Users/carlpeto/avr/swift/swift/stdlib/public/core/Algorithm.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayBody.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayBufferProtocol.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayCast.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Arrays.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayType.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Assert.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/AssertCommon.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/BidirectionalCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Bool.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/BridgeObjectiveC.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/BridgeStorage.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Builtin.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/BuiltinMath.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Character.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CocoaArray.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Collection.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/CollectionAlgorithms.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Comparable.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CompilerProtocols.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ClosedRange.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ContiguousArrayBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CString.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CTypes.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/DebuggerSupport.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/DropWhile.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Dump.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/EmptyCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Equatable.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ErrorType.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Existential.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Filter.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FixedPoint.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/FlatMap.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Flatten.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FloatingPoint.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FloatingPointParsing.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FloatingPointTypes.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Hashable.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/HashedCollections.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/AnyHashable.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/HashedCollectionsAnyHashableExtensions.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Hashing.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/HeapBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ImplicitlyUnwrappedOptional.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Index.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Indices.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/InputStream.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/IntegerArithmetic.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/IntegerParsing.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Join.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/LazyCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/LazySequence.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/LifetimeManager.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ManagedBuffer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Map.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/MemoryLayout.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Mirrors.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Misc.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/MutableCollection.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/NewtypeWrapper.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ObjCMirrors.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ObjectIdentifier.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Optional.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/OptionSet.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/OutputStream.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Pointer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Policy.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/PrefixWhile.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Print.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/RandomAccessCollection.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Range.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/RangeReplaceableCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ReflectionLegacy.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Repeat.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/REPL.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Reverse.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Runtime.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/SipHash.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Sequence.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/SequenceAlgorithms.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SequenceWrapper.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SetAlgebra.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ShadowProtocols.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Shims.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Slice.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Sort.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StaticString.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Stride.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringCharacterView.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/String.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringBridge.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringComparable.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringCore.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringHashable.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/StringInterpolation.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringLegacy.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/StringRangeReplaceableCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringIndexConversions.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringUnicodeScalarView.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringUTF16.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringUTF8.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SwiftNativeNSArray.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnavailableStringAPIs.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Unicode.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/UnicodeScalar.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnicodeTrie.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Unmanaged.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/UnsafeBitMap.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafeBufferPointer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafeRawBufferPointer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafePointer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafeRawPointer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/WriteBackMutableSlice.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Availability.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CollectionOfOne.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/ExistentialCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Mirror.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CommandLine.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SliceBuffer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Tuple.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/UnfoldSequence.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/VarArgs.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Zip.swift -- /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./bin/swiftc -emit-module -o /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64/Swift.swiftmodule -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -target x86_64-apple-macosx10.9 -resource-dir /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk/../../../Developer/Library/Frameworks -O -D INTERNAL_CHECKS_ENABLED -I /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64 -module-cache-path /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./module-cache -no-link-objc-runtime -nostdimport -parse-stdlib -module-name Swift -Xfrontend -group-info-path -Xfrontend /Users/carlpeto/avr/swift/swift/stdlib/public/core/GroupInfo.json -Xfrontend -sil-serialize-all -module-link-name swiftCore -force-single-frontend-invocation -Xcc -D__SWIFT_CURRENT_DYLIB=swiftCore -parse-as-library /Users/carlpeto/avr/swift/swift/stdlib/public/core/Algorithm.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayBody.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayBufferProtocol.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayCast.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Arrays.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ArrayType.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Assert.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/AssertCommon.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/BidirectionalCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Bool.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/BridgeObjectiveC.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/BridgeStorage.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Builtin.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/BuiltinMath.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Character.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CocoaArray.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Collection.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/CollectionAlgorithms.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Comparable.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CompilerProtocols.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ClosedRange.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ContiguousArrayBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CString.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CTypes.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/DebuggerSupport.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/DropWhile.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Dump.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/EmptyCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Equatable.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ErrorType.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Existential.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Filter.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FixedPoint.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/FlatMap.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Flatten.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FloatingPoint.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FloatingPointParsing.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/FloatingPointTypes.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Hashable.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/HashedCollections.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/AnyHashable.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/HashedCollectionsAnyHashableExtensions.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Hashing.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/HeapBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ImplicitlyUnwrappedOptional.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Index.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Indices.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/InputStream.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/IntegerArithmetic.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/IntegerParsing.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Join.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/LazyCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/LazySequence.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/LifetimeManager.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ManagedBuffer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Map.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/MemoryLayout.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Mirrors.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Misc.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/MutableCollection.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/NewtypeWrapper.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ObjCMirrors.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ObjectIdentifier.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Optional.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/OptionSet.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/OutputStream.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Pointer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Policy.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/PrefixWhile.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Print.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/RandomAccessCollection.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Range.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/RangeReplaceableCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ReflectionLegacy.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Repeat.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/REPL.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Reverse.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Runtime.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/SipHash.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Sequence.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/SequenceAlgorithms.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SequenceWrapper.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SetAlgebra.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/ShadowProtocols.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Shims.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Slice.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Sort.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StaticString.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Stride.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringCharacterView.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/String.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringBridge.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringBuffer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringComparable.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringCore.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringHashable.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/StringInterpolation.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringLegacy.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/StringRangeReplaceableCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringIndexConversions.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringUnicodeScalarView.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringUTF16.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/StringUTF8.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SwiftNativeNSArray.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnavailableStringAPIs.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Unicode.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/UnicodeScalar.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnicodeTrie.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Unmanaged.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/UnsafeBitMap.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafeBufferPointer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafeRawBufferPointer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafePointer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/UnsafeRawPointer.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/WriteBackMutableSlice.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Availability.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CollectionOfOne.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/ExistentialCollection.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Mirror.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/CommandLine.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/SliceBuffer.swift /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/core/8/Tuple.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/UnfoldSequence.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/VarArgs.swift /Users/carlpeto/avr/swift/swift/stdlib/public/core/Zip.swift

<unknown>:0: error: Swift does not support the SDK 'MacOSX10.11.sdk'

[623/1170] Generating UnicodeExtendedGraphemeClusters.cpp from UnicodeExtendedGraphemeClusters.cpp.gyb with ptr size = 8

ninja: build stopped: subcommand failed.

utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

...I can't easily change mac OS version (I'm on macOS 10.12.6) apart from upgrading to High Sierra or Mojave beta, but it sounds like that's not the issue anyway?

Can anyone help?

*** UPDATE ***

Here are the errors if built against Xcode 8.2.1...

[788/1170] Generating /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64/SafariServices.swiftmodule

FAILED: lib/swift/macosx/x86_64/SafariServices.swiftmodule lib/swift/macosx/x86_64/SafariServices.swiftdoc

cd /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/public/SDK/SafariServices && /Users/carlpeto/avr/swift/swift/utils/line-directive /Users/carlpeto/avr/swift/swift/stdlib/public/SDK/SafariServices/SafariServices.swift -- /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./bin/swiftc -emit-module -o /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64/SafariServices.swiftmodule -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -target x86_64-apple-macosx10.9 -resource-dir /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/../../../Developer/Library/Frameworks -O -D INTERNAL_CHECKS_ENABLED -I /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64 -module-cache-path /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./module-cache -no-link-objc-runtime -autolink-force-load -module-link-name swiftSafariServices -force-single-frontend-invocation -parse-as-library /Users/carlpeto/avr/swift/swift/stdlib/public/SDK/SafariServices/SafariServices.swift

:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:18:68: error: unknown type name 'SFSafariServicesVersion'
static inline bool _swift_SafariServices_isSafariServicesAvailable(SFSafariServicesVersion version) {
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:19:18: error: use of undeclared identifier 'SFSafariServicesVersion10_0'
if (version == SFSafariServicesVersion10_0) {
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:23:3: error: use of undeclared identifier 'SFSafariServicesVersion'
SFSafariServicesVersion* latestVersion = &_SFSafariServicesVersion;
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:23:28: error: use of undeclared identifier 'latestVersion'
SFSafariServicesVersion* latestVersion = &_SFSafariServicesVersion;
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:23:45: error: use of undeclared identifier '_SFSafariServicesVersion'
SFSafariServicesVersion* latestVersion = &_SFSafariServicesVersion;
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:24:15: error: use of undeclared identifier 'latestVersion'; did you mean 'ICGetVersion'?
if (NULL == latestVersion) {
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h:711:1: note: 'ICGetVersion' declared here
ICGetVersion(
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:24:15: warning: comparison of function 'ICGetVersion' equal to a null pointer is always false
if (NULL == latestVersion) {
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:24:15: note: prefix with the address-of operator to silence this warning
if (NULL == latestVersion) {
^
:1:9: note: in file included from :1:
#import "SafariServicesOverlayShims.h"
^
/Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/shims/SafariServicesOverlayShims.h:28:11: error: use of undeclared identifier 'latestVersion'; did you mean 'ICGetVersion'?
return *latestVersion >= version;
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/HIServices.framework/Headers/InternetConfig.h:711:1: note: 'ICGetVersion' declared here
ICGetVersion(
^
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/SafariServices/SafariServices.swift:14:8: error: could not build Objective-C module '_SwiftSafariServicesOverlayShims'
import _SwiftSafariServicesOverlayShims
^

Plus note there are a load of warnings, of various types, but most of them are about unsafe pointers...

/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:43:39: warning: 'unsafeBitCast' from 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to 'UnsafeMutablePointer' changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to rebind the type of memory
return uuid_parse(string, unsafeBitCast($0, to: UnsafeMutablePointer.self))
^
[770/1170] Generating /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/./lib/swift/macosx/x86_64/CoreData.swiftmodule
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/CoreData/NSManagedObjectContext.swift:18:22: warning: 'unsafeBitCast' from 'NSFetchRequest' to 'NSFetchRequest' can be replaced with 'unsafeDowncast'
return try fetch(unsafeBitCast(request, to: NSFetchRequest.self)) as! [T]
^~~~~~~~~~~~~
unsafeDowncast

Summary


It looks like the Swift source code for 3.1.1 is probably supposed to be built against some version of Xcode 8 but the versions I've tried are not working.

Can anyone shed any light?

Hi, Carl. Swapping out your Xcode.app doesn't automatically change the configuration Swift is using to build—maybe it should, but it currently just uses what it has cached. Try utils/build-script -R --clean --reconfigure.

I believe Swift 3.1 should go with Xcode 8.3 and its associated SDKs.

Thank you very much for your reply, that sounds good. Does anyone know which version of 8.3? There are four options, 8.3, 8.3.1, 8.3.2 and 8.3.3 (which is the one I tried and will now try again!)

Ah, the newest one should be fine.

Cool. Trying your suggestion now, using Xcode 8.3.3. Crossing fingers. Cautiously optimistic. :) (p.s. I've been trying to compile this since WWDC but I'm finally on holiday so actually have a decent amount of time to spend on the problem while not exhausted working for da man!)

OK I think it might have worked?

Dumb question, but does this look right?? These are the last messages printed out before it returned to the command line.

/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:62:40: warning: 'unsafeBitCast' from 'UnsafeMutablePointer<uuid_string_t>' (aka 'UnsafeMutablePointer<(Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8)>') to 'UnsafePointer' (aka 'UnsafePointer') changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafeMutablePointer<uuid_string_t>' (aka 'UnsafeMutablePointer<(Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8)>') to rebind the type of memory
return String(cString: unsafeBitCast(str, to: UnsafePointer.self), encoding: .utf8)!
^
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:70:48: warning: 'unsafeBitCast' from 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to 'UnsafeMutablePointer' changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to rebind the type of memory
return Int(bitPattern: CFHashBytes(unsafeBitCast($0, to: UnsafeMutablePointer.self), CFIndex(MemoryLayout<uuid_t>.size)))
^
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:87:38: warning: 'unsafeBitCast' from 'UnsafePointer<uuid_t>' (aka 'UnsafePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to 'UnsafePointer' changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafePointer<uuid_t>' (aka 'UnsafePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to rebind the type of memory
return NSUUID(uuidBytes: unsafeBitCast($0, to: UnsafePointer.self))
^
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:26:34: warning: 'unsafeBitCast' from 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to 'UnsafeMutablePointer' changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to rebind the type of memory
uuid_generate_random(unsafeBitCast($0, to: UnsafeMutablePointer.self))
^
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:33:32: warning: 'unsafeBitCast' from 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to 'UnsafeMutablePointer' changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to rebind the type of memory
reference.getBytes(unsafeBitCast($0, to: UnsafeMutablePointer.self))
^
/Users/carlpeto/avr/swift/swift/stdlib/public/SDK/Foundation/UUID.swift:43:39: warning: 'unsafeBitCast' from 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to 'UnsafeMutablePointer' changes pointee type and may lead to undefined behavior; use the 'withMemoryRebound' method on 'UnsafeMutablePointer<uuid_t>' (aka 'UnsafeMutablePointer<(UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8)>') to rebind the type of memory
return uuid_parse(string, unsafeBitCast($0, to: UnsafeMutablePointer.self))
^
[895/1170] Compiling /Users/carlpeto/avr/swift/build/Ninja-ReleaseAssert/swift-macosx-x86_64/stdlib/private/StdlibUnittest/macosx/x86_64/StdlibUnittest.o
/Users/carlpeto/avr/swift/swift/stdlib/private/StdlibUnittest/StdlibUnittest.swift.gyb:579:5: warning: default will never be executed
default:
^
[1170/1170] Running utility command for swift-benchmark-macosx-x86_64

That's all!

I was sort of expecting to see a "completed" message and I wasn't expecting so many warnings!

But I don't see an "error" or "failed" message so I guess it's worked? (Running a quick compile of a super simple swift file seems to compile to sensible LLVM IR and on to roughly sane looking assembly language.)

Answering my own question here...

The "fix" is once it looked like compilation was working, I ran again with tests enabled and got (nearly) a full pass... (I think the only failing test was because I've got some misconfiguration of my shell due to old programs in the PATH variable, I corrected that and it seems to have worked).

So here is my "definitive (ish) guide" to compiling swift 3.1.1 on your random macOS box.

  1. Create a directory to house all the source code. In my case it was simply /Code/swift. You might find ~/Documents/Code/swift or something similar easier and more normal.

  2. Go into that directory and clone the swift source code.
    git clone https://github.com/apple/swift.git

  3. Go into the newly cloned directory...
    cd swift

  4. Switch to/checkout the swift 3.1.1 release tag...
    git checkout swift-3.1.1-RELEASE

  5. Run the update checkout script...
    utils/update-checkout --clone --tag swift-3.1.1-RELEASE
    (If British, make tea while this runs.)

  6. If your current version of Xcode in your Applications folder is not Xcode 8.3, 8.3.1, 8.3.2 or 8.3.3, then move it aside/rename it.

  7. Download Xcode 8.3.3 or another Xcode 8.3 variant from Sign In - Apple

  8. Install that as /Applications/Xcode. The path must match. It must be an Xcode 8.3 version and it must be in /Applications.

  9. Go back to your source directory and run the build script...
    utils/build-script -R --clean --reconfigure

You should see it end with something like "[1170/1170] Running utility command for swift-benchmark-macosx-x86_64". You may get loads of warnings but nothing should say "error", "failed" or "fatal".

If, like me, the documentation fails to compile, you can try this patch (YMMV)...

diff --git a/CMakeLists.txt b/CMakeLists.txt
index e6d12cb9f2..47c2e73fcc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -73,7 +73,7 @@ option(SWIFT_INCLUDE_TESTS "Create targets for building/running tests." TRUE)
 
 option(SWIFT_INCLUDE_DOCS
     "Create targets for building docs."
-    TRUE)
+    FALSE)
 
 #
 # Miscellaneous User-configurable options.
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 292c69f3f1..de1ad8868a 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -1,10 +1,10 @@
 add_subdirectory(tools)
 
-find_program(SPHINX_EXECUTABLE
-  NAMES sphinx-build
-  HINTS $ENV{SPHINX_DIR}
-  PATH_SUFFIXES bin
-  DOC "Sphinx documentation generator")
+#find_program(SPHINX_EXECUTABLE
+#  NAMES sphinx-build
+#  HINTS $ENV{SPHINX_DIR}
+#  PATH_SUFFIXES bin
+#  DOC "Sphinx documentation generator")
 
 SET(SWIFT_SPHINX_PAPER_SIZE "letter"
   CACHE STRING "Paper size for generated documentation")
  1. Once it looks like it has compiled successfully, try running the test suite:
    utils/build-script -R -t

And you should get all tests passed. You now have a build swift compiler in somewhere like "build/Ninja-ReleaseAssert/swift-macosx-x86_64". Try writing a simple program and see if it works!

I hope this helps someone else one day. And thanks again to @jrose!

Glad it worked out! A tweak to steps 6 and 8: build-script will honor (and cache) the Xcode currently chosen by xcode-select, so you can temporarily switch that to point to your Xcode 8.3, build the 3.1 compiler, then go back to your normal Xcode.

Setting the DEVELOPER_DIR environment variable also seems to work.

(export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer \
 && time ./swift/utils/build-script --clean --reconfigure)
2 Likes

Awesome tip!