Hi,
I'm building grpc-java for ARM. For building bazel, I need an ARM version of the file
protoc-gen-grpc-java-0.13.2-linux-x86_32.exe
My understanding is that grpc-java provides an appropriate binary after successful compilation.
I've already compiled and installed protobuf 3.0.0-beta3 and grpc. Both seem to work.
Compiling grpc-java, however, doesn't work:
ubuntu@tegra-ubuntu:~/src/grpc-java$ ./gradlew build
FAILURE: Build failed with an exception.
* Where:
Build file '/home/ubuntu/src/grpc-java/all/build.gradle' line: 32
* What went wrong:
A problem occurred evaluating project ':grpc-all'.
> A problem occurred configuring project ':grpc-benchmarks'.
> Could not resolve all dependencies for configuration ':grpc-benchmarks:protobufToolsLocator_protoc'.
> Could not find protoc-linux-arm_32.exe (com.google.protobuf:protoc:3.0.0-beta-3).
Searched in the following locations:
https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.0.0-beta-3/protoc-3.0.0-beta-3-linux-arm_32.exe
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 13.786 secs
protoc {
- if (project.hasProperty('protoc')) {
- path = project.protoc
- } else {
- artifact = "com.google.protobuf:protoc:${protobufVersion}"
- }
+ path = '/usr/bin/protoc'
+ //if (project.hasProperty('protoc')) {
+ // path = project.protoc
+ //} else {
+ // artifact = "com.google.protobuf:protoc:${protobufVersion}"
+ // println('#### artifact=' + artifact)
+ //}
}
--- a/compiler/build.gradle
+++ b/compiler/build.gradle
@@ -47,6 +47,9 @@ model {
}
}
gcc(Gcc) {
+ target("linux_arm-v7") {
+ println('*** HERE')
+ }
}
clang(Clang) {
}
1. Just replace the code that resolves the ref to the executable absolutely. This is just a hack, but it indicates that the build script has a bug there.
2. Fixed the subsequent 'toolchain not found' error
1. Just replace the code that resolves the ref to the executable absolutely. This is just a hack, but it indicates that the build script has a bug there.You just need to define the protoc build property. For instance by doing `gradle build -Pprotoc=path/to/protoc` (or you could use a gradle.properties, and described in COMPILING.md for skipCodegen).
2. Fixed the subsequent 'toolchain not found' errorIt's unclear what the proper fix is here. Maybe we expand the arch mapping we did a bit later:components {java_plugin(NativeExecutableSpec) {if (arch in ['x86_32', 'x86_64']) {// If arch is not within the defined platforms, we do not specify the// targetPlatform so that Gradle will choose what is appropriate.targetPlatform arch}baseName "$protocPluginBaseName"}}
2. Fixed the subsequent 'toolchain not found' errorIt's unclear what the proper fix is here. Maybe we expand the arch mapping we did a bit later:components {java_plugin(NativeExecutableSpec) {if (arch in ['x86_32', 'x86_64']) {// If arch is not within the defined platforms, we do not specify the// targetPlatform so that Gradle will choose what is appropriate.targetPlatform arch}baseName "$protocPluginBaseName"}}Strange enough, after I've inserted thetarget("linux_arm-v7") {}