Skip to content

Commit b9c186d

Browse files
authored
Add note about Rosetta for old protoc-gen-rpc-java (#2815)
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.
1 parent a714cc1 commit b9c186d

3 files changed

Lines changed: 23 additions & 0 deletions

File tree

CONTRIBUTING.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,20 @@ Build with:
6060
```bash
6161
./gradlew build
6262
```
63+
64+
## Note on Rosetta
65+
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.
66+
67+
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
68+
69+
```bash
70+
/usr/bin/pgrep oahd
71+
```
72+
73+
which should return a PID of the Rosetta process. If it doesn't, you'll need to run
74+
75+
```bash
76+
softwareupdate --install-rosetta
77+
```
78+
79+
for builds to complete successfully.

temporal-serviceclient/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ protobuf {
7878
// version/variables substitution is not supported in protobuf section.
7979
// protoc and protoc-gen-grpc-java versions are selected to be compatible
8080
// with the oldest supported versions of protoc and grpc artifacts.
81+
//
82+
// The ternary operators look backward, be assured they are not. There are no aarch64 binaries
83+
// for this version and so we are relying on Rosetta. See CONTRIBUTING.md if this breaks for you.
8184
protoc {
8285
artifact = 'com.google.protobuf:protoc:3.25.5' + (System.getProperty("os.arch") == 'aarch64' && System.getProperty("os.name") == 'Mac OS X' ? ':osx-x86_64' : '')
8386
}

temporal-test-server/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ protobuf {
5454
// version/variables substitution is not supported in protobuf section.
5555
// protoc and protoc-gen-grpc-java versions are selected to be compatible
5656
// with the oldest supported versions of protoc and grpc artifacts.
57+
//
58+
// The ternary operators look backward, be assured they are not. There are no aarch64 binaries
59+
// for this version and so we are relying on Rosetta. See CONTRIBUTING.md if this breaks for you.
5760
protoc {
5861
artifact = 'com.google.protobuf:protoc:3.25.5' + (System.getProperty("os.arch") == 'aarch64' && System.getProperty("os.name") == 'Mac OS X' ? ':osx-x86_64' : '')
5962
}

0 commit comments

Comments
 (0)