From 7d5ef86f091b3324f2b0b2fea206865cf5716c92 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 8 Aug 2025 18:43:41 +0200 Subject: [PATCH 1/3] TMP: Test not setting GOROOT --- go/private/context.bzl | 1 - 1 file changed, 1 deletion(-) diff --git a/go/private/context.bzl b/go/private/context.bzl index c2b459f580..a86cb4c909 100644 --- a/go/private/context.bzl +++ b/go/private/context.bzl @@ -524,7 +524,6 @@ def go_context( "GOARCH": mode.goarch, "GOOS": mode.goos, "GOEXPERIMENT": toolchain.sdk.experiments, - "GOROOT": goroot, "GOROOT_FINAL": "GOROOT", "CGO_ENABLED": "0" if mode.pure else "1", From 11b2e48bde54f861c868545c0601c791c52bba28 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 8 Aug 2025 18:45:07 +0200 Subject: [PATCH 2/3] Update env.go --- go/tools/builders/env.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/go/tools/builders/env.go b/go/tools/builders/env.go index 2058214ecd..f1335509c4 100644 --- a/go/tools/builders/env.go +++ b/go/tools/builders/env.go @@ -87,12 +87,6 @@ func (e *env) checkFlagsAndSetGoroot() error { if e.sdk == "" { return errors.New("-sdk was not set") } - if e.goroot != "" { - err := os.Setenv("GOROOT", e.goroot) - if err != nil { - return err - } - } return nil } From 36d5d0fa941b6e963c55e5676dd69cfd2394de62 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Fri, 8 Aug 2025 19:31:59 +0200 Subject: [PATCH 3/3] Update stdlib.bzl --- go/private/actions/stdlib.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/go/private/actions/stdlib.bzl b/go/private/actions/stdlib.bzl index 2ca42814ec..0069aa062b 100644 --- a/go/private/actions/stdlib.bzl +++ b/go/private/actions/stdlib.bzl @@ -92,6 +92,7 @@ def _build_stdlib_list_json(go): def _build_env(go): env = go.env + env["GOROOT"] = go.sdk.root_file.dirname if go.mode.pure: env.update({"CGO_ENABLED": "0"})