From 235ef28b758bbbfb6f91d69e661abb7a0c37427c Mon Sep 17 00:00:00 2001 From: Damien Neil Date: Tue, 5 Mar 2024 09:54:28 -0800 Subject: [PATCH] all: fix integration test on macOS Newer protobuf versions won't build on macOS unless you pass --macos_minimum_os=(something recentish) to bazel. Change-Id: I9e8f47eae708023400e15e5ca43d79caf2f62825 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/569355 LUCI-TryBot-Result: Go LUCI Reviewed-by: Roland Shoemaker --- integration_test.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/integration_test.go b/integration_test.go index b4f1facc..8d0ad62d 100644 --- a/integration_test.go +++ b/integration_test.go @@ -283,14 +283,24 @@ func mustInitDeps(t *testing.T) { // the conformance test runner. fmt.Printf("build %v\n", filepath.Base(protobufPath)) env := os.Environ() + args := []string{ + "bazel", "build", + ":protoc", + "//conformance:conformance_test_runner", + } if runtime.GOOS == "darwin" { // Adding this environment variable appears to be necessary for macOS builds. env = append(env, "CC=clang") + // And this flag. + args = append(args, + "--macos_minimum_os=13.0", + "--host_macos_minimum_os=13.0", + ) } command{ Dir: protobufPath, Env: env, - }.mustRun(t, "bazel", "build", ":protoc", "//conformance:conformance_test_runner") + }.mustRun(t, args...) } } check(os.Setenv("PROTOBUF_ROOT", protobufPath)) // for generate-protos