Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround an issue regarding libXCTest.so #5952

Merged
merged 1 commit into from
Dec 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Sources/Commands/Utilities/TestingSupport.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,16 @@ 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