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

Update Package.swift to support Swift 5 #1913

Closed
wants to merge 1 commit into from

Conversation

devxoul
Copy link
Contributor

@devxoul devxoul commented Apr 3, 2019

As upgrading to Swift 5, without having platforms the default deployment target is set to the latest version of each OS. It causes a compile-time minimum deployment target error.

  • Add platforms(SE-0236)
  • Add .v5 to swiftLanguageVersions

@devxoul devxoul changed the base branch from master to develop April 3, 2019 15:35
Copy link
Member

@freak4pc freak4pc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should support 4.2 and 5 - I think you need to add both for Swift language versions

@devxoul
Copy link
Contributor Author

devxoul commented Apr 3, 2019

@freak4pc, thanks for review. I've added .v4_2 to swiftLanguageVersions. But for CocoaPods, swift_versions is still in beta (1.7.0) so we shouldn't use it for now. Any suggestion?

@kzaher
Copy link
Member

kzaher commented Apr 3, 2019

I've added .v4_2 to swiftLanguageVersions

Hm, don't see it.

@devxoul
Copy link
Contributor Author

devxoul commented Apr 3, 2019

@kzaher, I forgot to force push the branch 😅

@@ -42,6 +42,9 @@ extension Target {

let package = Package(
name: "RxSwift",
platforms: [
.macOS(.v10_10), .iOS(.v8), .tvOS(.v9), .watchOS(.v3)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure how this works but shouldn't we have Linux as well? Or is that by default?

Copy link
Contributor Author

@devxoul devxoul Apr 4, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought so but I couldn't find the linux platform definition: https://github.com/apple/swift-package-manager/blob/b060e8e46ea1d8ae15c909405bb6ff7e7251a8cb/Sources/PackageDescription4/SupportedPlatforms.swift#L28-L90

There is init() constructor that accepts Platform but it is unavailable since it's internal:

platforms: [
  SupportedPlatform(platform: .linux) // 'init' is inaccessible due to 'internal' protection level
]

@devxoul devxoul force-pushed the spm-swift-5 branch 3 times, most recently from a6d6d8c to bb6160a Compare April 4, 2019 21:03
@devxoul
Copy link
Contributor Author

devxoul commented Apr 4, 2019

Hmm I'm not sure how to configure .travis.yml file 🤔

@kzaher
Copy link
Member

kzaher commented Apr 4, 2019

Hmm I'm not sure how to configure .travis.yml file 🤔

Yeah, that's the tricky one. We would need to make our tests more generic.

@freak4pc I can do that if you want, just don't modify travis for your PR.

@freak4pc
Copy link
Member

freak4pc commented Apr 4, 2019

Sure, no problems. Feel free to make the changes and I’ll amend my PR.

@kzaher
Copy link
Member

kzaher commented Apr 5, 2019

Hi @devxoul ,

I'm not sure how this would work. We need to maintain backwards compatibility. Do we need to use 5.0 in the definition? Isn't // swift-tools-version:4.0 compatible with client in 5.0?

@kzaher
Copy link
Member

kzaher commented Apr 6, 2019

@devxoul We have changed package a bit. Could you please provide some command that is failing for you?
Can you please try the develop branch?

@freak4pc
Copy link
Member

freak4pc commented Apr 6, 2019

Isn't // swift-tools-version:4.0 compatible with client in 5.0?

4.2 should be compatible with the Swift 5 tooling and compiler. I'm not sure 4.0 would be 🤔

@kzaher
Copy link
Member

kzaher commented Apr 6, 2019

I think we need to release 5.0 just for Xcode >= 10.2. This is hopeless.

@freak4pc
Copy link
Member

freak4pc commented Apr 6, 2019

@kzaher I've made some test on citest branch, it looks better when just dropping Xcode 9 while still keeping Swift 4 (hopefully). Crossing fingers.

https://travis-ci.org/ReactiveX/RxSwift/builds/516565086

@devxoul
Copy link
Contributor Author

devxoul commented Apr 6, 2019

It's like SDK version and minimum deployment target. As you can support iOS 9 with the latest iOS SDK 12.2, you can still use Swift 4.2 with Xcode 10.2 (Swift toolchain 5). I don't think it works with Xcode < 10.2 (Swift toolchain 4).

@freak4pc
Copy link
Member

freak4pc commented Apr 6, 2019

How did apps worked without this definition up until now? I'm just wondering if it's worth making such a drastic change for SPM alone.

@kzaher
Copy link
Member

kzaher commented Apr 6, 2019

@devxoul we'll release 5.0 and clean up everything. Otherwise we'll go insane :) At least I will.

@freak4pc
Copy link
Member

freak4pc commented Apr 7, 2019

This was done in #1920

@freak4pc freak4pc closed this Apr 7, 2019
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.

3 participants