Use llbuild.framework bundled with the internal toolchain
^KT-61369
This commit is contained in:
committed by
Space Team
parent
fd2954a8d3
commit
9e7d9f3b53
@@ -120,7 +120,7 @@ data class ProcessOutput(var stdOut: String, var stdErr: String, var exitCode: I
|
||||
* @param args arguments for a process
|
||||
*/
|
||||
fun runProcess(executor: (Action<in ExecSpec>) -> ExecResult?,
|
||||
executable: String, args: List<String>): ProcessOutput {
|
||||
executable: String, args: List<String>, env: Map<String, String> = emptyMap()): ProcessOutput {
|
||||
val outStream = ByteArrayOutputStream()
|
||||
val errStream = ByteArrayOutputStream()
|
||||
|
||||
@@ -130,6 +130,7 @@ fun runProcess(executor: (Action<in ExecSpec>) -> ExecResult?,
|
||||
this.standardOutput = outStream
|
||||
this.errorOutput = errStream
|
||||
this.isIgnoreExitValue = true
|
||||
this.environment(env)
|
||||
})
|
||||
|
||||
checkNotNull(execResult)
|
||||
|
||||
@@ -300,7 +300,10 @@ fun compileSwift(
|
||||
options + "-o" + output.toString() + sources +
|
||||
if (fullBitcode) listOf("-embed-bitcode", "-Xlinker", "-bitcode_verify") else listOf("-embed-bitcode-marker")
|
||||
|
||||
val (stdOut, stdErr, exitCode) = runProcess(executor = localExecutor(project), executable = compiler, args = args)
|
||||
val (stdOut, stdErr, exitCode) = runProcess(
|
||||
executor = localExecutor(project), executable = compiler, args = args,
|
||||
env = mapOf("DYLD_FALLBACK_FRAMEWORK_PATH" to configs.absoluteTargetToolchain + "/ExtraFrameworks")
|
||||
)
|
||||
|
||||
println(
|
||||
"""
|
||||
|
||||
+13
-6
@@ -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(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user