Skip to content

Commit

Permalink
Remove extra paths added to LD_LIBRARY_PATH on Linux when running tests
Browse files Browse the repository at this point in the history
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`).
  • Loading branch information
bnbarham committed Jul 8, 2023
1 parent cf540dd commit 5c7db58
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions Sources/Commands/Utilities/TestingSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,6 @@ enum TestingSupport {
if let location = toolchain.xctestPath {
env.prependPath("Path", value: location.pathString)
}
#elseif os(Linux)
var libraryPaths = ["/usr/lib/swift/linux"]
if let path = env["PATH"], let firstPathEntry = path.components(separatedBy: ":").first {
libraryPaths.append("\(firstPathEntry)/../lib/swift/linux")
}
if let originalLibraryPaths = env["LD_LIBRARY_PATH"] {
libraryPaths.append(originalLibraryPaths)
}
// Pass this explicitly on Linux because XCTest started requiring it, rdar://103054033
env["LD_LIBRARY_PATH"] = libraryPaths.joined(separator: ":")
#endif
return env
#else
Expand Down

0 comments on commit 5c7db58

Please sign in to comment.