Open cmardini opened 3 years ago
Ack. I see. We're saying special handling for osx-aarch_64:
Correct?
If you could provide clean native binaries (static build, stripped, etc), good for wide consumption, I could host them on maven central: https://repo.maven.apache.org/maven2/com/github/os72/protoc/
You could make them available via PR: https://github.com/os72/protoc-jar/tree/master/bin
That would be a nice contribution. And if you're using the project professionally, I'd appreciate support (sponsorship) for it..
I think if we populate the osx-aarch_64 binary, that would be sufficient.
I've built protoc with static linkage (./configure --disable-shared) and stripped the symbols. I'll make a PR shortly.
Added a PR: https://github.com/os72/protoc-jar/pull/94
when can this be released?
Suggested workaround for the time being:
brew install protobuf
https://formulae.brew.sh/formula/protobufI was able to add the property to a m1 maven build profile
<properties>
<protocCommand>protoc</protocCommand>
</properties>
protoc-3.17.3-osx-aarch_64.exe
https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.17.3/
protoc-3.17.3-osx-aarch_64.exe
https://repo1.maven.org/maven2/com/google/protobuf/protoc/3.17.3/
I created this comment for the solution.
https://github.com/protocolbuffers/protobuf/issues/8062#issuecomment-892689597
As per @hazmeister's comment, I added the following profile to my pom.xml that uses protoc. Maybe it can be shortened.
<profile>
<build>
<plugins>
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<executions>
<execution>
<configuration>
<protocCommand>protoc</protocCommand> <!-- brew install protobuf -->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<activation>
<os>
<name>mac os x</name>
<arch>aarch64</arch>
<family>mac</family>
</os>
</activation>
</profile>
</profiles>
I'm afraid the pace in this project will remain slow until more support/sponsorship can be found (most users are enterprises)..
in the meantime, I was able to run the process in a Apple M1 chip using the parameter "-Dos.arch=x86_64" with the maven goals
Can someone provide final step to how to resolve this on M1 mac ?
simply do something like
<plugin>
<groupId>com.github.os72</groupId>
<artifactId>protoc-jar-maven-plugin</artifactId>
<version>3.11.4</version>
<configuration>
<protocArtifact>com.google.protobuf:protoc:3.21.1</protocArtifact>
Where I can add those codes or suggestion codes?
`
`
Where I can add those codes or suggestion codes?
<properties> <protocCommand>protoc</protocCommand> </properties>
"properties" doesn't seem right, it goes under <configuration>
. example: https://github.com/os72/protoc-jar/issues/93#issuecomment-893491180
in the meantime, I was able to run the process in a Apple M1 chip using the parameter "-Dos.arch=x86_64" with the maven goals
@Rigoberto-Vazquez thanks for this -- works for me too.
Another way I found that works is to switch to using a x86_64
JDK instead. Seems to run just fine on my M1 Mac.
I found that works. Add the following configuration to maven settings.xml.
<profile>
<id>apple-m1</id>
<properties>
<os.detected.classifier>osx-x86_64</os.detected.classifier>
</properties>
</profile>
git@github.com:protocolbuffers/protobuf.git
git checkout v3.11.4 -b v3.11.4
)autoconf
b.(optional) (then generate Makefile): ./configure
c. make -j $(nproc)
<configuration>
<protocCommand>/Users/huanwei/git_files/github/protobuf/src/protoc</protocCommand>
<protocVersion>${protoc.version}</protocVersion>
<inputDirectories>
<include>src/main/resources</include>
</inputDirectories>
</configuration>
Don't you only need to specify a <protocVersion>
of 3.17.3 or higher?
I'm not using protoc-jar
by itself, but at least for the protoc-jar-maven-plugin
that is sufficient.
Make sure that you're running on a JDK that is x86_64
.
I was previously running on Zulu JDK with arch64 architecture and having that issue.
After switching to OpenJDK the problem was gone.
Make sure that you're running on a JDK that is
x86_64
.I was previously running on Zulu JDK with arch64 architecture and having that issue.
After switching to OpenJDK the problem was gone.
it's good for me
echo "protoc_platform=osx-x86_64" >> ~/.gradle/gradle.properties
As per @hazmeister's comment, I added the following profile to my pom.xml that uses protoc. Maybe it can be shortened.
Very nice, It works for me.
Would it be possible to add to protoc-jar/bin// a protoc--osx-aarch_64.exe? Temporarily, it can probably even be a copy of protoc-*-osx-x86_64.exe as it should run on M1 macs.
I also have a brew installed protoc that seems to be compiled for arm, if you need it.
The protoc-jar-maven-plugin seems to request this for the embedded protoc.
To workaround, I've done the following:
and then in the plugin configuration in pom.xml: