Skip to content

Commit 7ea32be

Browse files
committed
Move from @_implementationOnly to internal imports
Fixes up several Swift 6 warnings now that `@_implementationOnly` has been deprecated in favour of `internal`.
1 parent eae9cdd commit 7ea32be

27 files changed

+48
-52
lines changed

Fixtures/Resources/FoundationlessClient/UtilsWithFoundationPkg/Package.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import PackageDescription
33

44
// This package acts as a regression test for the FoundationlessPackages to
55
// assert that Swift targets with resources are not affected by using
6-
// `@_implementationOnly import Foundation` in the generated resource accessor.
6+
// `internal import Foundation` in the generated resource accessor.
77
let package = Package(
88
name: "UtilsWithFoundationPkg",
99
targets: [

Sources/Basics/Concurrency/AsyncProcess.swift

+2-5
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ import Android
2020

2121
#if os(Linux)
2222
#if USE_IMPL_ONLY_IMPORTS
23-
@_implementationOnly
24-
import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
25-
26-
@_implementationOnly
27-
import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
23+
internal import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
24+
internal import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np
2825
#else
2926
private import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np_supported
3027
private import func TSCclibc.SPM_posix_spawn_file_actions_addchdir_np

Sources/Basics/SQLite.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ import Foundation
1414

1515
#if SWIFT_PACKAGE && (os(Windows) || os(Android))
1616
#if USE_IMPL_ONLY_IMPORTS
17-
@_implementationOnly import SwiftToolchainCSQLite
17+
internal import SwiftToolchainCSQLite
1818
#else
1919
import SwiftToolchainCSQLite
2020
#endif
2121
#else
2222
#if USE_IMPL_ONLY_IMPORTS
23-
@_implementationOnly import SPMSQLite3
23+
internal import SPMSQLite3
2424
#else
2525
import SPMSQLite3
2626
#endif

Sources/Basics/SwiftVersion.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if USE_IMPL_ONLY_IMPORTS
14-
@_implementationOnly import TSCclibc
14+
internal import TSCclibc
1515
#else
1616
private import TSCclibc
1717
#endif

Sources/Build/BuildDescription/SwiftModuleBuildDescription.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import PackageModel
2323
import SPMBuildCore
2424

2525
#if USE_IMPL_ONLY_IMPORTS
26-
@_implementationOnly import DriverSupport
26+
internal import DriverSupport
2727
#else
2828
import DriverSupport
2929
#endif

Sources/Build/BuildManifest/LLBuildManifestBuilder+Swift.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import func TSCBasic.topologicalSort
2323
import struct Basics.Environment
2424

2525
#if USE_IMPL_ONLY_IMPORTS
26-
@_implementationOnly import class DriverSupport.SPMSwiftDriverExecutor
27-
@_implementationOnly import SwiftDriver
26+
internal import class DriverSupport.SPMSwiftDriverExecutor
27+
internal import SwiftDriver
2828
#else
2929
import class DriverSupport.SPMSwiftDriverExecutor
3030
import SwiftDriver

Sources/Build/BuildManifest/LLBuildManifestBuilder.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import PackageModel
1717
import SPMBuildCore
1818

1919
#if USE_IMPL_ONLY_IMPORTS
20-
@_implementationOnly import SwiftDriver
20+
internal import SwiftDriver
2121
#else
2222
import SwiftDriver
2323
#endif

Sources/Build/BuildOperation.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import struct TSCBasic.RegEx
2929
import enum TSCUtility.Diagnostics
3030

3131
#if USE_IMPL_ONLY_IMPORTS
32-
@_implementationOnly import DriverSupport
33-
@_implementationOnly import SwiftDriver
32+
internal import DriverSupport
33+
internal import SwiftDriver
3434
#else
3535
import DriverSupport
3636
import SwiftDriver

Sources/Build/BuildPlan/BuildPlan.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import PackageModel
2121
import SPMBuildCore
2222

2323
#if USE_IMPL_ONLY_IMPORTS
24-
@_implementationOnly import SwiftDriver
24+
internal import SwiftDriver
2525
#else
2626
import SwiftDriver
2727
#endif

Sources/Commands/Utilities/SymbolGraphExtract.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import PackageModel
1717
import SPMBuildCore
1818

1919
#if USE_IMPL_ONLY_IMPORTS
20-
@_implementationOnly import DriverSupport
20+
internal import DriverSupport
2121
#else
2222
import DriverSupport
2323
#endif

Sources/CoreCommands/SwiftCommandState.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ import SPMBuildCore
2424
import Workspace
2525

2626
#if USE_IMPL_ONLY_IMPORTS
27-
@_implementationOnly
2827
@_spi(SwiftPMInternal)
29-
import DriverSupport
28+
internal import DriverSupport
3029
#else
3130
@_spi(SwiftPMInternal)
3231
import DriverSupport

Sources/PackageCollectionsSigning/CertificatePolicy.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import Foundation
1616
import Basics
1717

1818
#if USE_IMPL_ONLY_IMPORTS
19-
@_implementationOnly import SwiftASN1
20-
@_implementationOnly import X509
19+
internal import SwiftASN1
20+
internal import X509
2121
#else
2222
import SwiftASN1
2323
import X509

Sources/PackageCollectionsSigning/PackageCollectionSigning.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import Foundation
1717
import PackageCollectionsModel
1818

1919
#if USE_IMPL_ONLY_IMPORTS
20-
@_implementationOnly import _CryptoExtras
21-
@_implementationOnly import Crypto
22-
@_implementationOnly import X509
20+
internal import _CryptoExtras
21+
internal import Crypto
22+
internal import X509
2323
#else
2424
import _CryptoExtras
2525
import Crypto

Sources/PackageCollectionsSigning/Signature.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
import Foundation
2727

2828
#if USE_IMPL_ONLY_IMPORTS
29-
@_implementationOnly import _CryptoExtras
30-
@_implementationOnly import Crypto
31-
@_implementationOnly import X509
29+
internal import _CryptoExtras
30+
internal import Crypto
31+
internal import X509
3232
#else
3333
import _CryptoExtras
3434
import Crypto

Sources/PackageCollectionsSigning/X509Extensions.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if USE_IMPL_ONLY_IMPORTS
14-
@_implementationOnly import SwiftASN1
15-
@_implementationOnly import X509
14+
internal import SwiftASN1
15+
internal import X509
1616
#else
1717
import SwiftASN1
1818
import X509

Sources/PackageDescription/PackageDescription.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if canImport(ucrt) && canImport(WinSDK)
14-
@_implementationOnly import ucrt
15-
@_implementationOnly import struct WinSDK.HANDLE
14+
internal import ucrt
15+
internal import struct WinSDK.HANDLE
1616
#endif
17-
@_implementationOnly import Foundation
17+
internal import Foundation
1818

1919
/// The configuration of a Swift package.
2020
///

Sources/PackageDescription/PackageDescriptionSerialization.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if USE_IMPL_ONLY_IMPORTS
14-
@_implementationOnly import Foundation
14+
internal import Foundation
1515
#else
1616
import Foundation
1717
#endif

Sources/PackageDescription/Target.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
@_implementationOnly import Foundation
13+
internal import Foundation
1414

1515
/// The basic building block of a Swift package.
1616
///

Sources/PackageLoading/ContextModel.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if USE_IMPL_ONLY_IMPORTS
14-
@_implementationOnly import Foundation
14+
internal import Foundation
1515
#else
1616
import Foundation
1717
#endif

Sources/PackagePlugin/Plugin.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313
import Foundation
1414
#if os(Windows)
15-
@_implementationOnly import ucrt
16-
@_implementationOnly import WinSDK
15+
internal import ucrt
16+
internal import WinSDK
1717

1818
internal func dup(_ fd: CInt) -> CInt {
1919
return _dup(fd)

Sources/PackageRegistryCommand/PackageRegistryCommand+Publish.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import PackageSigning
2121
import Workspace
2222

2323
#if USE_IMPL_ONLY_IMPORTS
24-
@_implementationOnly import X509 // FIXME: need this import or else SwiftSigningIdentity initializer fails
24+
internal import X509 // FIXME: need this import or else SwiftSigningIdentity initializer fails
2525
#else
2626
import X509
2727
#endif

Sources/PackageSigning/CertificateStores.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if USE_IMPL_ONLY_IMPORTS
14-
@_implementationOnly import X509
14+
internal import X509
1515
#else
1616
import X509
1717
#endif

Sources/PackageSigning/SignatureProvider.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ import struct Foundation.Date
1515

1616
#if USE_IMPL_ONLY_IMPORTS
1717
#if canImport(Security)
18-
@_implementationOnly import Security
18+
internal import Security
1919
#endif
2020

21-
@_implementationOnly import SwiftASN1
22-
@_implementationOnly @_spi(CMS) import X509
21+
internal import SwiftASN1
22+
@_spi(CMS) internal import X509
2323
#else
2424
#if canImport(Security)
2525
import Security

Sources/PackageSigning/SigningEntity/SigningEntity.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#if USE_IMPL_ONLY_IMPORTS
14-
@_implementationOnly import SwiftASN1
15-
@_implementationOnly import X509
14+
internal import SwiftASN1
15+
internal import X509
1616
#else
1717
import SwiftASN1
1818
import X509

Sources/PackageSigning/SigningIdentity.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212

1313
#if USE_IMPL_ONLY_IMPORTS
1414
#if canImport(Security)
15-
@_implementationOnly import Security
15+
internal import Security
1616
#endif
1717

18-
@_implementationOnly import Crypto
19-
@_implementationOnly import X509
18+
internal import Crypto
19+
internal import X509
2020
#else
2121
#if canImport(Security)
2222
import Security

Sources/PackageSigning/VerifierPolicies.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ import struct Foundation.URL
1818
import Basics
1919

2020
#if USE_IMPL_ONLY_IMPORTS
21-
@_implementationOnly import SwiftASN1
22-
@_implementationOnly @_spi(DisableValidityCheck) import X509
21+
internal import SwiftASN1
22+
@_spi(DisableValidityCheck) internal import X509
2323
#else
2424
import SwiftASN1
2525
@_spi(DisableValidityCheck) import X509

Sources/PackageSigning/X509Extensions.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import struct Foundation.Data
1414

1515
#if USE_IMPL_ONLY_IMPORTS
1616
#if canImport(Security)
17-
@_implementationOnly import Security
17+
internal import Security
1818
#endif
1919

20-
@_implementationOnly import SwiftASN1
21-
@_implementationOnly import X509
20+
internal import SwiftASN1
21+
internal import X509
2222
#else
2323
#if canImport(Security)
2424
import Security

0 commit comments

Comments
 (0)