Skip to content

Commit

Permalink
all: fix integration test on macOS
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
neild committed Mar 5, 2024
1 parent fe89159 commit 235ef28
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 235ef28

Please sign in to comment.