Unable to Build swift-corelibs-foundation


(David Dunn) #1

I've pulled down all the latest changes from
https://github.com/apple/swift-corelibs-foundation and currently using the
latest toolchain (Swift Development Snapshot 2017-05-16).
However various errors arise when trying to build.

I get numerous errors that are similar to this:
swift-corelibs-foundation/Foundation/Data.swift:63:41: '>>' is unavailable
'>>' was obsoleted in Swift 4

And this error also occurs:
swift-corelibs-foundation/Foundation/NSArray.swift:375:157: Contextual
closure type '(UnsafeMutableRawPointer, Int) -> Void' expects 2 arguments,
but 1 was used in closure body

I was wondering if anyone knew a way around these errors? Or is there's
something I'm doing wrong.

Thanks.


(Will Stanton) #2

Hello David,

Are you seeing these errors in macOS/Xcode? If so, I think `-swift-version 3` needs to be passed to the swift compiler. Submitted this PR for Mac build issues among others: https://github.com/apple/swift-corelibs-foundation/pull/988

Matt,
I think you’re running into similar issues, but Ted already made a PR for builds done with build-script - I believe that’s why the Linux build works (https://github.com/apple/swift-corelibs-foundation/pull/956). Perhaps you can confirm in verbose mode `ninja -v`, in the swift-corelibs-foundation directory, that `-swift-version 3` is being passed in?

Regards,
Will Stanton

···

On May 18, 2017, at 7:07 AM, David Dunn via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

I've pulled down all the latest changes from https://github.com/apple/swift-corelibs-foundation and currently using the latest toolchain (Swift Development Snapshot 2017-05-16).
However various errors arise when trying to build.

I get numerous errors that are similar to this:
swift-corelibs-foundation/Foundation/Data.swift:63:41: '>>' is unavailable
'>>' was obsoleted in Swift 4

And this error also occurs:
swift-corelibs-foundation/Foundation/NSArray.swift:375:157: Contextual closure type '(UnsafeMutableRawPointer, Int) -> Void' expects 2 arguments, but 1 was used in closure body

I was wondering if anyone knew a way around these errors? Or is there's something I'm doing wrong.

Thanks.


(Matt Rajca) #3

Hello David,

Are you seeing these errors in macOS/Xcode? If so, I think `-swift-version 3` needs to be passed to the swift compiler. Submitted this PR for Mac build issues among others: https://github.com/apple/swift-corelibs-foundation/pull/988

Matt,
I think you’re running into similar issues, but Ted already made a PR for builds done with build-script - I believe that’s why the Linux build works (https://github.com/apple/swift-corelibs-foundation/pull/956). Perhaps you can confirm in verbose mode `ninja -v`, in the swift-corelibs-foundation directory, that `-swift-version 3` is being passed in?

Your pull request fixed the build for me. I'm also on macOS. Thanks,

Matt

···

On May 18, 2017, at 11:50 AM, Will Stanton <willstanton1@yahoo.com> wrote:

Regards,
Will Stanton

On May 18, 2017, at 7:07 AM, David Dunn via swift-corelibs-dev <swift-corelibs-dev@swift.org> wrote:

I've pulled down all the latest changes from https://github.com/apple/swift-corelibs-foundation and currently using the latest toolchain (Swift Development Snapshot 2017-05-16).
However various errors arise when trying to build.

I get numerous errors that are similar to this:
swift-corelibs-foundation/Foundation/Data.swift:63:41: '>>' is unavailable
'>>' was obsoleted in Swift 4

And this error also occurs:
swift-corelibs-foundation/Foundation/NSArray.swift:375:157: Contextual closure type '(UnsafeMutableRawPointer, Int) -> Void' expects 2 arguments, but 1 was used in closure body

I was wondering if anyone knew a way around these errors? Or is there's something I'm doing wrong.

Thanks.