Building Swift on Mac fails (macOS 10.14.3 (18D109)

Hi Swift Team,

I was trying to build the latest master Swift project and I am getting an error. I am not able to understand how to fix it.

latest commit id
commit fd41f624bb388e198f115415e99cecc8e9e5540d (HEAD -> master, origin/master, origin/HEAD)

     /Users/rahul.ranjan/Projects/swift-source/swift/stdlib/public/Darwin/SceneKit/SceneKit.swift.gyb:184:10: error: argument labels '(__vertices:, count:)' do not match any available overloads
         self.init(__vertices: vertices, count: vertices.count)
              ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     /Users/rahul.ranjan/Projects/swift-source/swift/stdlib/public/Darwin/SceneKit/SceneKit.swift.gyb:184:10: note: overloads for 'SCNGeometrySource.init' exist with these partially matching parameter lists: (normals: UnsafePointer<SCNVector3>, count: Int), (textureCoordinates: UnsafePointer<CGPoint>, count: Int), (vertices: UnsafePointer<SCNVector3>, count: Int)
       self.init(__vertices: vertices, count: vertices.count)
              ^
     /Users/rahul.ranjan/Projects/swift-source/swift/stdlib/public/Darwin/SceneKit/SceneKit.swift.gyb:188:10: error: argument labels '(__normals:, count:)' do not match any available overloads
        self.init(__normals: normals, count: normals.count)
              ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     /Users/rahul.ranjan/Projects/swift-source/swift/stdlib/public/Darwin/SceneKit/SceneKit.swift.gyb:188:10: note: overloads for 'SCNGeometrySource.init' exist with these partially matching parameter lists: (normals: UnsafePointer<SCNVector3>, count: Int), (textureCoordinates: UnsafePointer<CGPoint>, count: Int), (vertices: UnsafePointer<SCNVector3>, count: Int)
         self.init(__normals: normals, count: normals.count)
              ^
     /Users/rahul.ranjan/Projects/swift-source/swift/stdlib/public/Darwin/SceneKit/SceneKit.swift.gyb:192:14: error: incorrect argument label in call (have '__textureCoordinates:count:', expected 'textureCoordinates:count:')
    self.init(__textureCoordinates: textureCoordinates, count: textureCoordinates.count)
             ^~~~~~~~~~~~~~~~~~~~~
              textureCoordinates
[1094/1671][ 65%][1729.375s] Compiling /Users/rahul.ranja...swift-macosx-x86_64/stdlib/public/core/OSX/x86_64/Swift.o
ninja: build stopped: subcommand failed.
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

I tried to built it using Xcode also and I get the error in same file.

The following build commands failed:
	PhaseScriptExecution CMake\ Rules /Users/rahul.ranjan/Projects/swift-source/build/Xcode-DebugAssert/swift-macosx-x86_64/stdlib/public/Darwin/SceneKit/Swift.build/Debug/stdlib-public-Darwin-SceneKit-OSX-x86_64-SceneKit.o.build/Script-75DED96B2F134A5FB61053B9.sh
(1 failure)
utils/build-script: fatal error: command terminated with a non-zero exit status 65, aborting

Make sure you're building against Xcode 10.2. Swift defaults to building against whichever Xcode is found by xcode-select -p, but it'll also remember your choice once you've started building, so if it picked the wrong one you may need to delete the Swift build directory (or just the CMakeCache.txt file in the Swift build directory), update which Xcode is used by your command line tools (sudo xcode-select -s), and try again.

Thanks a lot @jrose for the reply. I haven't upgraded to Xcode 10.2 yet but will do it today and retry.

Just for curiosity: does building using ninja will also require this update? I thought both build system are independent of each other.

The build system should be fine, but some of the runtime and standard library content, and especially the SDK overlays in the stdlib/public/Darwin/ directory, are only set up to be built against the latest available SDKs. (In some cases it's because they include features that depend on those latest SDKs.)

Terms of Service

Privacy Policy

Cookie Policy