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 -swift-version to default to 6 for swift-tools-version 6 #7469

Merged
merged 1 commit into from
May 10, 2024

Conversation

bnbarham
Copy link
Contributor

@bnbarham bnbarham commented Apr 18, 2024

We missed updating this when adding 6.0. The change itself is extremely
simple, with the bulk being updates to our tests so they don't fail on
old compiler versions (where language version "6" is unknown).

Also removes disabling the concurrency and string processing imports
from manifest loading, as this was causing the package global to not
be main actor isolated by default and thus error in Swift 6. They seemed
to have been disabled to avoid erroring in SDKs that didn't have them,
but that is definitely not an issue any longer.

@bnbarham bnbarham requested a review from xedin April 18, 2024 04:18
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 18, 2024 08:23
@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov
Copy link
Contributor

We need to update PackageDescription to make it compatible with Swift 6:

/home/build-user/swiftpm/Sources/PackageDescription/SupportedPlatforms.swift:55:23: error: static property 'linux' is not concurrency-safe because non-'Sendable' type 'Platform' may have shared mutable state
 53 | 
 54 |     /// The Linux platform.
 55 |     public static let linux: Platform = Platform(name: "linux")
    |                       |- error: static property 'linux' is not concurrency-safe because non-'Sendable' type 'Platform' may have shared mutable state
    |                       `- note: isolate 'linux' to a global actor, or conform 'Platform' to 'Sendable'
 56 | 
 57 |     /// The Windows platform.

@xedin
Copy link
Contributor

xedin commented Apr 18, 2024

@swift-ci please test

@MaxDesiatov
Copy link
Contributor

@swift-ci test

1 similar comment
@MaxDesiatov
Copy link
Contributor

@swift-ci test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch 2 times, most recently from d0a0efc to f5ee182 Compare April 19, 2024 21:10
@bnbarham
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov added build system Changes to interactions with build systems test suite improvements to SwiftPM test suite dependencies Changes to dependencies and relevant checks labels Apr 23, 2024
@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from f5ee182 to 0a4d57a Compare April 26, 2024 20:23
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 0a4d57a to 417bfc8 Compare April 26, 2024 20:45
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch 2 times, most recently from 458abfd to 92b5601 Compare April 27, 2024 00:11
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 92b5601 to 29ab4d5 Compare April 27, 2024 01:30
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 29ab4d5 to 429dc36 Compare April 27, 2024 01:41
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 47d63c2 to 9f7c5c7 Compare May 1, 2024 22:58
@bnbarham
Copy link
Contributor Author

bnbarham commented May 1, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch 2 times, most recently from be8cb20 to a0aeb79 Compare May 3, 2024 23:39
@bnbarham
Copy link
Contributor Author

bnbarham commented May 3, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from a0aeb79 to 608d216 Compare May 4, 2024 02:14
@bnbarham
Copy link
Contributor Author

bnbarham commented May 4, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 608d216 to 6f4953c Compare May 6, 2024 16:51
@bnbarham
Copy link
Contributor Author

bnbarham commented May 6, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 6f4953c to 33bb021 Compare May 6, 2024 17:24
@bnbarham
Copy link
Contributor Author

bnbarham commented May 6, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 33bb021 to 099871f Compare May 7, 2024 00:53
@bnbarham
Copy link
Contributor Author

bnbarham commented May 7, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 099871f to 3c3dab0 Compare May 7, 2024 01:37
@bnbarham
Copy link
Contributor Author

bnbarham commented May 7, 2024

@swift-ci please test

@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from 3c3dab0 to e834159 Compare May 7, 2024 03:08
@bnbarham
Copy link
Contributor Author

bnbarham commented May 7, 2024

@swift-ci please test

@bnbarham
Copy link
Contributor Author

bnbarham commented May 7, 2024

@swift-ci please test Windows platform

@@ -34,5 +34,6 @@ let package = Package(
"MyPlugin2",
]
),
]
],
swiftLanguageVersions: [.v5]
Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense!

We missed updating this when adding 6.0. The change itself is extremely
simple, with the bulk being updates to our tests so they don't fail on
old compiler versions (where language version "6" is unknown).

Also removes disabling the concurrency and string processing imports
from manifest loading, as this was causing the `package` global to not
be main actor isolated by default and thus error in Swift 6. They seemed
to have been disabled to avoid erroring in SDKs that didn't have them,
but that is definitely not an issue any longer.
@bnbarham bnbarham force-pushed the 6-when-tools-version-6 branch from e834159 to de3f697 Compare May 8, 2024 04:00
@bnbarham
Copy link
Contributor Author

bnbarham commented May 8, 2024

@swift-ci please test

@bnbarham
Copy link
Contributor Author

bnbarham commented May 8, 2024

@swift-ci please test Windows platform

@bnbarham
Copy link
Contributor Author

bnbarham commented May 8, 2024

@swift-ci please test Linux platform

@bnbarham bnbarham merged commit 213844c into swiftlang:main May 10, 2024
5 checks passed
@bnbarham bnbarham deleted the 6-when-tools-version-6 branch May 10, 2024 20:46
shahmishal pushed a commit that referenced this pull request May 18, 2024
…#7531)

**Explanation**: Changes packages to default to swift version 6 when
`swift-tools-version` is set `>= 6.0`. Without this change, all packages
will be swift version 5 unless otherwise specified via
`swiftLanguageVersions`. Packages default to `swift-tools-version: 6.0`
with `swift package init`. Users can opt-out via specifying
`swiftLanguageVersions: [.v5]`.
**Scope**: New packages/those updated to 6.0.
**Risk**: Medium. There's inherent risk due to the language mode bump.
The change also removes disabling implicit imports for concurrency and
string processing in manifest files, which hasn't been widely tested
outside of ...
**Testing**: New regression tests. Source compatibility suite run.
**Original PR**:
#7469
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build system Changes to interactions with build systems dependencies Changes to dependencies and relevant checks test suite improvements to SwiftPM test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants