apache / airavata-mft

Apache Airavata Managed File Transfer Services
https://airavata.apache.org
Apache License 2.0
32 stars 39 forks source link

Build error on mac M1 #53

Closed abhinav7sinha closed 1 year ago

abhinav7sinha commented 2 years ago

I get the following error when I try to build the project using the script: ./scripts/build.sh

[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.5.1:compile (default) on project mft-common-proto: Missing:
[ERROR] ----------
[ERROR] 1) com.google.protobuf:protoc:exe:osx-aarch_64:3.0.2
[ERROR] 
[ERROR]   Try downloading the file manually from the project website.
[ERROR] 
[ERROR]   Then, install it using the command: 
[ERROR]       mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.0.2 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file
[ERROR] 
[ERROR]   Alternatively, if you host your own repository you can deploy the file there: 
[ERROR]       mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.0.2 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR] 
[ERROR]   Path to dependency: 
[ERROR]     1) org.apache.airavata:mft-common-proto:jar:0.01-SNAPSHOT
[ERROR]     2) com.google.protobuf:protoc:exe:osx-aarch_64:3.0.2
[ERROR] 
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR] 
[ERROR] for artifact: 
[ERROR]   org.apache.airavata:mft-common-proto:jar:0.01-SNAPSHOT
[ERROR] 
[ERROR] from the specified remote repositories:
[ERROR]   apache.snapshots (https://repository.apache.org/snapshots, releases=false, snapshots=true),
[ERROR]   central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)

This is because com.google.protobuf:protoc:3.0.2 doesn't have support for Apple Silicon. Here's the referenced github issue in the protobuf repo.

abhinav7sinha commented 2 years ago

The newer protobuf binaries have mac m1 support.

  1. so one possible solution is to bump protobuf from com.google.protobuf:protoc:3.0.2 to the latest com.google.protobuf:protoc:3.21.7.
  2. A possible workaround is to use osx-x86_64 the os.detected.classifier for mac m1.

I'm currently using the 2nd approach (use osx-x86_64 as the os.detected.classifier) and it works. But a better approach would be to use the newer protobuf version. I'll test it and let you know if it works well.

DImuthuUpe commented 1 year ago

@abhinav7sinha what is the status of this issue?