From ad7bcc7b507f5858171a81319241415b1239357c Mon Sep 17 00:00:00 2001 From: Kevin Dagostino Date: Fri, 3 Mar 2023 20:31:12 +0000 Subject: [PATCH] Enable parallelCompile since golang is now >= 1.9 Test: m nothing Change-Id: I38cdd83ca9b17263155433abb65fb4f97b5ec70b --- bootstrap/bootstrap.go | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index e0a6e06..bf12cd3 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -16,7 +16,6 @@ package bootstrap import ( "fmt" - "go/build" "path/filepath" "runtime" "strings" @@ -33,21 +32,15 @@ var ( pluginGenSrcCmd = pctx.StaticVariable("pluginGenSrcCmd", filepath.Join("$ToolDir", "loadplugins")) parallelCompile = pctx.StaticVariable("parallelCompile", func() string { - // Parallel compilation is only supported on >= go1.9 - for _, r := range build.Default.ReleaseTags { - if r == "go1.9" { - numCpu := runtime.NumCPU() - // This will cause us to recompile all go programs if the - // number of cpus changes. We don't get a lot of benefit from - // higher values, so cap this to make it cheaper to move trees - // between machines. - if numCpu > 8 { - numCpu = 8 - } - return fmt.Sprintf("-c %d", numCpu) - } + numCpu := runtime.NumCPU() + // This will cause us to recompile all go programs if the + // number of cpus changes. We don't get a lot of benefit from + // higher values, so cap this to make it cheaper to move trees + // between machines. + if numCpu > 8 { + numCpu = 8 } - return "" + return fmt.Sprintf("-c %d", numCpu) }()) compile = pctx.StaticRule("compile",