kou commented on code in PR #441:
URL: https://github.com/apache/arrow-java/pull/441#discussion_r1868419875
##########
.github/workflows/test.yml:
##########
@@ -38,16 +38,21 @@ env:
jobs:
ubuntu:
- name: AMD64 Ubuntu 22.04 JDK ${{ matrix.jdk }} Maven ${{ matrix.maven }}
+ name: ${{ matrix.name }} AMD64 Ubuntu 22.04 JDK ${{ matrix.jdk }} Maven
${{ matrix.maven }}
Review Comment:
Can we use "Ubuntu 24.04" for conda-java-jni-cdata?
(Or we may want to use just "Ubuntu".)
##########
docker-compose.yml:
##########
@@ -35,13 +35,43 @@ services:
# docker compose build java
# docker compose run java
# Parameters:
- # MAVEN: 3.9.6
+ # MAVEN: 3.9.9
# JDK: 11, 17, 21
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
- volumes: &java-volumes
+ volumes:
- .:/arrow-java:delegated
- ${DOCKER_VOLUME_PREFIX}maven-cache:/root/.m2:delegated
- command: &java-command >
+ command:
/bin/bash -c "
/arrow-java/ci/scripts/java_build.sh /arrow-java /build &&
/arrow-java/ci/scripts/java_test.sh /arrow-java /build"
+
+ conda-java-jni-cdata:
Review Comment:
We may want to remove the `-java` part because this repository is only for
the Java implementation.
##########
docker-compose.yml:
##########
@@ -35,13 +35,43 @@ services:
# docker compose build java
# docker compose run java
# Parameters:
- # MAVEN: 3.9.6
+ # MAVEN: 3.9.9
# JDK: 11, 17, 21
image: ${ARCH}/maven:${MAVEN}-eclipse-temurin-${JDK}
- volumes: &java-volumes
+ volumes:
- .:/arrow-java:delegated
- ${DOCKER_VOLUME_PREFIX}maven-cache:/root/.m2:delegated
- command: &java-command >
+ command:
/bin/bash -c "
/arrow-java/ci/scripts/java_build.sh /arrow-java /build &&
/arrow-java/ci/scripts/java_test.sh /arrow-java /build"
+
+ conda-java-jni-cdata:
+ # Usage:
+ # docker compose build java-jni-cdata
+ # docker compose run java-jni-cdata
Review Comment:
```suggestion
# docker compose build conda-java-jni-cdata
# docker compose run conda-java-jni-cdata
```
##########
ci/scripts/java_jni_build.sh:
##########
@@ -0,0 +1,80 @@
+#!/usr/bin/env bash
+# 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.
+
+set -eo pipefail
+
+arrow_dir=${1}
+arrow_install_dir=${2}
+build_dir=${3}/java_jni
+# The directory where the final binaries will be stored when scripts finish
+dist_dir=${4}
+prefix_dir="${build_dir}/java-jni"
+
+echo "=== Clear output directories and leftovers ==="
+# Clear output directories and leftovers
+rm -rf ${build_dir}
+
+echo "=== Building Arrow Java C Data Interface native library ==="
+mkdir -p "${build_dir}"
+pushd "${build_dir}"
+
+case "$(uname)" in
+ Linux)
+ n_jobs=$(nproc)
+ ;;
+ Darwin)
+ n_jobs=$(sysctl -n hw.ncpu)
Review Comment:
In general, `hw.logicalcpu` is better than `hw.ncpu`:
```suggestion
n_jobs=$(sysctl -n hw.logicalcpu)
```
https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_system_capabilities
```quote
hw.activecpu
The number of enabled logical processor cores in the SoC. This is an
alias of hw.logicalcpu.
hw.ncpu
The number of logical processor cores in the SoC. This is an alias of
hw.logicalcpu_max.
hw.logicalcpu
The number of enabled logical processor cores in the SoC. This is an
alias of hw.activecpu.
hw.logicalcpu_max
The number of logical processor cores in the SoC. This is an alias of
hw.ncpu.
hw.physicalcpu
The number of enabled physical processor cores in the SoC.
hw.physicalcpu_max
The number of physical processor cores in the SoC.
```
--
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]