kou commented on code in PR #2686:
URL: https://github.com/apache/arrow-adbc/pull/2686#discussion_r2034750187
##########
.github/workflows/packaging.yml:
##########
@@ -116,10 +115,13 @@ jobs:
tar xf apache-arrow-adbc-${VERSION}.tar.gz
mv apache-arrow-adbc-${VERSION} adbc
+ - name: Get required Go version
+ run: |
+ (. adbc/.env && echo "GO_VERSION=${GO}") >> $GITHUB_ENV
Review Comment:
We can use this style in `java.yml` too. :-)
##########
.github/workflows/java.yml:
##########
@@ -102,3 +102,121 @@ jobs:
HERE
# Our linters are compile-time, no point re-running tests
mvn -P errorprone install -DskipTests
+
+ java-jni-artifacts:
+ name: "JNI Libraries/${{ matrix.platform.os }} ${{ matrix.platform.arch }}"
+ runs-on: ${{ matrix.platform.runner }}
+ strategy:
+ matrix:
+ platform:
+ - { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest }
+ - { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner:
macos-latest }
+ env:
+ VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: actions/setup-java@v4
+ with:
+ cache: "maven"
+ distribution: "temurin"
+ java-version: 11
+ - name: Retrieve Go, VCPKG version from .env
+ id: vcpkg_version
+ run: |
+ vcpkg_version=$(cat ".env" | grep "VCPKG" | cut -d "=" -f2 | tr -d
'"')
Review Comment:
We can simplify this.
```suggestion
vcpkg_version=$(. .env && echo "${VCPKG}")
```
##########
.github/workflows/java.yml:
##########
@@ -102,3 +102,121 @@ jobs:
HERE
# Our linters are compile-time, no point re-running tests
mvn -P errorprone install -DskipTests
+
+ java-jni-artifacts:
+ name: "JNI Libraries/${{ matrix.platform.os }} ${{ matrix.platform.arch }}"
+ runs-on: ${{ matrix.platform.runner }}
+ strategy:
+ matrix:
+ platform:
+ - { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest }
+ - { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner:
macos-latest }
+ env:
+ VCPKG_ROOT: "${{ github.workspace }}/vcpkg"
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ - uses: actions/setup-java@v4
+ with:
+ cache: "maven"
+ distribution: "temurin"
+ java-version: 11
+ - name: Retrieve Go, VCPKG version from .env
+ id: vcpkg_version
+ run: |
+ vcpkg_version=$(cat ".env" | grep "VCPKG" | cut -d "=" -f2 | tr -d
'"')
+ echo "VCPKG_VERSION=$vcpkg_version" | tee -a "$GITHUB_ENV"
+ go_version=$(cat ".env" | grep -E "^GO=" | cut -d "=" -f2 | tr -d
'"')
+ echo "GO_VERSION=$go_version" | tee -a "$GITHUB_ENV"
+ - name: Install vcpkg
+ run: |
+ ./ci/scripts/install_vcpkg.sh $VCPKG_ROOT $VCPKG_VERSION
+ - uses: actions/setup-go@v5
+ with:
+ go-version: "${{ env.GO_VERSION }}"
+ check-latest: true
+ cache: true
+ cache-dependency-path: adbc/go/adbc/go.sum
+ - name: Install Homebrew dependencies
+ if: matrix.platform.os == 'macOS'
+ run: brew install autoconf bash pkg-config ninja
+ - name: Build artifacts
+ if: matrix.platform.os != 'macOS'
+ run: |
+ docker compose run python-wheel-manylinux-build
+ - name: Build artifacts (macOS)
+ if: matrix.platform.os == 'macOS'
+ run: |
+ export ADBC_BUILD_STATIC=ON
+ export ADBC_BUILD_TESTS=OFF
+ export ADBC_USE_ASAN=OFF
+ export ADBC_USE_UBSAN=OFF
+ ./ci/scripts/python_wheel_unix_build.sh ${{ matrix.platform.arch }}
$(pwd) $(pwd)/build
+ - name: Build JNI artifacts
+ run: |
+ export ADBC_BUILD_STATIC=ON
+ export ADBC_BUILD_TESTS=OFF
+ export ADBC_USE_ASAN=OFF
+ export ADBC_USE_UBSAN=OFF
+ ./ci/scripts/java_build.sh $(pwd)
+ ./ci/scripts/java_jni_build.sh $(pwd) $(pwd)/build_jni
$(pwd)/build/${{ matrix.platform.vcpkg_arch }}
+ - name: Assemble artifacts
+ run: |
+ mkdir artifacts
+ cp -r java/driver/jni/src/main/resources/ artifacts/jni
+ cp -r build/${{ matrix.platform.vcpkg_arch }}/lib artifacts/driver
+ ls -laR artifacts
+ mv artifacts artifacts-${{ matrix.platform.os }}-${{
matrix.platform.arch }}
+ tar czf artifacts-${{ matrix.platform.os }}-${{ matrix.platform.arch
}}.tgz artifacts-${{ matrix.platform.os }}-${{ matrix.platform.arch }}
+ - uses: actions/upload-artifact@v4
+ with:
+ name: jni-artifacts-${{ matrix.platform.os }}-${{
matrix.platform.arch }}
+ retention-days: 7
+ path: |
+ artifacts-${{ matrix.platform.os }}-${{ matrix.platform.arch }}.tgz
+
+ java-jni:
+ name: "Java ${{ matrix.java }} JNI/${{ matrix.platform.os }} ${{
matrix.platform.arch }}"
+ runs-on: ${{ matrix.platform.runner }}
+ needs:
+ - java-jni-artifacts
+ strategy:
+ matrix:
+ platform:
+ - { os: Linux, arch: amd64, vcpkg_arch: x64, runner: ubuntu-latest }
+ - { os: macOS, arch: arm64v8, vcpkg_arch: arm64, runner:
macos-latest }
+ java: ['11', '24']
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ persist-credentials: false
+ submodules: recursive
+ - uses: actions/download-artifact@v4
+ with:
+ path: artifacts
+ pattern: jni-artifacts-*
+ merge-multiple: true
+ - uses: actions/setup-java@v4
+ with:
+ cache: "maven"
+ distribution: "temurin"
+ java-version: 11
+ - name: Build/Test
+ run: |
+ set -x
+ pushd artifacts
+ for archive in artifacts*.tgz; do
+ tar xvf $archive
+ done
+ popd
+ cp -r artifacts/*/jni/adbc_driver_jni
java/driver/jni/src/main/resources
+ for drivers in artifacts/*/driver; do
+ export LD_LIBRARY_PATH=$(pwd)/$drivers:${LD_LIBRARY_PATH:-}
+ export DYLD_LIBRARY_PATH=$(pwd)/$drivers:${DYLD_LIBRARY_PATH:-}
Review Comment:
`driver`?
```suggestion
for driver in artifacts/*/driver; do
export LD_LIBRARY_PATH=$(pwd)/$driver:${LD_LIBRARY_PATH:-}
export DYLD_LIBRARY_PATH=$(pwd)/$driver:${DYLD_LIBRARY_PATH:-}
```
##########
.github/workflows/java.yml:
##########
@@ -102,3 +102,121 @@ jobs:
HERE
# Our linters are compile-time, no point re-running tests
mvn -P errorprone install -DskipTests
+
+ java-jni-artifacts:
+ name: "JNI Libraries/${{ matrix.platform.os }} ${{ matrix.platform.arch }}"
+ runs-on: ${{ matrix.platform.runner }}
+ strategy:
+ matrix:
+ platform:
Review Comment:
If we use `include` not `platform` here, we can use `${{ matrix.os }}` not
`${{ matrix.platform.os }}`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]