Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d474921
Initial commit
rok Oct 14, 2022
c9c4ebc
further changes
rok Oct 18, 2022
9e3f60c
changing python version to enable M1
rok Oct 20, 2022
eb1cef8
use matrix build, add sccache, install jdk on self-hosted
assignUser Oct 21, 2022
580268a
Revert "changing python version to enable M1"
assignUser Oct 21, 2022
6028d77
escape gha macro
assignUser Oct 21, 2022
b4c135b
fix typo
assignUser Oct 21, 2022
b38d2f2
fix archery install
assignUser Oct 21, 2022
ff5cc0b
Apply suggestions from code review
rok Oct 21, 2022
fabe3b0
Build jars per architecture.
rok Oct 21, 2022
61ea03f
Apply suggestions from code review
rok Oct 24, 2022
d97f4a4
Review feedback
rok Oct 24, 2022
e756933
Update dev/tasks/java-jars/github.yml
rok Oct 24, 2022
423b98d
Update dev/tasks/java-jars/github.yml
rok Oct 24, 2022
7dd6b1e
Update dev/tasks/java-jars/github.yml
rok Oct 24, 2022
dfe52a6
Review feedback
rok Oct 28, 2022
0d7f09e
more changes
rok Oct 31, 2022
fc108b9
more changes
rok Nov 2, 2022
8a52a14
review feedback
rok Nov 3, 2022
a273346
Put artifacts to arch directory
kou Nov 4, 2022
5ebee21
Add missing $(arch)
kou Nov 4, 2022
5f450db
Adding locale import to gandiva
rok Nov 4, 2022
65ca378
Adjust arch
kou Nov 4, 2022
e663a74
Add missing arch
kou Nov 4, 2022
45f2d15
Fix archery
kou Nov 4, 2022
f2ca173
Fix syntax
kou Nov 4, 2022
261c938
Remove garbage
kou Nov 5, 2022
78d6fe4
Normalize aarch64
kou Nov 5, 2022
16d59ef
Adjust style
kou Nov 5, 2022
e2207bb
Use Brewfile
kou Nov 5, 2022
6171e82
Remove void
kou Nov 5, 2022
efcec48
Linting
rok Nov 5, 2022
c2ba634
Enabe local JNI builds
rok Nov 7, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/java_jni.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ concurrency:

permissions:
contents: read

env:
DOCKER_VOLUME_PREFIX: ".docker/"

Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/java_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ fi

if [ "${ARROW_PLASMA}" = "ON" ]; then
pushd ${source_dir}/plasma
${mvn} clean install
${mvn} -Darrow.cpp.build.dir=${java_jni_dist_dir} clean install
popd
fi

Expand Down
11 changes: 10 additions & 1 deletion ci/scripts/java_jni_macos_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,17 @@ set -ex

arrow_dir=${1}
build_dir=${2}
normalized_arch=$(arch)
case ${normalized_arch} in
arm64)
normalized_arch=aarch_64
;;
i386)
normalized_arch=x86_64
;;
esac
# The directory where the final binaries will be stored when scripts finish
dist_dir=${3}
dist_dir=${3}/${normalized_arch}

echo "=== Clear output directories and leftovers ==="
# Clear output directories and leftovers
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/java_jni_manylinux_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -ex
arrow_dir=${1}
build_dir=${2}
# The directory where the final binaries will be stored when scripts finish
dist_dir=${3}
dist_dir=${3}/$(arch)

echo "=== Clear output directories and leftovers ==="
# Clear output directories and leftovers
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/java_jni_windows_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -ex
arrow_dir=${1}
build_dir=${2}
# The directory where the final binaries will be stored when scripts finish
dist_dir=${3}
dist_dir=${3}/x86_64

echo "=== Clear output directories and leftovers ==="
# Clear output directories and leftovers
Expand Down
2 changes: 1 addition & 1 deletion ci/scripts/java_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if [ "${#projects[@]}" -gt 0 ]; then
if [ "${ARROW_PLASMA}" = "ON" ]; then
pushd ${source_dir}/plasma
java -cp target/test-classes:target/classes \
-Djava.library.path=${java_jni_dist_dir} \
-Djava.library.path=${java_jni_dist_dir}/$(arch) \
org.apache.arrow.plasma.PlasmaClientTest
popd
fi
Expand Down
1 change: 0 additions & 1 deletion cpp/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ brew "grpc"
brew "llvm@14"
brew "lz4"
brew "ninja"
brew "numpy"
brew "[email protected]"
brew "protobuf"
brew "python"
Expand Down
102 changes: 65 additions & 37 deletions dev/tasks/java-jars/github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
{{ macros.github_checkout_arrow()|indent }}
{{ macros.github_install_archery()|indent }}
- name: Build C++ libraries
env:
{{ macros.github_set_sccache_envvars()|indent(8) }}
run: |
archery docker run \
-e ARROW_JAVA_BUILD=OFF \
Expand All @@ -48,47 +50,65 @@ jobs:
{% endif %}

build-cpp-macos:
name: Build C++ libraries macOS
runs-on: macos-latest
{% set arch = '${{ matrix.platform.arch }}' %}
name: Build C++ libraries macOS {{ arch }}
runs-on: {{ '${{ matrix.platform.runs_on }}' }}
strategy:
fail-fast: false
matrix:
platform:
- { runs_on: ["macos-latest"], arch: "x86_64"}
- { runs_on: ["self-hosted", "macOS", "arm64", "devops-managed"], arch: "aarch_64" }
env:
MACOSX_DEPLOYMENT_TARGET: "10.13"
steps:
{{ macros.github_checkout_arrow()|indent }}
{{ macros.github_install_archery()|indent }}
- name: Set up Python
if: |
!contains(matrix.platform.runs_on, 'self-hosted')
uses: actions/setup-python@v4
with:
cache: 'pip'
python-version: 3.8
- name: Install Archery
shell: bash
run: pip install -e arrow/dev/archery[all]
- name: Install dependencies
run: |
brew install --overwrite git
brew bundle --file=arrow/cpp/Brewfile
# We want to link aws-sdk-cpp statically but Homebrew's
# aws-sdk-cpp provides only shared library. If we have
# Homebrew's aws-sdk-cpp, our build mix Homebrew's
# aws-sdk-cpp and bundled aws-sdk-cpp. We uninstall Homebrew's
# aws-sdk-cpp to ensure using only bundled aws-sdk-cpp.
brew uninstall aws-sdk-cpp
- name: Setup ccache
run: |
arrow/ci/scripts/ccache_setup.sh
brew bundle --file=arrow/java/Brewfile
- name: Build C++ libraries
env:
{{ macros.github_set_sccache_envvars()|indent(8) }}
run: |
set -e
# make brew Java available to CMake
if [ "{{ arch }}" = "aarch_64" ]; then
export JAVA_HOME=$(brew --prefix openjdk@11)/libexec/openjdk.jdk/Contents/Home
fi
arrow/ci/scripts/java_jni_macos_build.sh \
$GITHUB_WORKSPACE/arrow \
$GITHUB_WORKSPACE/arrow/cpp-build \
$GITHUB_WORKSPACE/arrow/java-dist
- name: Compress into single artifact to keep directory structure
run: tar -cvzf arrow-shared-libs-macos.tar.gz arrow/java-dist/
run: tar -cvzf arrow-shared-libs-macos-{{ arch }}.tar.gz arrow/java-dist/
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: macos-shared-lib
path: arrow-shared-libs-macos.tar.gz
name: macos-shared-lib-{{ arch }}
path: arrow-shared-libs-macos-{{ arch }}.tar.gz

build-cpp-windows:
name: Build C++ libraries Windows
runs-on: windows-2019
steps:
{{ macros.github_checkout_arrow()|indent }}
{{ macros.github_install_archery()|indent }}
- name: Set up Java
uses: actions/setup-java@v3
with:
Expand All @@ -97,8 +117,13 @@ jobs:
- name: Download Timezone Database
shell: bash
run: arrow/ci/scripts/download_tz_database.sh
- name: Install sccache
shell: bash
run: arrow/ci/scripts/install_sccache.sh pc-windows-msvc $(pwd)/sccache
- name: Build C++ libraries
shell: cmd
env:
{{ macros.github_set_sccache_envvars()|indent(8) }}
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x64
REM For ORC
Expand All @@ -122,39 +147,42 @@ jobs:
- build-cpp-windows
steps:
{{ macros.github_checkout_arrow(fetch_depth=0)|indent }}
- name: Download Linux C++ Libraries
uses: actions/download-artifact@v2
- name: Download Libraries
uses: actions/download-artifact@v3
with:
name: ubuntu-shared-lib
- name: Download macOS C++ libraries
uses: actions/download-artifact@v2
with:
name: macos-shared-lib
- name: Download Windows C++ libraries
uses: actions/download-artifact@v2
with:
name: windows-shared-lib
- name: Descompress artifacts
path: artifacts
- name: Decompress artifacts
run: |
mv artifacts/*/*.tar.gz .
tar -xvzf arrow-shared-libs-linux.tar.gz
tar -xvzf arrow-shared-libs-macos.tar.gz
tar -xvzf arrow-shared-libs-macos-x86_64.tar.gz
tar -xvzf arrow-shared-libs-macos-aarch_64.tar.gz
tar -xvzf arrow-shared-libs-windows.tar.gz
- name: Test that shared libraries exist
run: |
set -x
test -f arrow/java-dist/libarrow_cdata_jni.dylib
test -f arrow/java-dist/libarrow_cdata_jni.so
test -f arrow/java-dist/arrow_cdata_jni.dll
test -f arrow/java-dist/libarrow_dataset_jni.dylib
test -f arrow/java-dist/libarrow_dataset_jni.so
test -f arrow/java-dist/arrow_dataset_jni.dll
test -f arrow/java-dist/libarrow_orc_jni.dylib
test -f arrow/java-dist/libarrow_orc_jni.so
test -f arrow/java-dist/arrow_orc_jni.dll
test -f arrow/java-dist/libgandiva_jni.dylib
test -f arrow/java-dist/libgandiva_jni.so
test -f arrow/java-dist/libplasma_java.dylib
test -f arrow/java-dist/libplasma_java.so

test -f arrow/java-dist/x86_64/libarrow_cdata_jni.so
test -f arrow/java-dist/x86_64/libarrow_dataset_jni.so
test -f arrow/java-dist/x86_64/libarrow_orc_jni.so
test -f arrow/java-dist/x86_64/libgandiva_jni.so
test -f arrow/java-dist/x86_64/libplasma_java.so

test -f arrow/java-dist/x86_64/libarrow_cdata_jni.dylib
test -f arrow/java-dist/x86_64/libarrow_dataset_jni.dylib
test -f arrow/java-dist/x86_64/libarrow_orc_jni.dylib
test -f arrow/java-dist/x86_64/libgandiva_jni.dylib
test -f arrow/java-dist/x86_64/libplasma_java.dylib

test -f arrow/java-dist/aarch_64/libarrow_cdata_jni.dylib
test -f arrow/java-dist/aarch_64/libarrow_dataset_jni.dylib
test -f arrow/java-dist/aarch_64/libarrow_orc_jni.dylib
test -f arrow/java-dist/aarch_64/libgandiva_jni.dylib
test -f arrow/java-dist/aarch_64/libplasma_java.dylib

test -f arrow/java-dist/x86_64/arrow_cdata_jni.dll
test -f arrow/java-dist/x86_64/arrow_dataset_jni.dll
test -f arrow/java-dist/x86_64/arrow_orc_jni.dll
- name: Build bundled jar
run: |
set -e
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1210,7 +1210,7 @@ services:
command:
[ "/arrow/ci/scripts/cpp_build.sh /arrow /build &&
/arrow/ci/scripts/python_build.sh /arrow /build &&
/arrow/ci/scripts/java_jni_build.sh /arrow $${ARROW_HOME} /build /tmp/dist/java &&
/arrow/ci/scripts/java_jni_build.sh /arrow $${ARROW_HOME} /build /tmp/dist/java/$$(arch) &&
/arrow/ci/scripts/java_build.sh /arrow /build /tmp/dist/java &&
/arrow/ci/scripts/java_cdata_integration.sh /arrow /tmp/dist/java" ]

Expand Down
24 changes: 12 additions & 12 deletions docs/source/developers/java/building.rst
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Maven
$ export JAVA_HOME=<absolute path to your java home>
$ java --version
$ mvn generate-resources -Pgenerate-libs-cdata-all-os -N
$ ls -latr ../java-dist/lib
$ ls -latr ../java-dist/lib/<your system's architecture>
|__ libarrow_cdata_jni.dylib
|__ libarrow_cdata_jni.so

Expand All @@ -122,7 +122,7 @@ Maven

$ cd arrow/java
$ mvn generate-resources -Pgenerate-libs-cdata-all-os -N
$ dir "../java-dist/bin"
$ dir "../java-dist/bin/x86_64"
|__ arrow_cdata_jni.dll

- To build all JNI libraries (MacOS / Linux) except the JNI C Data Interface library:
Expand All @@ -133,7 +133,7 @@ Maven
$ export JAVA_HOME=<absolute path to your java home>
$ java --version
$ mvn generate-resources -Pgenerate-libs-jni-macos-linux -N
$ ls -latr java-dist/lib/*_{jni,java}.*
$ ls -latr java-dist/lib/<your system's architecture>/*_{jni,java}.*
|__ libarrow_dataset_jni.dylib
|__ libarrow_orc_jni.dylib
|__ libgandiva_jni.dylib
Expand All @@ -145,7 +145,7 @@ Maven

$ cd arrow/java
$ mvn generate-resources -Pgenerate-libs-jni-windows -N
$ dir "../java-dist/bin"
$ dir "../java-dist/bin/x86_64"
|__ arrow_dataset_jni.dll

CMake
Expand All @@ -164,7 +164,7 @@ CMake
-DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_LIBDIR=lib/<your system's architecture> \
-DCMAKE_INSTALL_PREFIX=java-dist
$ cmake --build java-cdata --target install --config Release
$ ls -latr java-dist/lib
Expand All @@ -184,7 +184,7 @@ CMake
-DARROW_JAVA_JNI_ENABLE_DEFAULT=OFF ^
-DBUILD_TESTING=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DCMAKE_INSTALL_LIBDIR=lib/x86_64 ^
-DCMAKE_INSTALL_PREFIX=java-dist
$ cmake --build java-cdata --target install --config Release
$ dir "java-dist/bin"
Expand Down Expand Up @@ -219,7 +219,7 @@ CMake
-DARROW_S3=ON \
-DARROW_USE_CCACHE=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_LIBDIR=lib/<your system's architecture> \
-DCMAKE_INSTALL_PREFIX=java-dist \
-DCMAKE_UNITY_BUILD=ON
$ cmake --build cpp-jni --target install --config Release
Expand All @@ -230,11 +230,11 @@ CMake
-DARROW_JAVA_JNI_ENABLE_DEFAULT=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_LIBDIR=lib/<your system's architecture> \
-DCMAKE_INSTALL_PREFIX=java-dist \
-DCMAKE_PREFIX_PATH=$PWD/java-dist
$ cmake --build java-jni --target install --config Release
$ ls -latr java-dist/lib/*_{jni,java}.*
$ ls -latr java-dist/lib/<your system's architecture>/*_{jni,java}.*
|__ libarrow_dataset_jni.dylib
|__ libarrow_orc_jni.dylib
|__ libgandiva_jni.dylib
Expand Down Expand Up @@ -265,7 +265,7 @@ CMake
-DARROW_WITH_ZLIB=ON ^
-DARROW_WITH_ZSTD=ON ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DCMAKE_INSTALL_LIBDIR=lib/x86_64 ^
-DCMAKE_INSTALL_PREFIX=java-dist ^
-DCMAKE_UNITY_BUILD=ON ^
-GNinja
Expand All @@ -282,7 +282,7 @@ CMake
-DARROW_JAVA_JNI_ENABLE_PLASMA=OFF ^
-DBUILD_TESTING=OFF ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_LIBDIR=lib ^
-DCMAKE_INSTALL_LIBDIR=lib/x86_64 ^
-DCMAKE_INSTALL_PREFIX=java-dist ^
-DCMAKE_PREFIX_PATH=$PWD/java-dist
$ cmake --build java-jni --target install --config Release
Expand All @@ -296,7 +296,7 @@ Archery

$ cd arrow
$ archery docker run java-jni-manylinux-2014
$ ls -latr java-dist/
$ ls -latr java-dist/<your system's architecture>/
|__ libarrow_cdata_jni.so
|__ libarrow_dataset_jni.so
|__ libarrow_orc_jni.so
Expand Down
19 changes: 19 additions & 0 deletions java/Brewfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

brew "openjdk@11"
brew "sccache"
Loading