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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
This commit is contained in:
Damien Neil 2024-03-05 09:54:28 -08:00
parent fe89159266
commit 235ef28b75

View File

@ -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