Skip to content

Commit 5c7db58

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`).
1 parent cf540dd commit 5c7db58

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
@@ -157,16 +157,6 @@ enum TestingSupport {
157157
if let location = toolchain.xctestPath {
158158
env.prependPath("Path", value: location.pathString)
159159
}
160-
#elseif os(Linux)
161-
var libraryPaths = ["/usr/lib/swift/linux"]
162-
if let path = env["PATH"], let firstPathEntry = path.components(separatedBy: ":").first {
163-
libraryPaths.append("\(firstPathEntry)/../lib/swift/linux")
164-
}
165-
if let originalLibraryPaths = env["LD_LIBRARY_PATH"] {
166-
libraryPaths.append(originalLibraryPaths)
167-
}
168-
// Pass this explicitly on Linux because XCTest started requiring it, rdar://103054033
169-
env["LD_LIBRARY_PATH"] = libraryPaths.joined(separator: ":")
170160
#endif
171161
return env
172162
#else

0 commit comments

Comments
 (0)