Skip to content

Commit

Permalink
gopls/internal/telemetry/cmd/stacks: don't forward GOEXPERIMENT from env
Browse files Browse the repository at this point in the history
The test being executed may have some GOEXPERIMENT set. When invoking
another go toolchain, since GOTOOLCHAIN is set to a different version
that might be older and not support the same GOEXPERIMENT values, let
it run with its own default experiments.

Fixes golang/go#71260.

Change-Id: Iadea59fbd8bf7a11e636208567ca0fd23cdb7fa1
Cq-Include-Trybots: luci.golang.try:x_tools-gotip-linux-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/tools/+/641859
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
  • Loading branch information
dmitshur authored and gopherbot committed Jan 14, 2025
1 parent 0933021 commit c9ef861
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gopls/internal/telemetry/cmd/stacks/stacks.go
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,7 @@ func readPCLineTable(info Info, stacksDir string) (map[string]FileLine, error) {
cmd.Dir = buildDir
cmd.Env = append(os.Environ(),
"GOTOOLCHAIN="+info.GoVersion,
"GOEXPERIMENT=", // Don't forward GOEXPERIMENT from current environment since the GOTOOLCHAIN selected might not support the same experiments.
"GOOS="+info.GOOS,
"GOARCH="+info.GOARCH,
"GOWORK=off",
Expand All @@ -1026,6 +1027,7 @@ func readPCLineTable(info Info, stacksDir string) (map[string]FileLine, error) {
cmd.Stderr = os.Stderr
cmd.Env = append(os.Environ(),
"GOTOOLCHAIN="+info.GoVersion,
"GOEXPERIMENT=", // Don't forward GOEXPERIMENT from current environment since the GOTOOLCHAIN selected might not support the same experiments.
"GOOS="+info.GOOS,
"GOARCH="+info.GOARCH,
)
Expand Down

0 comments on commit c9ef861

Please sign in to comment.