Skip to content

Fix InternalImportsByDefault diagnostics in _AsyncFileSystem #7895

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

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

tshortli
Copy link
Contributor

@tshortli tshortli commented Aug 20, 2024

Address some InternalImportsByDefault diagnostics in the _AsyncFileSystem which have crept in because the Swift 6 toolchain isn't enforcing .enableExperimentalFeature("InternalImportsByDefault").

Motivation:

Both the StrictConcurrency and InternalImportsByDefault features became "upcoming" features instead of "experimental" features in the Swift 6 compiler. This means that specifying those features with .enableExperimentalFeature() no longer works with newer toolchains, and therefore these settings in SwiftPM's Package.swift have become inactive. I'm making the compiler more lenient, so that -enable-experimental-feature will enable the corresponding upcoming feature if relevant (swiftlang/swift#75962) but in the meantime it appears that some of the code in SwiftPM needs some fixes to continue to be accepted by the compiler with these features on.

Modifications:

Adjusted access level on a number of import statements in files belonging to the _AsyncFileSystem target.

Result:

_AsyncFileSystem builds successfully when InternalImportsByDefault is actually enabled with the Swift 6 toolchain.

@tshortli
Copy link
Contributor Author

@swift-ci please test

@owenv
Copy link
Contributor

owenv commented Aug 20, 2024

There is a possibility the self-hosted jobs may not recognize these features as "upcoming", let's see...

@bnbarham
Copy link
Contributor

Yeah, this isn't going to work because of the self hosted jobs (which are still 5.9). We could wrap them in #if checks but that gets pretty unmanageable fairly quickly 😓. The code changes themselves LGTM though

@tshortli
Copy link
Contributor Author

Ok, sounds like I should just revert all of the Package.swift changes and hope that there won't be any more incompatible changes before swiftlang/swift#75962 becomes effective in SwiftPM CI.

Both the `StrictConcurrency` and `InternalImportsByDefault` features became
"upcoming" features instead of "experimental" features in the Swift 6 compiler.
This means that specifying those features with `.enableExperimentalFeature()`
no longer works with newer toolchains, and therefore these settings in
SwiftPM's Package.swift have become inactive. I'm making the compiler more
lenient, so that `-enable-experimental-feature` will enable the corresponding
upcoming feature if relevant (swiftlang/swift#75962)
but in the meantime it appears that some of the code in SwiftPM needs some
fixes to continue to be accepted by the compiler with these features on.
@tshortli tshortli changed the title Use .enableUpcomingFeature() for StrictConcurrency and InternalImportsByDefault Fix InternalImportsByDefault diagnostics in _AsyncFileSystem Aug 20, 2024
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli tshortli enabled auto-merge (squash) August 20, 2024 03:46
@tshortli
Copy link
Contributor Author

@swift-ci please test Windows

@tshortli tshortli merged commit b198806 into swiftlang:main Aug 20, 2024
5 checks passed
@tshortli tshortli deleted the upcoming-features branch August 20, 2024 14:16
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