Skip to content

Commit 2dbd2ee

Browse files
committed
Remove extra paths added to LD_LIBRARY_PATH on Linux when running tests
These break running tests when there's already a swift on PATH that isn't the swift currently being run. There shouldn't be a need for these as the run path of the compiled binary is already the correct path (ie. the library path of the swift that built it and `$ORIGIN`). (cherry picked from commit 5c7db58) (cherry picked from commit 07952dc)
1 parent 3cc9fae commit 2dbd2ee

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

Sources/Commands/Utilities/TestingSupport.swift

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,6 @@ enum TestingSupport {
141141
if let location = toolchain.xctestPath {
142142
env.prependPath("Path", value: location.pathString)
143143
}
144-
#elseif os(Linux)
145-
var libraryPaths = ["/usr/lib/swift/linux"]
146-
if let path = env["PATH"], let firstPathEntry = path.components(separatedBy: ":").first {
147-
libraryPaths.append("\(firstPathEntry)/../lib/swift/linux")
148-
}
149-
if let originalLibraryPaths = env["LD_LIBRARY_PATH"] {
150-
libraryPaths.append(originalLibraryPaths)
151-
}
152-
// Pass this explicitly on Linux because XCTest started requiring it, rdar://103054033
153-
env["LD_LIBRARY_PATH"] = libraryPaths.joined(separator: ":")
154144
#endif
155145
return env
156146
#else

0 commit comments

Comments
 (0)