From fb3afab9474db1e4762f74182fb5db546f2a5de0 Mon Sep 17 00:00:00 2001 From: Yun Peng Date: Thu, 18 Jul 2024 18:55:33 +0200 Subject: [PATCH] Migrate to macos_arm64 (#3990) * Migrate to macos_arm64 * Add comment * Update bazel_testing.go --- .bazelci/presubmit.yml | 2 +- go/tools/bazel_testing/bazel_testing.go | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index b0f49f4c1..90a625463 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -91,7 +91,7 @@ tasks: - "@go_default_sdk//..." test_targets: - "//..." - macos_legacy: + macos_arm64: shell_commands: - tests/core/cgo/generate_imported_dylib.sh build_flags: diff --git a/go/tools/bazel_testing/bazel_testing.go b/go/tools/bazel_testing/bazel_testing.go index 30bc8f058..a414b40c9 100644 --- a/go/tools/bazel_testing/bazel_testing.go +++ b/go/tools/bazel_testing/bazel_testing.go @@ -179,7 +179,10 @@ func TestMain(m *testing.M, args Args) { // hide that this code is executing inside a bazel test. func BazelCmd(args ...string) *exec.Cmd { cmd := exec.Command("bazel") - cmd.Args = append(cmd.Args, "--nosystem_rc", "--nohome_rc") + // --nosystem_rc isn't used here because Bazel may need essential flags set in + // system rc to be able to work correctly + // See https://github.com/bazelbuild/rules_go/pull/3969#issuecomment-2220405416 + cmd.Args = append(cmd.Args, "--nohome_rc") cmd.Args = append(cmd.Args, args...) for _, e := range os.Environ() { // Filter environment variables set by the bazel test wrapper script.