From f60ec41a86f43abaaacf04a3960c9d06681d06a1 Mon Sep 17 00:00:00 2001 From: Edward Amsden Date: Tue, 24 Mar 2026 14:18:20 -0500 Subject: [PATCH] Add note about Rosetta for old protoc-gen-rpc-java I tripped over newer MacOS not installing Rosetta by default when we were silently relying on that to cover for the version of protoc-gen-rpc-java not shipping MacOS aarch64 binaries. I'm adding a note to CONTRIBUTING.md and comments in the relevant gradle files so other developers have some hope of not falling down the same rabbit hole I did. --- CONTRIBUTING.md | 17 +++++++++++++++++ temporal-serviceclient/build.gradle | 3 +++ temporal-test-server/build.gradle | 3 +++ 3 files changed, 23 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a55a530f..db02fef53 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -60,3 +60,20 @@ Build with: ```bash ./gradlew build ``` + +## Note on Rosetta +Newer Apple Silicon macs do not ship with Rosetta by default, and the version of `protoc-gen-rpc-java` we use (1.34.1) does not ship Apple Silicon binaries. + +So Gradle is set to hardcode the download of the x86_64 binaries on MacOS, but this depends on Rosetta to function. Make sure Rosetta is installed with + +```bash +/usr/bin/pgrep oahd +``` + +which should return a PID of the Rosetta process. If it doesn't, you'll need to run + +```bash +softwareupdate --install-rosetta +``` + +for builds to complete successfully. diff --git a/temporal-serviceclient/build.gradle b/temporal-serviceclient/build.gradle index 464373505..343083ec0 100644 --- a/temporal-serviceclient/build.gradle +++ b/temporal-serviceclient/build.gradle @@ -78,6 +78,9 @@ protobuf { // version/variables substitution is not supported in protobuf section. // protoc and protoc-gen-grpc-java versions are selected to be compatible // with the oldest supported versions of protoc and grpc artifacts. + // + // The ternary operators look backward, be assured they are not. There are no aarch64 binaries + // for this version and so we are relying on Rosetta. See CONTRIBUTING.md if this breaks for you. protoc { artifact = 'com.google.protobuf:protoc:3.25.5' + (System.getProperty("os.arch") == 'aarch64' && System.getProperty("os.name") == 'Mac OS X' ? ':osx-x86_64' : '') } diff --git a/temporal-test-server/build.gradle b/temporal-test-server/build.gradle index 8bf6a6bf9..dd8c97f22 100644 --- a/temporal-test-server/build.gradle +++ b/temporal-test-server/build.gradle @@ -54,6 +54,9 @@ protobuf { // version/variables substitution is not supported in protobuf section. // protoc and protoc-gen-grpc-java versions are selected to be compatible // with the oldest supported versions of protoc and grpc artifacts. + // + // The ternary operators look backward, be assured they are not. There are no aarch64 binaries + // for this version and so we are relying on Rosetta. See CONTRIBUTING.md if this breaks for you. protoc { artifact = 'com.google.protobuf:protoc:3.25.5' + (System.getProperty("os.arch") == 'aarch64' && System.getProperty("os.name") == 'Mac OS X' ? ':osx-x86_64' : '') }