From 0da92cd6c14428b9838395e53e1a773fffbb37f0 Mon Sep 17 00:00:00 2001 From: Son Luong Ngoc Date: Tue, 15 Aug 2023 16:53:58 +0200 Subject: [PATCH] go_context: set GOTOOLCHAIN to 'local' (#3660) Enforce usage of the current toolchain and avoid downloading new toolchains during build. --- go/private/context.bzl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/go/private/context.bzl b/go/private/context.bzl index fad1de36fc..3b494dedd0 100644 --- a/go/private/context.bzl +++ b/go/private/context.bzl @@ -446,6 +446,12 @@ def go_context(ctx, attr = None): # Explicitly clear this environment variable to ensure that doesn't # happen. See #2291 for more information. "GOPATH": "", + + # Since v1.21.0, set GOTOOLCHAIN to "local" to use the current toolchain + # and avoid downloading other toolchains. + # + # See https://go.dev/doc/toolchain for more info. + "GOTOOLCHAIN": "local", } # The level of support is determined by the platform constraints in