Skip to content

Build fails when running mvn test on an M1 Mac #2922

@ibogdanchikov

Description

@ibogdanchikov

The problem is caused by the MavenIntegrationTest.protobufBuilderTest, because it cannot find the required com.google.protobuf:protoc library version for the osx-aarch_64 architecture. Same applies to the io.grpc:protoc-gen-grpc-java library.

mvn-test-protobuf-failure-log.txt

Versions of mentioned libraries used in the parent pom.xml and in the protobuf-maven-plugin are quite old and don't have any support for the osx-aarch_64 architecture.

Minimal versions that allow build to succeed and tests to pass are:

  • com.google.protobuf:protoc:3.17.3
  • io.grpc:protoc-gen-grpc-java:1.42.1

These versions do not have native support for the osx-aarch_64 architecture, but use this architecture's name as an alias for the osx-x86_64 architecture that is backward compatible via the Rosetta 2 emulator.

I also tried the latest versions of mentioned libraries and they also seem to work fine (i.e. build succeeds and tests pass). io.grpc:protoc-gen-grpc-java still doesn't have native support for osx-aarch_64, but com.google.protobuf:protoc does since version 3.21.0, so I personally would vote for using these latest versions, if that would be possible.

I'm ready to create a pull request if the core team will see no problems with updating the versions of these libraries.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions