Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make buildable when using SPM in XCode 11 #784

Merged
merged 2 commits into from
Sep 24, 2019
Merged

Make buildable when using SPM in XCode 11 #784

merged 2 commits into from
Sep 24, 2019

Conversation

cheif
Copy link
Contributor

@cheif cheif commented Sep 23, 2019

I tried adding apollo to our project using SPM in XCode 11 and got some build issues.

The first issue was due to the swift version being specified to 4.0 in Package.swift, making XCode trying to build this with the old toolchain, leading to a build error at:

let errorArray = json["errors"] as? [JSONObject] else {

Due to this depending on the nil-coalescing feature in swift 5.0, changing the swift-tools-version in Package.swift fixes this.

When this was fixed I got some build-errors due to Foundation not being imported in two files, so I added this as well.

@apollo-cla
Copy link

@cheif: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Meteor Contributor Agreement here: https://contribute.meteor.com/

@designatednerd
Copy link
Contributor

@cheif I have not seen this error in my usage of the betas - is this on a brand new project or on an existing project?

@humblehacker
Copy link

@designatednerd I'm not the PR author, but I get the reported error on a brand new project.

@cheif
Copy link
Contributor Author

cheif commented Sep 24, 2019

It’s on an existing project for me, I’ve been looking into migrating from CocoaPods to SPM with the arrival of a stable XCode 11.

@designatednerd
Copy link
Contributor

Bizarre! I wonder why this wasn't showing up in any of the betas. However, I don't see how these changes can hurt, so let's do this.

@cheif
Copy link
Contributor Author

cheif commented Sep 25, 2019

Yeah, I agree that it's strange that it didn't show up in the betas, but maybe they were always building with swift 5.1 or something, since even if this could be built with swift 4.0, it wouldn't be possible to link against it from swift 5.1 due to the lack of module stability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants