This is an automated email from the ASF dual-hosted git repository.
kou pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-java.git
The following commit(s) were added to refs/heads/main by this push:
new fd5fb7cbb GH-1497: [CI] Compute pom.xml paths without Python in
build.sh (#1498)
fd5fb7cbb is described below
commit fd5fb7cbb4ac8e77e318d87330f1ddf7a50f844a
Author: Andy Grove <[email protected]>
AuthorDate: Tue Nov 24 18:03:15 2026 -0700
GH-1497: [CI] Compute pom.xml paths without Python in build.sh (#1498)
## What's Changed
macOS does not ship a `python` executable, so `ci/scripts/build.sh`
failed when the release verification script built the source release on
macOS.
The script now runs `find` from inside `source_dir` to get relative
paths. This removes the Python dependency and the macOS-specific branch,
so Linux and macOS use the same code path.
Closes #1497.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
ci/scripts/build.sh | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/ci/scripts/build.sh b/ci/scripts/build.sh
index 146a40cf7..a790f11b1 100755
--- a/ci/scripts/build.sh
+++ b/ci/scripts/build.sh
@@ -43,17 +43,11 @@ cp -r "${source_dir}/arrow-format" "${build_dir}"
cp -r "${source_dir}/dev" "${build_dir}"
# Instead of hardcoding the list of directories to copy, find pom.xml and then
-# crawl back up to the top. GNU realpath has --relative-to but this does not
-# work on macOS
-
-poms=$(find "${source_dir}" -not \( -path "${source_dir}"/build -prune \)
-type f -name pom.xml)
-if [[ "$OSTYPE" == "darwin"* ]]; then
- poms=$(echo "$poms" | xargs -n1 python -c "import sys; import os.path;
print(os.path.relpath(sys.argv[1], '${source_dir}'))")
-else
- poms=$(echo "$poms" | xargs -n1 realpath -s --relative-to="${source_dir}")
-fi
+# crawl back up to the top.
+poms=$(cd "${source_dir}" && find . -not \( -path ./build -prune \) -type f
-name pom.xml)
-for source_root in $(echo "${poms}" | awk -F/ '{print $1}' | sort -u); do
+# ./dataset/pom.xml -> dataset
+for source_root in $(echo "${poms}" | awk -F/ '{print $2}' | sort -u); do
cp -r "${source_dir}/${source_root}" "${build_dir}"
done