Skip to content

Commit 10d4009

Browse files
authored
Rename the SwiftPM entry point. (#141)
This PR renames the SwiftPM entry point function such that it does not need to be SPI. By marking it SPI, we unintentionally made it very difficult to use with a toolchain that does not include private module information. The PR continues to export the old symbol name as used by SwiftPM; once we've updated SwiftPM to match, we will remove the old function.
1 parent 2edf710 commit 10d4009

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

Sources/Testing/Running/EntryPoint.swift

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ private import TestingInternals
2020
///
2121
/// - Warning: This function is used by Swift Package Manager. Do not call it
2222
/// directly.
23-
@_spi(SwiftPackageManagerSupport)
24-
@_disfavoredOverload
25-
public func swiftPMEntryPoint() async -> CInt {
23+
@_disfavoredOverload public func __swiftPMEntryPoint() async -> CInt {
2624
@Locked var exitCode = EXIT_SUCCESS
2725

2826
do {
@@ -68,10 +66,21 @@ public func swiftPMEntryPoint() async -> CInt {
6866
///
6967
/// - Warning: This function is used by Swift Package Manager. Do not call it
7068
/// directly.
69+
public func __swiftPMEntryPoint() async -> Never {
70+
let exitCode: CInt = await __swiftPMEntryPoint()
71+
exit(exitCode)
72+
}
73+
74+
/// Call `__swiftPMEntryPoint()`.
75+
///
76+
/// This function is an old alias of `__swiftPMEntryPoint()`. It will be removed
77+
/// in the near future.
78+
///
79+
/// - Warning: This function is used by Swift Package Manager. Do not call it
80+
/// directly.
7181
@_spi(SwiftPackageManagerSupport)
7282
public func swiftPMEntryPoint() async -> Never {
73-
let exitCode: CInt = await swiftPMEntryPoint()
74-
exit(exitCode)
83+
await __swiftPMEntryPoint()
7584
}
7685

7786
// MARK: -

0 commit comments

Comments
 (0)