You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by em...@apache.org on 2019/06/15 06:22:11 UTC

[arrow] branch master updated: ARROW-5579: [Java] shade flatbuffer dependency

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 720be32  ARROW-5579: [Java] shade flatbuffer dependency
720be32 is described below

commit 720be32a0bb5e968b1d5f2753f03697074514a89
Author: tianchen <ni...@alibaba-inc.com>
AuthorDate: Fri Jun 14 23:18:17 2019 -0700

    ARROW-5579: [Java] shade flatbuffer dependency
    
    Related to [ARROW-5579](https://issues.apache.org/jira/browse/ARROW-5579).
    
    After some discussion with the Flatbuffers maintainer, it appears that FB generated code is not guaranteed to be compatible with any other version of the runtime library other than the exact same version of the flatc used to compile it.
    
    This makes depending on flatbuffers in a library (like arrow) quite risky, as if an app depends on any other version of FB, either directly or transitively, it's likely the versions will clash at some point and you'll see undefined behaviour at runtime.
    
    Shading the dependency looks to me the best way to avoid this.
    
    Author: tianchen <ni...@alibaba-inc.com>
    
    Closes #4540 from tianchen92/ARROW-5579 and squashes the following commits:
    
    fbd0c7176 <tianchen> ARROW-5579:  shade flatbuffer dependency
---
 java/flight/pom.xml |  3 +++
 java/format/pom.xml | 20 ++++++++++++++++++++
 java/vector/pom.xml | 25 +++++++++++++++++++++++++
 3 files changed, 48 insertions(+)

diff --git a/java/flight/pom.xml b/java/flight/pom.xml
index 7d01a6e..3745207 100644
--- a/java/flight/pom.xml
+++ b/java/flight/pom.xml
@@ -185,6 +185,9 @@
                   <include>com.google.protobuf:*</include>
                   <include>com.google.guava:*</include>
                 </includes>
+                <excludes>
+                  <exclude>com.google.flatbuffers:*</exclude>
+                </excludes>
               </artifactSet>
               <relocations>
                 <relocation>
diff --git a/java/format/pom.xml b/java/format/pom.xml
index 8997eb1..c6159b3 100644
--- a/java/format/pom.xml
+++ b/java/format/pom.xml
@@ -159,6 +159,26 @@
         <skip>true</skip>
       </configuration>
     </plugin>
+    <plugin>
+      <groupId>org.apache.maven.plugins</groupId>
+      <artifactId>maven-shade-plugin</artifactId>
+      <version>3.2.1</version>
+      <executions>
+        <execution>
+          <phase>package</phase>
+          <goals>
+            <goal>shade</goal>
+          </goals>
+          <configuration>
+            <artifactSet>
+              <excludes>
+                <exclude>com.google.flatbuffers:*</exclude>
+              </excludes>
+            </artifactSet>
+          </configuration>
+        </execution>
+      </executions>
+    </plugin>
   </plugins>
 
 </build>
diff --git a/java/vector/pom.xml b/java/vector/pom.xml
index b882e3e..7f194e3 100644
--- a/java/vector/pom.xml
+++ b/java/vector/pom.xml
@@ -133,6 +133,31 @@
           </execution>
         </executions>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-shade-plugin</artifactId>
+        <version>3.2.1</version>
+        <executions>
+          <execution>
+            <phase>package</phase>
+            <goals>
+              <goal>shade</goal>
+            </goals>
+            <configuration>
+              <artifactSet>
+                <excludes>
+                  <exclude>com.google.flatbuffers:*</exclude>
+                  <exclude>io.netty:*</exclude>
+                  <exclude>com.fasterxml.jackson.core:*</exclude>
+                  <exclude>org.slf4j:slf4j-api</exclude>
+                  <exclude>org.apache.arrow:arrow-memory</exclude>
+                  <exclude>org.apache.arrow:arrow-format</exclude>
+                </excludes>
+              </artifactSet>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
     <pluginManagement>
       <plugins>