File tree Expand file tree Collapse file tree 1 file changed +16
-3
lines changed
Plugins/PackageToJS/Sources Expand file tree Collapse file tree 1 file changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -19,8 +19,8 @@ struct PackageToJSPlugin: CommandPlugin {
19
19
// In case user misses the `--swift-sdk` option
20
20
{ build, arguments in
21
21
guard
22
- build. logText. contains (
23
- " ld.gold: --export-if-defined=__main_argc_argv: unknown option " )
22
+ build. logText. contains ( " ld.gold: --export-if-defined=__main_argc_argv: unknown option " ) ||
23
+ build . logText . contains ( " -static-stdlib is no longer supported for Apple platforms " )
24
24
else { return nil }
25
25
let didYouMean =
26
26
[
@@ -53,13 +53,26 @@ struct PackageToJSPlugin: CommandPlugin {
53
53
3. Select a matching SDK version with --swift-sdk option
54
54
"""
55
55
} ) ,
56
+ (
57
+ // In case selected toolchain is a Xcode toolchain, not OSS toolchain
58
+ { build, arguments in
59
+ guard build. logText. contains ( " No available targets are compatible with triple \" wasm32-unknown-wasi \" " ) else {
60
+ return nil
61
+ }
62
+ return """
63
+ The selected toolchain might be an Xcode toolchain, which doesn't support WebAssembly target.
64
+
65
+ Please use a swift.org Open Source toolchain with WebAssembly support.
66
+ See https://book.swiftwasm.org/getting-started/setup.html for more information.
67
+ """
68
+ } ) ,
56
69
]
57
70
private func reportBuildFailure(
58
71
_ build: PackageManager . BuildResult , _ arguments: [ String ]
59
72
) {
60
73
for diagnostic in Self . friendlyBuildDiagnostics {
61
74
if let message = diagnostic ( build, arguments) {
62
- printStderr ( " \n " + message)
75
+ printStderr ( " \n " + " Hint: " + message)
63
76
}
64
77
}
65
78
}
You can’t perform that action at this time.
0 commit comments