Skip to content

Commit 81bafa7

Browse files
Merge pull request #387 from swiftwasm/pr-665f268e8e9495673f7f1e476d0ae862c401529a
PackageToJS: Fix missing Extern detection for Swift 6.2+
2 parents 44939d8 + ec6beb4 commit 81bafa7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Plugins/PackageToJS/Sources/PackageToJSPlugin.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ struct PackageToJSPlugin: CommandPlugin {
7474
(
7575
// In case the SwiftPM target using BridgeJS didn't specify `.enableExperimentalFeature("Extern")`
7676
{ build, arguments in
77-
guard
78-
build.logText.contains("@_extern requires '-enable-experimental-feature Extern'")
79-
else {
77+
let possibleMessages: [String] = [
78+
"@_extern requires '-enable-experimental-feature Extern'",
79+
// Swift 6.2 and later quotes attributes in diagnostics
80+
// https://github.com/swiftlang/swift/pull/80593
81+
"'@_extern' requires '-enable-experimental-feature Extern'",
82+
]
83+
guard possibleMessages.contains(where: build.logText.contains) else {
8084
return nil
8185
}
8286
return """

0 commit comments

Comments
 (0)