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

tkhurana pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git


The following commit(s) were added to refs/heads/5.1 by this push:
     new fdc7694905 PHOENIX-6806 - Protobufs don't compile on ARM-based Macs 
(Apple Silicon) (#1515)
fdc7694905 is described below

commit fdc7694905cce40f5e3169a995d248b3426b9552
Author: Geoffrey Jacoby <[email protected]>
AuthorDate: Mon Oct 10 08:38:44 2022 -0400

    PHOENIX-6806 - Protobufs don't compile on ARM-based Macs (Apple Silicon) 
(#1515)
---
 phoenix-core/pom.xml |  2 +-
 pom.xml              | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/phoenix-core/pom.xml b/phoenix-core/pom.xml
index bf33f88a7c..fcfbcce8aa 100644
--- a/phoenix-core/pom.xml
+++ b/phoenix-core/pom.xml
@@ -232,7 +232,7 @@
               <goal>compile</goal>
             </goals>
             <configuration>
-              
<protocArtifact>${protobuf.group}:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
+              
<protocArtifact>${protobuf.group}:protoc:${protoc.version}:exe:${protoc.arch}</protocArtifact>
               <protoSourceRoot>${basedir}/src/main/protobuf/</protoSourceRoot>
               <clearOutputDirectory>false</clearOutputDirectory>
               <checkStaleness>true</checkStaleness>
diff --git a/pom.xml b/pom.xml
index bc861259b2..99fc67a261 100644
--- a/pom.xml
+++ b/pom.xml
@@ -167,6 +167,9 @@
     <maven-owasp-plugin.version>6.5.3</maven-owasp-plugin.version>
     <protobuf.plugin.version>0.6.1</protobuf.plugin.version>
     <os.maven.version>1.5.0.Final</os.maven.version>
+    <!-- PHOENIX-6806 - Default protoc architecture to the detected one,
+      but allow for profile overrides -->
+    <protoc.arch>${os.detected.classifier}</protoc.arch>
   </properties>
 
   <build>
@@ -1823,6 +1826,19 @@
         <protoc.version>2.5.0.2</protoc.version>
       </properties>
     </profile>
+    <profile>
+      <!-- PHOENIX-6806 Use Mac x64 version of protoc for Apple Silicon 
(aarch64) Macs -->
+      <id>osx-aarch64</id>
+      <activation>
+        <os>
+          <family>mac</family>
+          <arch>aarch64</arch>
+        </os>
+      </activation>
+      <properties>
+        <protoc.arch>osx-x86_64</protoc.arch>
+      </properties>
+    </profile>
   </profiles>
   <reporting>
     <plugins>

Reply via email to