Skip to content

Commit 61614ac

Browse files
committed
Limit scope of plugin runtime path workaround to non-macOS
1 parent 749c8cb commit 61614ac

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Sources/SPMBuildCore/Plugins/DefaultPluginScriptRunner.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,12 +466,19 @@ public struct DefaultPluginScriptRunner: PluginScriptRunner, Cancellable {
466466

467467
var env = Environment.current
468468

469+
// FIXME: This is largely a workaround for improper rpath setup on Linux. It should be
470+
// removed once the Swift Build backend switches to use swiftc as the linker driver
471+
// for targets with Swift sources. For now, limit the scope to non-macOS, so that
472+
// plugins do not inadvertently use the toolchain stdlib instead of the OS stdlib
473+
// when built with a Swift.org toolchain.
474+
#if !os(macOS)
469475
// Update the environment for any runtime library paths that tools compiled
470476
// for the command plugin might require after they have been built.
471477
let runtimeLibPaths = self.toolchain.runtimeLibraryPaths
472478
for libPath in runtimeLibPaths {
473479
env.appendPath(key: .libraryPath, value: libPath.pathString)
474480
}
481+
#endif
475482

476483
#if os(Windows)
477484
let pluginLibraryPath = self.toolchain.swiftPMLibrariesLocation.pluginLibraryPath.pathString

0 commit comments

Comments
 (0)