Is there an existing issue for this?
Which use case does this bug relate to?
No response
What happened?
The build process fails because protoc-gen-grpc-java-1.73.0-osx-aarch_64.exe is in fact a x64 type binary.
Output of `./gradlew shadowJar`
> Task :checkKotlinGradlePluginConfigurationErrors SKIPPED
> Task :extractIncludeProto UP-TO-DATE
> Task :extractProto UP-TO-DATE
> Task :generateProto FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateProto'.
> protoc: stdout: . stderr: /Users/luca/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.73.0/63d0281c191ae34748e816c50afec8d82f0fa9b1/protoc-gen-grpc-java-1.73.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 variable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
BUILD FAILED in 429ms
3 actionable tasks: 1 executed, 2 up-to-date
Steps to reproduce
- Be on an M-Series Mac
- Do not have Rosetta installed
- Run
./gradlew shadowJar
What did you expect?
The build process should just work™.
Anything else?
This is a known issue upstream grpc/grpc-java/issues/7690. The osx-aarch_64 binary is purposely the same as the osx-x86_64 binary, as the former one has issues being cross-compiled on non-aarch_64 machines. This lead to them implementing this workaround, breaking the build process for consumers of that specific library if Rosetta is missing.
There is a workaround, though:
The log specifies the broken file:
> protoc: stdout: . stderr: /Users/luca/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.73.0/63d0281c191ae34748e816c50afec8d82f0fa9b1/protoc-gen-grpc-java-1.73.0-osx-aarch_64.exe: program not found or is not executable
Brew has a native version of protoc-gen-grpc-java that works on both architectures. Overwriting the faulty binary with a copy of that version resolves the problem:
brew install protoc-gen-grpc-java
cp /opt/homebrew/Cellar/protoc-gen-grpc-java/1.73.0/bin/protoc-gen-grpc-java /Users/luca/.gradle/caches/modules-2/files-2.1/io.grpc/protoc-gen-grpc-java/1.73.0/63d0281c191ae34748e816c50afec8d82f0fa9b1/protoc-gen-grpc-java-1.73.0-osx-aarch_64.exe
Is there an existing issue for this?
Which use case does this bug relate to?
No response
What happened?
The build process fails because
protoc-gen-grpc-java-1.73.0-osx-aarch_64.exeis in fact ax64type binary.Output of `./gradlew shadowJar`
Steps to reproduce
./gradlew shadowJarWhat did you expect?
The build process should just work™.
Anything else?
This is a known issue upstream grpc/grpc-java/issues/7690. The
osx-aarch_64binary is purposely the same as theosx-x86_64binary, as the former one has issues being cross-compiled on non-aarch_64 machines. This lead to them implementing this workaround, breaking the build process for consumers of that specific library if Rosetta is missing.There is a workaround, though:
The log specifies the broken file:
Brew has a native version of
protoc-gen-grpc-javathat works on both architectures. Overwriting the faulty binary with a copy of that version resolves the problem: