Skip to content

Commit 4a58104

Browse files
committed
Merge branch 'main' into kabir/wasm-plugins
2 parents fbc9e5c + 6c459f2 commit 4a58104

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Sources/SwiftCompilerPlugin/CompilerPlugin.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ extension CompilerPlugin {
9696
}
9797
}
9898

99-
let pluginPath = CommandLine.arguments.first ?? "<unknown>"
99+
let pluginPath: String
100+
if CommandLine.argc > 0, let cPluginPath = CommandLine.unsafeArgv[0] {
101+
pluginPath = String(cString: cPluginPath)
102+
} else {
103+
pluginPath = "<unknown>"
104+
}
100105
throw CompilerPluginError(
101106
message:
102107
"macro implementation type '\(moduleName).\(typeName)' could not be found in executable plugin '\(pluginPath)'"

0 commit comments

Comments
 (0)