File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Plugins/PackageToJS/Sources Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -422,7 +422,10 @@ struct PackagingPlanner {
422422 wasmFilename: String ,
423423 configuration: String ,
424424 triple: String ,
425- selfPath: BuildPath = BuildPath ( absolute: #filePath) ,
425+ // NOTE: We should use `ProcessInfo.processInfo.arguments[0]` instead of `CommandLine.arguments[0]`
426+ // because the latter may not always be the full executable path (e.g. when invoked through PATH lookup).
427+ // https://github.com/swiftlang/swift-foundation/blob/f5143f96d01cdb6d280665de8221b75fc8631d95/Sources/FoundationEssentials/ProcessInfo/ProcessInfo.swift#L47
428+ selfPath: BuildPath = BuildPath ( absolute: ProcessInfo . processInfo. arguments [ 0 ] ) ,
426429 system: any PackagingSystem
427430 ) {
428431 self . options = options
@@ -592,7 +595,7 @@ struct PackagingPlanner {
592595 let bridgeJs = outputDir. appending ( path: " bridge-js.js " )
593596 let bridgeDts = outputDir. appending ( path: " bridge-js.d.ts " )
594597 packageInputs. append (
595- make. addTask ( inputFiles: skeletons, output: bridgeJs) { _, scope in
598+ make. addTask ( inputFiles: skeletons + [ selfPath ] , output: bridgeJs) { _, scope in
596599 var link = BridgeJSLink (
597600 sharedMemory: Self . isSharedMemoryEnabled ( triple: triple)
598601 )
You can’t perform that action at this time.
0 commit comments