From b15297fcd2921d26b11aedf915164b3b9b40b9aa Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Fri, 27 Jan 2023 16:03:27 -0500 Subject: [PATCH] cmd/dist: remove dead code for META_BUILDLET_HOST_TYPE This environment variable appears to never be used; according to https://cs.opensource.google/search?q=META_BUILDLET_HOST_TYPE&ss=go&ssfr=1 this is the only reference to it in the whole Go project. Change-Id: I6426a1d9e16441358c0e88daf4358112e659b2a9 Reviewed-on: https://go-review.googlesource.com/c/go/+/463741 Run-TryBot: Bryan Mills Reviewed-by: Russ Cox Auto-Submit: Bryan Mills TryBot-Result: Gopher Robot --- src/cmd/dist/build.go | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go index ae39e9bf30..b806b87797 100644 --- a/src/cmd/dist/build.go +++ b/src/cmd/dist/build.go @@ -355,26 +355,6 @@ func findgoversion() string { // its content if available, which is empty at this point. // Only use the VERSION file if it is non-empty. if b != "" { - // Some builders cross-compile the toolchain on linux-amd64 - // and then copy the toolchain to the target builder (say, linux-arm) - // for use there. But on non-release (devel) branches, the compiler - // used on linux-amd64 will be an amd64 binary, and the compiler - // shipped to linux-arm will be an arm binary, so they will have different - // content IDs (they are binaries for different architectures) and so the - // packages compiled by the running-on-amd64 compiler will appear - // stale relative to the running-on-arm compiler. Avoid this by setting - // the version string to something that doesn't begin with devel. - // Then the version string will be used in place of the content ID, - // and the packages will look up-to-date. - // TODO(rsc): Really the builders could be writing out a better VERSION file instead, - // but it is easier to change cmd/dist than to try to make changes to - // the builder while Brad is away. - if strings.HasPrefix(b, "devel") { - if hostType := os.Getenv("META_BUILDLET_HOST_TYPE"); strings.Contains(hostType, "-cross") { - fmt.Fprintf(os.Stderr, "warning: changing VERSION from %q to %q\n", b, "builder "+hostType) - b = "builder " + hostType - } - } return b } } -- 2.48.1