swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.72k stars 1.34k forks source link

Fix `InternalImportsByDefault` diagnostics in _AsyncFileSystem #7895

Closed tshortli closed 1 month ago

tshortli commented 1 month ago

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 (https://github.com/swiftlang/swift/pull/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 commented 1 month ago

@swift-ci please test

owenv commented 1 month ago

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

bnbarham commented 1 month ago

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 commented 1 month ago

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 https://github.com/swiftlang/swift/pull/75962 becomes effective in SwiftPM CI.

tshortli commented 1 month ago

@swift-ci please test

tshortli commented 1 month ago

@swift-ci please test Windows