Skip to content

Commit

Permalink
Patch Gandiva for native library loading.
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantse committed Apr 7, 2024
1 parent 61cb083 commit b1c99b6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ci/vcpkg/ports.patch
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,15 @@ index 4d7e26a..1f054a2 100644
)

vcpkg_cmake_install(ADD_BIN_TO_PATH)
diff --git a/ports/liblzma/portfile.cmake b/ports/liblzma/portfile.cmake
index 0fdc38dff..338d151e5 100644
--- a/ports/liblzma/portfile.cmake
+++ b/ports/liblzma/portfile.cmake
@@ -1,6 +1,6 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
- REPO tukaani-project/xz
+ REPO bminor/xz
REF "v${VERSION}"
SHA512 c28461123562564e030f3f733f078bc4c840e87598d9f4b718d4bca639120d8133f969c45d7bdc62f33f081d789ec0f14a1791fb7da18515682bfe3c0c7362e0
HEAD_REF master
6 changes: 6 additions & 0 deletions java/gandiva/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<protobuf.version>3.25.1</protobuf.version>
<jna.version>5.14.0</jna.version>
<checkstyle.failOnViolation>true</checkstyle.failOnViolation>
<arrow.cpp.build.dir>../../../cpp/release-build</arrow.cpp.build.dir>
</properties>
Expand Down Expand Up @@ -62,6 +63,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>${jna.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;
import java.util.Collections;
import java.util.Locale;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;

import com.sun.jna.Library;
import com.sun.jna.NativeLibrary;
import com.sun.jna.Platform;
import org.apache.arrow.gandiva.exceptions.GandivaException;

/**
Expand Down Expand Up @@ -73,6 +77,9 @@ private static void loadGandivaLibraryFromJar(final String tmpDir)
final String libraryToLoad =
getNormalizedArch() + "/" + System.mapLibraryName(LIBRARY_NAME);
final File libraryFile = moveFileFromJarToTemp(tmpDir, libraryToLoad, LIBRARY_NAME);
if (Platform.isLinux()) {
NativeLibrary.getInstance(libraryFile.getAbsolutePath(), Collections.singletonMap(Library.OPTION_OPEN_FLAGS, new Integer(257)));
}
System.load(libraryFile.getAbsolutePath());
}

Expand Down

0 comments on commit b1c99b6

Please sign in to comment.