Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building on ARM platform #92

Open
heychirag opened this issue Aug 14, 2020 · 8 comments
Open

Building on ARM platform #92

heychirag opened this issue Aug 14, 2020 · 8 comments

Comments

@heychirag
Copy link

Hi, I am having trouble building a project that uses protoc-jar-maven-plugin on a raspberrypi. Is there a guide on how to build this plugin on an ARM device?

@os72
Copy link
Owner

os72 commented Aug 14, 2020

What's the issue?

@Hisoka-X
Copy link

when build flink-python 1.10.1:
Failed to execute goal com.github.os72:protoc-jar-maven-plugin:3.7.1:run (default) on project flink-python_2.12: Error extracting protoc for version 3.7.1: Unsupported platform: protoc-3.7.1-linux-aarch_64.exe

@heychirag
Copy link
Author

Thanks @benjfan . That's right.

I also tried adding and linking protoc to the right aarch_64 file:

<protocArtifact>com.google.protobuf:protoc:3.9.2:exe:linux-aarch_64</protocArtifact>

But now I get this error:

[INFO]     Processing (java): OpenApiModelMessages.proto
protoc-jar: executing: [/tmp/protoc1980677954583734614.exe, -I/home/pi/openapi2-client/src/m
ain/protobuf, -I/home/pi/openapi2-client/src/main/protobuf, --java_out=/home/pi/openapi2-client/target/generated-sources, /home/pi/openapi2-client/src/main/pro
tobuf/OpenApiModelMessages.proto]
/tmp/protoc1980677954583734614.exe: 1: /tmp/protoc1980677954583734614.exe: Syntax error: word unexpected (expecting "
)")

@os72
Copy link
Owner

os72 commented Aug 15, 2020

It should work. Does the machine have access to maven central? (the plugin attempts to download)
You could also try a newer version.

What does the cmd line say?
java -jar protoc-jar-maven-plugin-3.7.1.jar --version

<protocArtifact> forces the download option, the syntax is simply (see documentation):

<protocArtifact>com.google.protobuf:protoc:3.7.1</protocArtifact>

BTW the syntax error seems to be coming from protoc itself

(Please consider sponsoring/donating if you find the project useful)

@heychirag
Copy link
Author

heychirag commented Aug 16, 2020

For the first one, I get following output:

Error: Unable to access jarfile protoc-jar-maven-plugin-3.7.1.jar

For your second suggestion, if I don't write it the way I do, then I get following error:

: Error resolving artifact: com.google.protobuf:protoc:3.9.2: Could not find artifact com.google.protobuf:protoc:exe:
linux-arm_32:3.9.2 in central (https://repo.maven.apache.org/maven2)

It is trying to find for linux-arm_32 instead of linux-aarch_64 which is not available (Check Here). Does this simply mean that this plugin could never work for Raspberrypi?

@os72
Copy link
Owner

os72 commented Aug 17, 2020

Re the cmd line, you need to point to the actual JAR file location

The plugin is working, the trouble seems to be the platform, seems to be 32 bit ARM? Google doesn't provide protoc for that, and no one contributed to my repo of protoc binaries either

Are you able to run linux-aarch_64 protoc successfully on the machine? If yes, your linux-aarch_64 protocArtifact spec should work

@heychirag
Copy link
Author

No linux-aarch_64 protoc is throwing the following error.

[INFO]     Processing (java): OpenApiModelMessages.proto
protoc-jar: executing: [/tmp/protoc1980677954583734614.exe, -I/home/pi/openapi2-client/src/m
ain/protobuf, -I/home/pi/openapi2-client/src/main/protobuf, --java_out=/home/pi/openapi2-client/target/generated-sources, /home/pi/openapi2-client/src/main/pro
tobuf/OpenApiModelMessages.proto]
/tmp/protoc1980677954583734614.exe: 1: /tmp/protoc1980677954583734614.exe: Syntax error: word unexpected (expecting "
)")

I think I would never be able to make this work unless Google releases one for linux-arm_32

@os72
Copy link
Owner

os72 commented Aug 18, 2020

I wonder if that error is actually emitted by protoc itself. You should try downloading and running protoc --version manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants