]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: remove experiment checks for compile -c
authormatloob <matloob@golang.org>
Wed, 26 Nov 2025 15:30:34 +0000 (10:30 -0500)
committerGopher Robot <gobot@golang.org>
Wed, 26 Nov 2025 22:44:25 +0000 (14:44 -0800)
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 <adonovan@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Michael Matloob <matloob@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>

src/cmd/go/internal/work/build.go
src/cmd/go/internal/work/gc.go

index c483c19c65b30c0b6cb7bcb30e8992e3a6493e1b..75d05d65de24cf3c2ba1f571f98c4088265dfd86 100644 (file)
@@ -238,8 +238,6 @@ See also: go install, go get, go clean.
        `,
 }
 
-const concurrentGCBackendCompilationEnabledByDefault = true
-
 func init() {
        // break init cycle
        CmdBuild.Run = runBuild
index bbb087b436b879ef3a40df6545f2d386b4a95b7d..9a5e6c924c3d409732b52916db4069d7177b1d04 100644 (file)
@@ -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,