From 43e2458e6b5744a783379027fd4be3e462c95366 Mon Sep 17 00:00:00 2001 From: zifeihan Date: Fri, 22 Jan 2021 09:03:50 +0800 Subject: [PATCH] [FAQ doc] Fix compiling on Mac M1 chip (#6241) --- CHANGES.md | 1 + docs/en/FAQ/How-to-build-with-mac-m1.md | 30 +++++++++++++++++++++++++ docs/en/FAQ/README.md | 3 ++- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 docs/en/FAQ/How-to-build-with-mac-m1.md diff --git a/CHANGES.md b/CHANGES.md index 83704a2ca..210a0d83c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -110,6 +110,7 @@ Release Notes. * Update docs about the latest UI. * Update the document of backend trace sampling with the latest configuration. * Update kafka plugin support version to 2.6.1. +* Add FAQ about `Fix compiling on Mac M1 chip`. All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/68?closed=1) diff --git a/docs/en/FAQ/How-to-build-with-mac-m1.md b/docs/en/FAQ/How-to-build-with-mac-m1.md new file mode 100644 index 000000000..d4f006874 --- /dev/null +++ b/docs/en/FAQ/How-to-build-with-mac-m1.md @@ -0,0 +1,30 @@ +# Fix compiling on MacBook M1 chip +### Problem +- When compiling according to [How-to-build](../guides/How-to-build.md), The following problems will occur, causing the build to fail. +``` +[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.6.1:compile (grpc-build) on project apm-network: Unable to resolve artifact: Missing: +[ERROR] ---------- +[ERROR] 1) com.google.protobuf:protoc:exe:osx-aarch_64:3.12.0 +[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.12.0 -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.12.0 -Dclassifier=osx-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id] +[ERROR] +[ERROR] Path to dependency: +[ERROR] 1) org.apache.skywalking:apm-network:jar:8.4.0-SNAPSHOT +[ERROR] 2) com.google.protobuf:protoc:exe:osx-aarch_64:3.12.0 +[ERROR] +[ERROR] ---------- +[ERROR] 1 required artifact is missing. + +``` + +### Reason +Because the dependent Protocol Buffers v3.14.0 does not have an osx-aarch_64 version, Protocol Buffers Releases link: https://github.com/protocolbuffers/protobuf/releases, fortunately, mac m1 is compatible with the osx-x86_64 version, before this version is available for download, you need to manually specify the osx-x86_64 version. + +### Resolve +We can add -Dos.detected.classifier=osx-x86_64 after the original compilation parameters, for example: `./mvnw clean package -DskipTests -Dos.detected.classifier=osx-x86_64`, After specifying, compile and run normally. diff --git a/docs/en/FAQ/README.md b/docs/en/FAQ/README.md index 3d4884ade..af4b5eeca 100644 --- a/docs/en/FAQ/README.md +++ b/docs/en/FAQ/README.md @@ -26,6 +26,7 @@ These are known and common FAQs. We welcome you to contribute yours. * [Compatible with other javaagent bytecode processing](Compatible-with-other-javaagent-bytecode-processing.md) * [**Java agent memory leak** when enhance `Worker thread` at use Thread Pool](Memory-leak-enhance-Worker-thread.md) * [Thrift plugin](thrift-plugin.md) +* [Fix compiling on Mac M1 chip](How-to-build-with-mac-m1.md) ## UI -* [What is **VNode**? And why does SkyWalking have that?](vnode.md) \ No newline at end of file +* [What is **VNode**? And why does SkyWalking have that?](vnode.md)