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

[SR-11553] support the platforms better (eg. have template not default to "all platforms supported") #4656

Open
weissi opened this issue Oct 1, 2019 · 4 comments

Comments

@weissi
Copy link
Member

weissi commented Oct 1, 2019

Previous ID SR-11553
Radar rdar://problem/55869574
Original Reporter @weissi
Type New Feature
Additional Detail from JIRA
Votes 0
Component/s Package Manager
Labels New Feature
Assignee None
Priority Medium

md5: 1e3224e8cad1bf636a30daa940b7c966

Issue Description:

I would claim that the adoption of that platforms feature in Package.swift has been a bit poor. One of the reasons for that is that if you have a library which specifies platforms all its consumers will need to specify that too, or else they'll get a build error.

There are two things that I think should be improved:

1. if that build error happens, the error message should output exactly what needs to be change in the Package.swift to make it work. Really, it should offer to auto-migrate
2. the default package template (swift package init) should set it to only support the latest versions of all OSes instead of to 'everything in every version'
3. There should be a command similar to swift package tools-version to update the platforms

@weissi
Copy link
Member Author

weissi commented Oct 1, 2019

@swift-ci create

@ankitspd
Copy link
Member

ankitspd commented Oct 1, 2019

I agree that SwiftPM should make it very easy to manipulate the Package.swift file. I did some work a while back on top of SwiftSyntax but it isn't production ready yet. I don't think we should make latest versions of all OSes the default since that could lead new packages to accidentally only support the latest OSes even when they don't need to.

@belkadan
Copy link

belkadan commented Oct 1, 2019

"All platforms supported" is definitely the right default because it allows bringing up new platforms.

@weissi
Copy link
Member Author

weissi commented Oct 1, 2019

@belkadan/@aciidb0mb3r ok, I phrased that badly. I'm actually okay with 'new platforms are supported by default'. What I don't think works super well is not being able to not support a platform and also by default supporting the oldest version Swift supports being the default. I think the default should be the OS versions that correspond to the tools versions. So if you have swift-tools-version:5.1 I think by default it should support macOS 10.15+, if you have swift-tools-version:5.0 it should be macOS 10.14+, etc.
The reason is that lowering the OS version you need to run is much easier than raising it because raising it is probably SemVer major.

That's also Xcode's default, correct? It defaults to SDK/deployment target = newest version on a new project, no?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants