Skip to content

Conversation

Davidde94
Copy link
Contributor

Make Swift 5.2 the minimum requirement, dropping support for Swift 5.0 and 5.1.

Motivation:

Whenever we have problems, Swift 5.0 and 5.1 seem to be the culprits. Dropping support for these very old versions will require less maintenance and free up our time to work on new features.

Modifications:

  • Set the tools version in Package.swift to 5.2
  • Remove CI configurations for 5.0 and 5.1
  • Update the various readmes to reflect that this change will be rolled out in NIO 2.30.0

Result:

Swift 5.2 is the minimum version of Swift required to use NIO.

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

This will need to be coordinated with @tomerd to turn off the relevant builders for SwiftNIO.

@Davidde94
Copy link
Contributor Author

@Lukasa yep! He's in the review list and I'm sending an email

Copy link
Contributor

@glbrntt glbrntt left a comment

Choose a reason for hiding this comment

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

I think a few other things need updating; scripts/build_podspecs.sh and CONTRIBUTING.md.

Also I think we should be able to get rid of the generated tests now and use --enable-test-discovery when it's necessary. Might be easier to do that in a follow up.

@weissi
Copy link
Member

weissi commented May 27, 2021

Also I think we should be able to get rid of the generated tests now and use --enable-test-discovery when it's necessary. Might be easier to do that in a follow up.

Sadly not: https://bugs.swift.org/browse/SR-12008

@Davidde94
Copy link
Contributor Author

@glbrntt we can't get rid of linux tests right now

@Davidde94
Copy link
Contributor Author

Nevermind, Johannes beat me :D

@glbrntt
Copy link
Contributor

glbrntt commented May 27, 2021

Also I think we should be able to get rid of the generated tests now and use --enable-test-discovery when it's necessary. Might be easier to do that in a follow up.

Sadly not: https://bugs.swift.org/browse/SR-12008

euuuughhhhh 😡😡😡

@Davidde94 Davidde94 requested review from Lukasa and glbrntt May 27, 2021 12:12
@adam-fowler
Copy link
Contributor

Is the setting of the Package minimum requirements something that should be coordinated with some of the key serverside swift package owners. I doubt any of them want to restrict what version of SwiftNIO their clients can use. Some obvious packages would be AHC, Soto, MongoSwift and RediStack. I think all the Vapor packages have a minimum requirement of 5.2 already.

@adam-fowler
Copy link
Contributor

Is the setting of the Package minimum requirements something that should be coordinated with some of the key serverside swift package owners. I doubt any of them want to restrict what version of SwiftNIO their clients can use. Some obvious packages would be AHC, Soto, MongoSwift and RediStack. I think all the Vapor packages have a minimum requirement of 5.2 already.

After talking to @fabianfett offline it appears this isn't an issue. If someone is compiling with Swift 5.2 or later they will pick up later versions of SwiftNIO even though a library in the middle says its minimum requirement is Swift 5.1. Unless that library indicates it wants version 2.30 or later of NIO.

@finestructure
Copy link

In case you haven't seen the Twitter thread, here's a list of packages in the Swift Package Index that depend on NIO showing their Swift version compatibility as we compute it: https://www.icloud.com/numbers/049dkCvCOid9P8S0UxtCGE3iA#NIO-dependency-check

(Twitter thread)

Note that of the 101 packages (of 298) that are not 5.2+ compatible quite a few are probably only flagged as incompatible because they use OpenSSL and we don't have it installed on our builders. I.e. there's a good chance the impact is smaller than that.

glbrntt added a commit to glbrntt/SwiftPrometheus that referenced this pull request Jun 1, 2021
Motivation:

- SwiftNIO will soon raise it's minimum supported version of Swift from
  5.0 to 5.2 (see: apple/swift-nio#1860)
- Swift 5.0 and 5.1 users will not be able to use future versions of NIO
  (most likely from version 2.30.0).
- Since Prometheus depends on NIO and NIO is so pervasive in the
  ecosystem it makes sense to follow NIOs lead in terms of supported
  Swift versions.

Modifications:

- Update Package.swift to change the tools version to 5.2
- Use the newer syntax for specifying target dependencies
- Remove Package.resolved since it has little value for libraries
- Update circle.yml to update CI jobs
- Update Swift version badge in README.md
@Davidde94 Davidde94 dismissed glbrntt’s stale review June 18, 2021 15:31

Addressed concerns

Copy link
Member

@fabianfett fabianfett left a comment

Choose a reason for hiding this comment

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

🚀🎉

Copy link
Contributor

@PeterAdams-A PeterAdams-A left a comment

Choose a reason for hiding this comment

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

OK, one comment but I don't have a concrete suggestion that's better.

[https://github.com/apple/swift-nio-transport-services][repo-nio-transport-services] <br> first-class support for macOS, iOS, tvOS, and watchOS | `from: "1.0.0"` | `from: "0.1.0"`
[https://github.com/apple/swift-nio-ssh][repo-nio-ssh] <br> SSH support | `.upToNextMinor(from: "0.2.0")` | _n/a_

NIO 2.29.0 and older support Swift 5.0+.
Copy link
Contributor

Choose a reason for hiding this comment

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

Wondering if there is a better way of representing this. 5.0 would work if they did from: 2.0.0

Copy link
Contributor

Choose a reason for hiding this comment

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

5.0 would work if they did from: anything 2.29.0 and earlier. I think this is probably sufficient.

@Davidde94
Copy link
Contributor Author

@swift-server-bot test this please

@Lukasa Lukasa added the 🆕 semver/minor Adds new public API. label Jun 18, 2021
@yim-lee
Copy link
Member

yim-lee commented Jun 18, 2021

@swift-nio-bot test this please

@Davidde94 Davidde94 merged commit b0effbc into apple:main Jun 18, 2021
@Davidde94 Davidde94 deleted the de/swift-5.2 branch June 18, 2021 20:02
MrLotU added a commit to swift-server/swift-prometheus that referenced this pull request Jul 30, 2021
Motivation:

- SwiftNIO will soon raise it's minimum supported version of Swift from
  5.0 to 5.2 (see: apple/swift-nio#1860)
- Swift 5.0 and 5.1 users will not be able to use future versions of NIO
  (most likely from version 2.30.0).
- Since Prometheus depends on NIO and NIO is so pervasive in the
  ecosystem it makes sense to follow NIOs lead in terms of supported
  Swift versions.

Modifications:

- Update Package.swift to change the tools version to 5.2
- Use the newer syntax for specifying target dependencies
- Remove Package.resolved since it has little value for libraries
- Update circle.yml to update CI jobs
- Update Swift version badge in README.md

Co-authored-by: Jari (LotU) <j.koopman@jarict.nl>
@helje5
Copy link
Contributor

helje5 commented Aug 31, 2021

Whenever we have problems, Swift 5.0 and 5.1 seem to be the culprits.

In what ways?

@helje5
Copy link
Contributor

helje5 commented Aug 31, 2021

A few issues raised in the Slack:

  1. NIO: implement network interface enumeration for Windows #1647 - just affects building Windows w/ <5.2, no other platforms affected. Windows affected neither, just needs to use 5.2 there
  2. Reduce selector wakeups. #1820 - perf only, could use different compile paths for the two
  3. WebSocket Frame Aggregator #1823 - just a test setup affected, can be worked around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🆕 semver/minor Adds new public API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.