You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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/@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?
Additional Detail from JIRA
md5: 1e3224e8cad1bf636a30daa940b7c966
Issue Description:
I would claim that the adoption of that
platforms
feature inPackage.swift
has been a bit poor. One of the reasons for that is that if you have a library which specifiesplatforms
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-migrate2. 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 platformsThe text was updated successfully, but these errors were encountered: