Skip to content

Conversation

@halibobo1205
Copy link
Contributor

@halibobo1205 halibobo1205 commented Dec 30, 2025

What does this PR do?

This PR adds support for macOS ARM64 (Apple Silicon) by upgrading to protoc-gen-grpc-java 1.76.0, which provides a Universal Binary for protoc-gen-grpc-java and enables it to run natively on ARM64-based Macs. Intel (x86_64) support remains unchanged, continuing to use the existing protoc-gen-grpc-java 1.60 version.

Why are these changes required?

macOS ARM64 native support: With the rise of Apple Silicon, there is a need to support ARM64 architecture natively on macOS. Previous versions relied on Rosetta for emulation, leading to performance loss. Upgrading to 1.76.0 and providing a Universal Binary resolves this issue for Apple Silicon devices.

error without Rosetta:

protoc-gen-grpc-java-1.60.0-osx-aarch_64.exe: program not found or is not executable Please specify a program using absolute path or make sure the program is available in your PATH system

1.60.0-osx-aarch_64:

file protoc-gen-grpc-java-1.60.0-osx-aarch_64.exe
protoc-gen-grpc-java-1.60.0-osx-aarch_64.exe: Mach-O 64-bit executable x86_64

1.76.0-osx-aarch_64.exe:

file protoc-gen-grpc-java-1.76.0-osx-aarch_64.exe 
protoc-gen-grpc-java-1.76.0-osx-aarch_64.exe: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64] [arm64]
protoc-gen-grpc-java-1.76.0-osx-aarch_64.exe (for architecture x86_64): Mach-O 64-bit executable x86_64
protoc-gen-grpc-java-1.76.0-osx-aarch_64.exe (for architecture arm64):  Mach-O 64-bit executable arm64

This PR has been tested by:

  • Unit Tests
  • Manual Testing

Follow up

Extra details

  • https://github.com/grpc/grpc-java/releases/tag/v1.76.0
    • compiler: A fix has been implemented for the blockingV2 stub to mangle generated method names that conflict with java.lang.Object methods.
    • compiler: Support for macOS aarch64 with a universal binary has been added.
  • https://github.com/grpc/grpc-java/releases/tag/v1.74.0
    • Behavior Changes
      • compiler: Default to @generated=omit (grpc/grpc-java@f8700a1). This omits javax.annotation.Generated from the generated code and makes the org.apache.tomcat:annotations-api compile-only dependency unnecessary (README and examples changes forthcoming; we delayed those changes until the release landed). You can use the option @generated=javax for the previous behavior, but please also file an issue so we can develop alternatives
      • compiler: generate blocking v2 unary calls that throw StatusException (compiler: generate blocking v2 unary calls that throw StatusException grpc/grpc-java#12126) (grpc/grpc-java@a16d655). Previously, the new blocking stub API was identical to the older blocking stub for unary RPCs and used the unchecked StatusRuntimeException. However, feedback demonstrated it was confusing to mix that with the checked StatusException in BlockingClientCall. Now the new blocking stub uses StatusException throughout. grpc-java continues to support the old generated code, but the version of protoc-gen-grpc-java will dictate which API you see. If you support multiple generated code versions, you can use the older blocking v1 stub for unary RPCs

@halibobo1205 halibobo1205 changed the title feat(protocol): support macOS ARM64 with Universal Binary feat(protocol/protoc): support macOS ARM64 with Universal Binary Dec 30, 2025
@kuny0707 kuny0707 moved this to In Review in java-tron Dec 30, 2025
@kuny0707 kuny0707 linked an issue Dec 30, 2025 that may be closed by this pull request
17 tasks
@halibobo1205 halibobo1205 changed the title feat(protocol/protoc): support macOS ARM64 with Universal Binary feat(protocol/protoc): support macOS ARM64 natively Dec 30, 2025
@halibobo1205 halibobo1205 force-pushed the feat/support_arm64_mac_native branch from 3c2b8f2 to 2ecddde Compare December 30, 2025 09:46
Copy link
Contributor

@waynercheung waynercheung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@halibobo1205 halibobo1205 changed the title feat(protocol/protoc): support macOS ARM64 natively feat(protocol/protoc): support macOS ARM64 natively compile Dec 30, 2025
@kuny0707 kuny0707 merged commit cdd720a into tronprotocol:release_v4.8.1 Dec 30, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in java-tron Dec 30, 2025
nileTestNet added a commit to tron-nile-testnet/nile-testnet that referenced this pull request Dec 30, 2025
feat(protocol): support macOS ARM64 with Universal Binary (tronprotocol#6502)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Expand ARM Architecture Compatibility

5 participants