From: matloob Date: Wed, 26 Nov 2025 15:30:34 +0000 (-0500) Subject: cmd/go: remove experiment checks for compile -c X-Git-Tag: go1.26rc1~73 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3353c100bb;p=gostls13.git cmd/go: remove experiment checks for compile -c There's a comment that we should test that compile -c is compatible with the fieldtrack and preemptibleloops experiments and then remove the check disabling -c when those experiments are enabled. I tested this and the tests pass with fieldtrack (with the exception of one go command test that makes the assumption that fieldtrack is off), and the preemptibleloops experiment is already broken without this experiment. Also remove the check for the value of the GO19CONCURRENTCOMPILATION environment variable. The compiler concurrency can be limited by setting GOMAXPROCS. Change-Id: I0c02745de463ea572673648061185cd76a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/724680 Reviewed-by: Alan Donovan Reviewed-by: Cherry Mui Auto-Submit: Michael Matloob LUCI-TryBot-Result: Go LUCI --- diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go index c483c19c65..75d05d65de 100644 --- a/src/cmd/go/internal/work/build.go +++ b/src/cmd/go/internal/work/build.go @@ -238,8 +238,6 @@ See also: go install, go get, go clean. `, } -const concurrentGCBackendCompilationEnabledByDefault = true - func init() { // break init cycle CmdBuild.Run = runBuild diff --git a/src/cmd/go/internal/work/gc.go b/src/cmd/go/internal/work/gc.go index bbb087b436..9a5e6c924c 100644 --- a/src/cmd/go/internal/work/gc.go +++ b/src/cmd/go/internal/work/gc.go @@ -10,7 +10,6 @@ import ( "internal/buildcfg" "internal/platform" "io" - "log" "os" "path/filepath" "runtime" @@ -183,29 +182,6 @@ func (gcToolchain) gc(b *Builder, a *Action, archive string, importcfg, embedcfg // compilerConcurrency returns the compiler concurrency level for a package compilation. // The returned function must be called after the compile finishes. func compilerConcurrency() (int, func()) { - // First, check whether we can use -c at all for this compilation. - canDashC := concurrentGCBackendCompilationEnabledByDefault - - switch e := os.Getenv("GO19CONCURRENTCOMPILATION"); e { - case "0": - canDashC = false - case "1": - canDashC = true - case "": - // Not set. Use default. - default: - log.Fatalf("GO19CONCURRENTCOMPILATION must be 0, 1, or unset, got %q", e) - } - - // TODO: Test and delete these conditions. - if cfg.ExperimentErr != nil || cfg.Experiment.FieldTrack || cfg.Experiment.PreemptibleLoops { - canDashC = false - } - - if !canDashC { - return 1, func() {} - } - // Decide how many concurrent backend compilations to allow. // // If we allow too many, in theory we might end up with p concurrent processes,