Remove implicit availability of Foundation from future manifest versions#5874
Conversation
| @@ -11,7 +11,6 @@ | |||
| //===----------------------------------------------------------------------===// | |||
|
|
|||
| import Foundation | |||
| import PackageModel | |||
There was a problem hiding this comment.
Since ContextModel is part of PackageLoading and PackageDescription via a symlink, we need to import Foundation implementation-only in both modules. This is incompatible with IdentityResolver since it uses Foundation.URL as part of its public interface. To resolve this, I moved IdentityResolver into PackageModel here.
|
@swift-ci please smoke test |
Interesting... |
|
Should a note about this be added to |
+1 |
8737493 to
c1d350a
Compare
|
@swift-ci please smoke test |
Not entirely sure why I am not seeing these locally 🤔 |
c1d350a to
228fd6a
Compare
|
@swift-ci please smoke test |
228fd6a to
202c4db
Compare
…sions This changes all imports of `Foundation` in the `PackageDescription` module to be implementation-only, making it so that it needs to be explicitly imported if being used. To avoid breaking existing packages, we inject an explicit import into manifests with tools-version 5.7 or earlier. In the next tools-version, `Foundation` will no longer be implicitly available. rdar://92879696
202c4db to
c810bd7
Compare
|
@swift-ci please smoke test |
|
@swift-ci please test package compatibility |
Reverts 1998284 / swiftlang#3526 Related to SR-14718 (swiftlang#4416). Since swiftlang#3526 was merged, swiftlang#5874 tried to apply the original idea of using `@_implementationOnly Foundation` in PackageDescription/Plugin to avoid leaking `Foundation` into the manifests.
This changes all imports of
Foundationin thePackageDescriptionmodule to be implementation-only, making it so that it needs to be explicitly imported if being used. To avoid breaking existing packages, we inject an explicit import into manifests with tools-version 5.7 or earlier. In the next tools-version,Foundationwill no longer be implicitly available.rdar://92879696