You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ja...@apache.org on 2022/10/23 06:10:52 UTC

[doris] branch master updated: [chore](macOS) Fix the issues with protoc and protoc-gen-grpc-java on M1 (#13571)

This is an automated email from the ASF dual-hosted git repository.

jakevin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b042ef9765 [chore](macOS) Fix the issues with protoc and protoc-gen-grpc-java on M1 (#13571)
b042ef9765 is described below

commit b042ef9765f6f0eaab23a695d79a6a0e7a2122d7
Author: Adonis Ling <ad...@gmail.com>
AuthorDate: Sun Oct 23 14:10:46 2022 +0800

    [chore](macOS) Fix the issues with protoc and protoc-gen-grpc-java on M1 (#13571)
    
    There are some errors occur when building FE by JDK (arm64) on M1 because the dependencies protoc and grpc-java doesn't support M1.
    #13563 modified the build.sh to fix this issues by adding -Dos.arch=x86_64 to build command.
    However, if some one executes `mvn clean package -DskipTests=true` under the folder fe, the errors will occur again.
    
    This PR introduces a better way to fix them.
---
 build.sh           |  5 +----
 fe/fe-core/pom.xml | 18 ++++++++++++++++--
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/build.sh b/build.sh
index f79df81673..8ea1ced091 100755
--- a/build.sh
+++ b/build.sh
@@ -451,10 +451,7 @@ if [[ "${FE_MODULES}" != '' ]]; then
     if [[ "${CLEAN}" -eq 1 ]]; then
         clean_fe
     fi
-    if [[ "$(uname -sm)" == 'Darwin arm64' ]]; then
-        os_arch='-Dos.arch=x86_64'
-    fi
-    "${MVN_CMD}" package -pl ${FE_MODULES:+${FE_MODULES}} -DskipTests ${os_arch:+${os_arch}}
+    "${MVN_CMD}" package -pl ${FE_MODULES:+${FE_MODULES}} -DskipTests
     cd "${DORIS_HOME}"
 fi
 
diff --git a/fe/fe-core/pom.xml b/fe/fe-core/pom.xml
index ea91b6a275..f00c59ec56 100644
--- a/fe/fe-core/pom.xml
+++ b/fe/fe-core/pom.xml
@@ -33,6 +33,8 @@ under the License.
         <fe_ut_parallel>1</fe_ut_parallel>
         <doris.thirdparty>${basedir}/../../thirdparty</doris.thirdparty>
         <antlr4.version>4.9.3</antlr4.version>
+        <protoc.artifact>com.google.protobuf:protoc:${protobuf.version}</protoc.artifact>
+        <grpc.java.artifact>io.grpc:protoc-gen-grpc-java:${grpc.version}</grpc.java.artifact>
     </properties>
     <profiles>
         <profile>
@@ -57,6 +59,18 @@ under the License.
                 <fe_ut_parallel>${env.FE_UT_PARALLEL}</fe_ut_parallel>
             </properties>
         </profile>
+        <profile>
+            <activation>
+                <os>
+                    <name>Mac OS X</name>
+                    <arch>aarch64</arch>
+                </os>
+            </activation>
+            <properties>
+                <protoc.artifact>com.google.protobuf:protoc:${protobuf.version}:exe:osx-x86_64</protoc.artifact>
+                <grpc.java.artifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:osx-x86_64</grpc.java.artifact>
+            </properties>
+        </profile>
     </profiles>
     <dependencyManagement>
         <dependencies>
@@ -791,7 +805,7 @@ under the License.
                         <configuration>
                             <!-- <protocCommand>${doris.thirdparty}/installed/bin/protoc</protocCommand> -->
                             <!--You can use following protocArtifact instead of protocCommand, so that you don't need to install protobuf tools-->
-                            <protocArtifact>com.google.protobuf:protoc:${protobuf.version}</protocArtifact>
+                            <protocArtifact>${protoc.artifact}</protocArtifact>
                             <protocVersion>${protobuf.version}</protocVersion>
                             <inputDirectories>
                                 <include>${doris.home}/gensrc/proto</include>
@@ -802,7 +816,7 @@ under the License.
                                 </outputTarget>
                                 <outputTarget>
                                     <type>grpc-java</type>
-                                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}</pluginArtifact>
+                                    <pluginArtifact>${grpc.java.artifact}</pluginArtifact>
                                 </outputTarget>
                             </outputTargets>
                         </configuration>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org