# Swift compile error

**URL:** <https://forums.swift.org/t/swift-compile-error/21661>\
**Category:** Standard Library\
**Tags:** gsoc-2019\
**Created:** [March 16, 2019, 2:29am UTC](https://forums.swift.org/t/swift-compile-error/21661 "2019-03-16T02:29:55Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gumichocopengin8](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gumichocopengin8/32/6853_2.png) [@Gumichocopengin8](https://forums.swift.org/u/Gumichocopengin8)\
**Post date:** [March 16, 2019, 2:29am UTC](https://forums.swift.org/t/swift-compile-error/21661/1 "2019-03-16T02:29:55Z")

</div>

> /swift-source/swift/stdlib/public/Darwin/Foundation/UUID.swift:77:16: warning: 'Hashable.hashValue' is deprecated as a protocol requirement; conform type 'UUID' to 'Hashable' by implementing 'hash(into:)' instead  
> public var hashValue: Int {  
> ^  
> [803/1383][58%][2086.641s] Compiling .../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

When I run `utils/build-script --release-debuginfo`, I got this error.  
I tried [[SR-1805] Swift compile instructions incomplete or incorrect · Issue #44414 · apple/swift · GitHub](https://bugs.swift.org/browse/SR-1805), but didn't work.

How can I compile it?  
Thank you.

---

<div class="post-metadata">

**Author:** ![lorentey](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lorentey/32/1299_2.png) [@lorentey](https://forums.swift.org/u/lorentey)\
**Post date:** [March 16, 2019, 2:47am UTC](https://forums.swift.org/t/swift-compile-error/21661/2 "2019-03-16T02:47:59Z")

</div>

You got an error while compiling the stdlib, which means you got quite far -- you're almost there! The build-script invocation you used is fine; it should work as is.

The warning you quoted is unrelated to the actual error; to help us find the cause, please look for a line that includes `error:`, and paste that in instead.

---

<div class="post-metadata">

**Author:** ![Gumichocopengin8](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gumichocopengin8/32/6853_2.png) [@Gumichocopengin8](https://forums.swift.org/u/Gumichocopengin8)\
**Post date:** [March 16, 2019, 3:06am UTC](https://forums.swift.org/t/swift-compile-error/21661/3 "2019-03-16T03:06:22Z")

</div>

> 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)  
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
> 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, count: Int), (textureCoordinates: UnsafePointer, count: Int), (vertices: UnsafePointer, count: Int)  
> self.init(\_\_vertices: vertices, count: vertices.count)  
> ^  
> /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)  
> ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
> 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, count: Int), (textureCoordinates: UnsafePointer, count: Int), (vertices: UnsafePointer, count: Int)  
> self.init(\_\_normals: normals, count: normals.count)  
> ^  
> 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  
> [5/564][0%][3.643s] Building CXX obj...tion-macosx-x86\_64.dir/CheckClass.mm.o  
> ninja: build stopped: subcommand failed.  
> utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

These are the errors I got.  
Thank you.

---

<div class="post-metadata">

**Author:** ![lorentey](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lorentey/32/1299_2.png) [@lorentey](https://forums.swift.org/u/lorentey)\
**Post date:** [March 16, 2019, 3:25am UTC](https://forums.swift.org/t/swift-compile-error/21661/4 "2019-03-16T03:25:14Z")

</div>

Great! This looks like a mismatch between the SDK that's in your Xcode vs. the SDK we expect on the master branch.

My guess is that you're using some Xcode version other than the [latest beta release](https://developer.apple.com/xcode/downloads/). Make sure you have 10.2 beta 4 selected as the active Xcode, and retry the build.

You can check which Xcode is active with `xcode-select -p` , and you can change it with `sudo xcode-select -s <path>`. You will probably need to invoke build-script with the `--reconfigure` option to have it pick up the new selection.

Let me know how it goes!

---

<div class="post-metadata">

**Author:** ![Gumichocopengin8](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gumichocopengin8/32/6853_2.png) [@Gumichocopengin8](https://forums.swift.org/u/Gumichocopengin8)\
**Post date:** [March 16, 2019, 10:14pm UTC](https://forums.swift.org/t/swift-compile-error/21661/5 "2019-03-16T22:14:47Z")

</div>

Thank you very much.  
I could fix the issue, but the new error came out.

Terminal

> -- Configuring incomplete, errors occurred!  
> See also "/Users/keita/Desktop/gsoc/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86\_64/CMakeFiles/CMakeOutput.log".  
> See also "/Users/keita/Desktop/gsoc/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86\_64/CMakeFiles/CMakeError.log".  
> FAILED: build.ninja  
> /usr/local/Cellar/cmake/3.13.4/bin/cmake -S/Users/keita/Desktop/gsoc/swift-source/swift -B/Users/keita/Desktop/gsoc/swift-source/build/Ninja-RelWithDebInfoAssert/swift-macosx-x86\_64  
> ninja: error: rebuilding 'build.ninja': subcommand failed  
> utils/build-script: fatal error: command terminated with a non-zero exit status

CMakeError.log.

> Checking whether the ASM compiler is GNU using "--version" did not match "(GNU assembler)|(GCC)|(Free Software Foundation)":  
> Apple LLVM version 10.0.1 (clang-1001.0.46.2)  
> Target: x86\_64-apple-darwin18.2.0  
> Thread model: posix  
> InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin  
> Checking whether the ASM compiler is Clang using "--version" did not match "(clang version)":  
> Apple LLVM version 10.0.1 (clang-1001.0.46.2)  
> Target: x86\_64-apple-darwin18.2.0  
> Thread model: posix  
> InstalledDir: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin  
> **error:** **'futimens' is only available on macOS 10.13 or newer [-Werror,-Wunguarded-availability-new]**  
> if (::futimens(FD, Times))  
> **^ ~~~~~~~~~ **  
> **/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/sys/stat.h:373:9:**  **note:**'futimens' has been marked as being introduced in macOS 10.13 here, but the deployment target is macOS 10.9.0  
> int futimens(int \_\_fd, const struct timespec \_\_times[2]) \_\_API\_AVAILABLE(macosx(10.13), ios(11.0), tvos(11.0), watchos(4.0));  
> **^**  
> **/swift-source/llvm/lib/Support/Unix/Path.inc:644:7:**  **note:** enclose 'futimens' in a \_\_builtin\_available check to silence this warning  
> if (::futimens(FD, Times))  
> **^ ~~~~~~~~~ **  
> 1 error generated.  
> [8/2719][0%][3.485s] Building CXX ob...CMakeFiles/LLVMTableGen.dir/Main.cpp.o  
> ninja: build stopped: subcommand failed.  
> utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting

I am trying to fix the problems now.

Anyways, thank you for fixing the issue.

---

<div class="post-metadata">

**Author:** ![Gumichocopengin8](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gumichocopengin8/32/6853_2.png) [@Gumichocopengin8](https://forums.swift.org/u/Gumichocopengin8)\
**Post date:** [March 17, 2019, 12:44am UTC](https://forums.swift.org/t/swift-compile-error/21661/6 "2019-03-17T00:44:52Z")

</div>

I run `utils/build-script --debug --Xcode` now. It has been running for 3 hours, but it seems it works so far.

I think I better use `utils/build-script --debug --Xcode` than `utils/build-script --debug`.

---

<div class="post-metadata">

**Author:** ![Gumichocopengin8](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gumichocopengin8/32/6853_2.png) [@Gumichocopengin8](https://forums.swift.org/u/Gumichocopengin8)\
**Post date:** [March 17, 2019, 4:45am UTC](https://forums.swift.org/t/swift-compile-error/21661/7 "2019-03-17T04:45:04Z")

</div>

I could build with `utils/build-script --debug --Xcode`.

---

<div class="post-metadata">

**Author:** ![lorentey](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lorentey/32/1299_2.png) [@lorentey](https://forums.swift.org/u/lorentey)\
**Post date:** [March 26, 2019, 7:11pm UTC](https://forums.swift.org/t/swift-compile-error/21661/8 "2019-03-26T19:11:04Z")

</div>

`--debug` will get you a compiler built without optimizations. This is usually not what you want, unless you're actually debugging an issue with the compiler itself. Debug builds of the compiler will be unbearably slow for regular Swift work.

For stdlib work, use `build-script --release-debuginfo` or `--release`.
