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

Cannot build on Apple M1 clip 2021 #16639

Closed
tisonkun opened this issue Jul 18, 2022 · 8 comments
Closed

Cannot build on Apple M1 clip 2021 #16639

tisonkun opened this issue Jul 18, 2022 · 8 comments
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@tisonkun
Copy link
Member

Describe the bug

[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (default) on project managed-ledger: An error occurred while invoking protoc: Error while executing process.: Cannot run program "/Users/chenzili/Workspace/pulsar/managed-ledger/target/protoc-plugins/protoc-3.19.2-osx-aarch_64.exe": error=86, Bad CPU type in executable -> [Help 1]

To Reproduce

On a macOS machine with properties:

  • MacBook Pro (16-inch, 2021)
  • Chip Apple M1 Pro

Clone pulsar code and execute mvn clean install -DskipTests

Expected behavior

Successfully compiled.

Additional context

protoc 3.19.2 dists osx-aarch_64 binary as an alias to the osx-x86_64 one.

Bumping the version to 3.21.2 resolves the issue.

I'll prepare a PR for this issue.

@tisonkun tisonkun added the type/bug The PR fixed a bug or issue reported a bug label Jul 18, 2022
@tisonkun
Copy link
Member Author

It seems barely bump the protoc version doesn't fix the issue entirely. Meet:

[ERROR] PROTOC FAILED: /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/target/protoc-plugins/protoc-gen-grpc-java-1.45.1-osx-aarch_64.exe: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.

[ERROR] /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/src/main/proto/Request.proto [0:0]: /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/target/protoc-plugins/protoc-gen-grpc-java-1.45.1-osx-aarch_64.exe: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.

[ERROR] /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/src/main/proto/Function.proto [0:0]: /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/target/protoc-plugins/protoc-gen-grpc-java-1.45.1-osx-aarch_64.exe: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.

[ERROR] /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/src/main/proto/InstanceCommunication.proto [0:0]: /Users/chenzili/Workspace/pulsar/pulsar-functions/proto/target/protoc-plugins/protoc-gen-grpc-java-1.45.1-osx-aarch_64.exe: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.

@tisonkun
Copy link
Member Author

Install Rosetta (see google/protobuf-gradle-plugin#543 (comment)) workaround the issue. However, we may bump version of protoc and grpc-java to get native osx-aarch_64 binary. protoc provides one at the moment while grpc-java plugin doesn't.

@tisonkun
Copy link
Member Author

tisonkun commented Jul 18, 2022

I'd like to keep it open since we need some workaround instead of a native solution. This issue may remind me to see whether upstream provides a real osx-aarch_64 protoc-gen-grpc-java binary.

Upstream issue: grpc/grpc-java#7690

@leizhiyuan
Copy link
Contributor

now ,master branch can build in m1 (works for me)

@tisonkun
Copy link
Member Author

tisonkun commented Aug 8, 2022

@leizhiyuan do you install Rosetta 2.0?

@leizhiyuan
Copy link
Contributor

@leizhiyuan do you install Rosetta 2.0?

yes..

@tisonkun
Copy link
Member Author

tisonkun commented Aug 8, 2022

After consideration, I tend to close the issue as I cannot uninstall or disable Rosetta and reproduce the issue anymore.

When grpc/grpc-java#7690 gets resolved we may directly try to upgrade the dep version. Or someone who has an M1 without Rosetta environment can verify then.

@chenrui333
Copy link

Looks like apache-pulsar still does not support native arm build, can we maybe reopen this issue (or should I create a new one)?

Also, github has arm build support now with macos-14 runner. https://github.blog/changelog/2024-01-30-github-actions-macos-14-sonoma-is-now-available/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants