Use llbuild.framework bundled with the internal toolchain

^KT-61369
This commit is contained in:
Timofey Solonin
2023-09-12 11:12:20 +02:00
committed by Space Team
parent fd2954a8d3
commit 9e7d9f3b53
3 changed files with 19 additions and 8 deletions
@@ -100,16 +100,20 @@ open class SwiftBenchmarkingPlugin : BenchmarkingPlugin() {
fun Array<String>.runCommand(
workingDir: File = File("."),
timeoutAmount: Long = 60,
timeoutUnit: TimeUnit = TimeUnit.SECONDS
timeoutUnit: TimeUnit = TimeUnit.SECONDS,
env: Map<String, String>,
): String {
return try {
ProcessBuilder(*this)
val processBuilder = ProcessBuilder(*this)
.directory(workingDir)
.redirectOutput(ProcessBuilder.Redirect.PIPE)
.redirectError(ProcessBuilder.Redirect.PIPE)
.start().apply {
waitFor(timeoutAmount, timeoutUnit)
}.inputStream.bufferedReader().readText()
env.forEach { key, value ->
processBuilder.environment().set(key, value)
}
processBuilder.start().apply {
waitFor(timeoutAmount, timeoutUnit)
}.inputStream.bufferedReader().readText()
} catch (e: Exception) {
println("Couldn't run command ${this.joinToString(" ")}")
println(e.stackTrace.joinToString("\n"))
@@ -134,7 +138,10 @@ open class SwiftBenchmarkingPlugin : BenchmarkingPlugin() {
val out = mutableListOf<String>().apply {
add(compiler)
addAll(args)
}.toTypedArray().runCommand(timeoutAmount = 240)
}.toTypedArray().runCommand(
timeoutAmount = 240,
env = mapOf("DYLD_FALLBACK_FRAMEWORK_PATH" to configs.absoluteTargetToolchain + "/ExtraFrameworks"),
)
println(
"""