Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions docs/install/source-install/compilation-mac.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,17 @@ cd installed/bin
:::tip
When running protoc and thrift, you may encounter an issue where the binary cannot be opened due to developer verification. To resolve this, you can go to "Security & Privacy" settings. In the "General" tab, click on the "Open Anyway" button to confirm your intent to open the binary. Refer to: https://support.apple.com/en-us/102445
:::

## Common Errors
1. When running `protoc` and `thrift`, you may encounter an issue where the binary cannot be opened due to developer verification. To resolve this, you can go to "Security & Privacy" settings. In the "General" tab, click on the "Open Anyway" button to confirm your intent to open the binary. Refer to: https://support.apple.com/en-us/102445.
2. When compiling with a Mac with an M3 chip, the compilation of the proto file fails.
The failure log is as follows:
```Shell
[ERROR] ... [0:0]: --grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.
```
The reason for this error may be that the Apple arm-based chip does not support software on the x86 platform.
You can download the protoc-gen-grpc-java software used from https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-java/, and the version information can be viewed from the grpc.java.artifact property under the protoc_rosetta profile in fe/fe-core/pom.xml. If the following error is reported after downloading and executing, it means that the current Mac cannot execute software based on x86 compiled software.
```Shell
zsh: bad CPU type in executable:./protoc-gen-grpc-java-1.34.0-osx-x86_64.exe
```
You can refer to the official documentation https://support.apple.com/en-us/102527 and install `Rosetta` to solve this problem.
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,19 @@ cd installed/bin
./thrift --version
```

运行`protoc`和`thrift`的时候可能会遇到**无法打开,因为无法验证开发者**的问题,可以到前往`安全性与隐私`。点按`通用`面板中的`仍要打开`按钮,以确认打算打开该二进制。参考 https://support.apple.com/zh-cn/HT202491。
## 常见错误

1. 运行`protoc`和`thrift`的时候可能会遇到**无法打开,因为无法验证开发者**的问题,可以到前往`安全性与隐私`。点按`通用`面板中的`仍要打开`按钮,以确认打算打开该二进制。参考 https://support.apple.com/zh-cn/HT202491。

2. 使用M3芯片的Mac编译时报编译proto文件失败
失败日志如下
```Shell
[ERROR] ... [0:0]: --grpc-java_out: protoc-gen-grpc-java: Plugin failed with status code 1.
```
此错误的原因可能是由于Apple基于arm的芯片不支持x86平台的软件导致。
可从https://repo.maven.apache.org/maven2/io/grpc/protoc-gen-grpc-java/下载编译用到的protoc-gen-grpc-java软件验证,版本信息可从fe/fe-core/pom.xml中protoc_rosetta profile下的grpc.java.artifact属性查看。
下载后执行如果报错如下错误则表示当前Mac不能执行基于x86编译的软件:
```Shell
zsh: bad CPU type in executable: ./protoc-gen-grpc-java-1.34.0-osx-x86_64.exe
```
可参考Apple官方文档https://support.apple.com/en-us/102527,安装Rosetta解决该问题。