From 03066518bdc20ade4343f708a19aeb79ac59ddc4 Mon Sep 17 00:00:00 2001 From: Logan Riggs Date: Mon, 2 Feb 2026 15:37:17 -0800 Subject: [PATCH 1/3] Change release naming scheme to add commit ids. Add action url to release Add action url to release --- .github/workflows/jarbuild.yml | 63 ++++++++++++++++++++++++++++------ 1 file changed, 52 insertions(+), 11 deletions(-) diff --git a/.github/workflows/jarbuild.yml b/.github/workflows/jarbuild.yml index 5ee2c91ad..d64d778c0 100644 --- a/.github/workflows/jarbuild.yml +++ b/.github/workflows/jarbuild.yml @@ -488,32 +488,73 @@ jobs: permissions: contents: write steps: + - name: Checkout arrow-java repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + - name: Checkout Apache Arrow C++ repository + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: ${{github.event.inputs.arrow_repo}} + ref: ${{github.event.inputs.arrow_branch}} + path: arrow + - name: Get commit IDs + id: commit_ids + run: | + # Get short commit ID for arrow-java + arrow_java_commit=$(git rev-parse --short HEAD) + echo "arrow_java_commit=${arrow_java_commit}" >> $GITHUB_OUTPUT + + # Get short commit ID for arrow + cd arrow + arrow_commit=$(git rev-parse --short HEAD) + echo "arrow_commit=${arrow_commit}" >> $GITHUB_OUTPUT + cd .. + + # Parse version from release tag + ver=$(echo ${{github.event.inputs.release_tag_name}}) + version=${ver%-rc*} + version=${version#v} + rc=${ver#*-rc} + + # Create release name with both commit IDs + release_name="${version}-${arrow_java_commit}-${arrow_commit}" + release_tag="v${release_name}" + echo "release_name=${release_name}" >> $GITHUB_OUTPUT + echo "release_tag=${release_tag}" >> $GITHUB_OUTPUT + echo "version=${version}" >> $GITHUB_OUTPUT + echo "rc=${rc}" >> $GITHUB_OUTPUT + + echo "Arrow Java commit: ${arrow_java_commit}" + echo "Arrow commit: ${arrow_commit}" + echo "Release tag: ${release_tag}" - name: Download release artifacts uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 with: pattern: release-* path: artifacts + - name: Create and push tag + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git tag -a "${{ steps.commit_ids.outputs.release_tag }}" -m "Release ${{ steps.commit_ids.outputs.release_name }} RC${{ steps.commit_ids.outputs.rc }}" -m "Action URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + git push origin "${{ steps.commit_ids.outputs.release_tag }}" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload run: | # GH-499: How to create release notes? - echo "${{github.event.inputs.release_tag_name}}" - ver=$(echo ${{github.event.inputs.release_tag_name}}) - version=${ver%-rc*} - version=${version#v} - rc=${ver#*-rc} - gh release create ${{github.event.inputs.release_tag_name}} \ - --generate-notes \ + echo "Creating release: ${{ steps.commit_ids.outputs.release_tag }}" + gh release create "${{ steps.commit_ids.outputs.release_tag }}" \ + -n "Action URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ --prerelease \ --repo ${GITHUB_REPOSITORY} \ - --title "Apache Arrow Java ${version} RC${rc}" \ - --verify-tag + --title "Apache Arrow Java ${{ steps.commit_ids.outputs.version }} RC${{ steps.commit_ids.outputs.rc }} (arrow-java: ${{ steps.commit_ids.outputs.arrow_java_commit }}, arrow: ${{ steps.commit_ids.outputs.arrow_commit }})" # GitHub CLI does not respect their own rate limits # https://github.com/cli/cli/issues/9586 for artifact in artifacts/*/*; do sleep 1 - gh release upload ${{github.event.inputs.release_tag_name}} \ + gh release upload "${{ steps.commit_ids.outputs.release_tag }}" \ --repo ${GITHUB_REPOSITORY} \ $artifact done env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 12a0370d11425a26111a4bb671d660709f5ae959 Mon Sep 17 00:00:00 2001 From: Logan Riggs Date: Fri, 6 Feb 2026 17:06:23 -0800 Subject: [PATCH 2/3] Mac vcpkg root setting. Old grpc uninstall causing error? fix vcpkg root error Fix vcpgkg llvm for mac. vcpkg vcpkg Go back to brew for build tools. vcpkg just for llvm Update macos path fix path to system files vcpkg vcpkg vcpkg fix re2 dependency Make JNI CMake args more robust - Check if protobuf_ep-install exists before adding Protobuf_ROOT - Check if re2_ep-install exists before adding re2_ROOT - This handles cases where system dependencies are used instead of bundled Use vcpkg RE2 instead of bundled RE2 for macOS Gandiva build vcpkg installs RE2 as a dependency of LLVM. When we use bundled RE2, the Arrow C++ build compiles Gandiva against vcpkg's RE2 headers (which use std::string_view API) but links against bundled RE2 (which uses StringPiece API), causing linker errors. This change uses vcpkg's RE2 for both compilation and linking when vcpkg LLVM is used, ensuring ABI compatibility. --- .github/workflows/jarbuild.yml | 19 +++++---- ci/scripts/jni_macos_build.sh | 76 +++++++++++++++++++++++++++++++++- 2 files changed, 86 insertions(+), 9 deletions(-) diff --git a/.github/workflows/jarbuild.yml b/.github/workflows/jarbuild.yml index d64d778c0..f293ce6c6 100644 --- a/.github/workflows/jarbuild.yml +++ b/.github/workflows/jarbuild.yml @@ -214,12 +214,13 @@ jobs: with: repository: Microsoft/vcpkg path: arrow/vcpkg + fetch-depth: 0 - name: Install vcpkg run: | cd arrow/vcpkg ./bootstrap-vcpkg.sh - echo "VCPKG_ROOT=${PWD}/arrow/vcpkg" >> ${GITHUB_ENV} - echo "${PWD}/arrow/vcpkg" >> ${GITHUB_PATH} + echo "VCPKG_ROOT_LOCAL=${PWD}" >> ${GITHUB_ENV} + echo "${PWD}" >> ${GITHUB_PATH} - name: Clean up disk space run: | echo "=== Free disk space before cleanup ===" @@ -270,25 +271,28 @@ jobs: brew bundle --file=arrow/cpp/Brewfile # Clean up any existing LLVM installations in favor of vcpkg. - brew uninstall llvm || : + # Need to uninstall all versioned LLVM packages (llvm@18, llvm@17, etc.) + for llvm_pkg in $(brew list | grep -E '^llvm(@[0-9]+)?$'); do + brew uninstall "${llvm_pkg}" || : + done # 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 + brew uninstall aws-sdk-cpp || : # We want to use bundled RE2 for static linking. If # Homebrew's RE2 is installed, its header file may be used. # We uninstall Homebrew's RE2 to ensure using bundled RE2. brew uninstall grpc || : # gRPC depends on RE2 brew uninstall grpc@1.54 || : # gRPC 1.54 may be installed too - brew uninstall re2 + brew uninstall re2 || : # We want to use bundled Protobuf for static linking. If # Homebrew's Protobuf is installed, its library file may be # used on test We uninstall Homebrew's Protobuf to ensure using # bundled Protobuf. - brew uninstall protobuf + brew uninstall protobuf || : echo "" echo "=== Free disk space before LLVM build ===" @@ -298,7 +302,8 @@ jobs: # Use vcpkg to install LLVM. vcpkg install \ --clean-after-build \ - --x-install-root=${VCPKG_ROOT}/installed \ + --vcpkg-root=${VCPKG_ROOT_LOCAL} \ + --x-install-root=${VCPKG_ROOT_LOCAL}/installed \ --x-manifest-root=arrow/ci/vcpkg \ --overlay-ports=arrow/ci/vcpkg/overlay/llvm/ \ --x-feature=gandiva-llvm diff --git a/ci/scripts/jni_macos_build.sh b/ci/scripts/jni_macos_build.sh index f7543b6f7..a9c5603cc 100755 --- a/ci/scripts/jni_macos_build.sh +++ b/ci/scripts/jni_macos_build.sh @@ -78,6 +78,55 @@ export ARROW_TEST_DATA="${arrow_dir}/testing/data" export PARQUET_TEST_DATA="${arrow_dir}/cpp/submodules/parquet-testing/data" export AWS_EC2_METADATA_DISABLED=TRUE +# Determine vcpkg triplet based on architecture +vcpkg_arch="$(arch)" +case "${vcpkg_arch}" in +arm64) + vcpkg_triplet="arm64-osx" + ;; +i386|x86_64) + vcpkg_triplet="x64-osx" + ;; +*) + vcpkg_triplet="arm64-osx" + ;; +esac + +# Set LLVM_DIR to point to vcpkg-installed LLVM if VCPKG_ROOT_LOCAL is set +llvm_dir_arg="" +gandiva_cxx_flags="" +osx_sysroot_arg="" +re2_source_arg="-Dre2_SOURCE=BUNDLED" +if [ -n "${VCPKG_ROOT_LOCAL:-}" ]; then + vcpkg_installed="${VCPKG_ROOT_LOCAL}/installed/${vcpkg_triplet}" + llvm_cmake_dir="${vcpkg_installed}/share/llvm" + if [ -d "${llvm_cmake_dir}" ]; then + llvm_dir_arg="-DLLVM_DIR=${llvm_cmake_dir}" + + # vcpkg's clang needs to know where to find system headers + # Arrow's GandivaAddBitcode.cmake uses CMAKE_OSX_SYSROOT to set SDKROOT env var + sdk_path="$(xcrun --show-sdk-path)" + if [ -d "${sdk_path}" ]; then + osx_sysroot_arg="-DCMAKE_OSX_SYSROOT=${sdk_path}" + fi + + # Also pass the C++ standard library include path via ARROW_GANDIVA_PC_CXX_FLAGS + xcode_path="$(xcode-select -p)" + cxx_include_path="${xcode_path}/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1" + if [ -d "${cxx_include_path}" ]; then + gandiva_cxx_flags="-DARROW_GANDIVA_PC_CXX_FLAGS=-stdlib=libc++;-isystem;${cxx_include_path}" + fi + + # Use vcpkg's RE2 since it's installed as a dependency of LLVM + # This ensures ABI compatibility - vcpkg's RE2 uses std::string_view API + # which matches what vcpkg's LLVM and Abseil expect + re2_cmake_dir="${vcpkg_installed}/share/re2" + if [ -d "${re2_cmake_dir}" ]; then + re2_source_arg="-Dre2_ROOT=${vcpkg_installed}" + fi + fi +fi + cmake \ -S "${arrow_dir}/cpp" \ -B "${build_dir}/cpp" \ @@ -100,10 +149,13 @@ cmake \ -DCMAKE_INSTALL_PREFIX="${install_dir}" \ -DCMAKE_UNITY_BUILD="${CMAKE_UNITY_BUILD}" \ -DGTest_SOURCE=BUNDLED \ + ${llvm_dir_arg} \ + ${osx_sysroot_arg} \ + ${gandiva_cxx_flags} \ -DPARQUET_BUILD_EXAMPLES=OFF \ -DPARQUET_BUILD_EXECUTABLES=OFF \ -DPARQUET_REQUIRE_ENCRYPTION=OFF \ - -Dre2_SOURCE=BUNDLED \ + ${re2_source_arg} \ -GNinja cmake --build "${build_dir}/cpp" --target install github_actions_group_end @@ -125,7 +177,27 @@ if [ "${ARROW_RUN_TESTS:-}" == "ON" ]; then github_actions_group_end fi -export JAVA_JNI_CMAKE_ARGS="-DProtobuf_ROOT=${build_dir}/cpp/protobuf_ep-install" +# Pass paths to dependencies so the JNI build can find them +# Build up the JNI CMake args based on what's available +jni_cmake_args="${llvm_dir_arg}" + +# Add Protobuf path if bundled, otherwise CMake will find system Protobuf +if [ -d "${build_dir}/cpp/protobuf_ep-install" ]; then + jni_cmake_args="${jni_cmake_args} -DProtobuf_ROOT=${build_dir}/cpp/protobuf_ep-install" +fi + +# RE2 path for the JNI build - prefer vcpkg's RE2 if we used it for the C++ build, +# otherwise fall back to bundled RE2 if available +if [ -n "${VCPKG_ROOT_LOCAL:-}" ]; then + vcpkg_re2_dir="${VCPKG_ROOT_LOCAL}/installed/${vcpkg_triplet}" + if [ -d "${vcpkg_re2_dir}/share/re2" ]; then + jni_cmake_args="${jni_cmake_args} -Dre2_ROOT=${vcpkg_re2_dir}" + fi +elif [ -d "${build_dir}/cpp/re2_ep-install" ]; then + jni_cmake_args="${jni_cmake_args} -Dre2_ROOT=${build_dir}/cpp/re2_ep-install" +fi + +export JAVA_JNI_CMAKE_ARGS="${jni_cmake_args}" "${source_dir}/ci/scripts/jni_build.sh" \ "${source_dir}" \ "${install_dir}" \ From d0a419c04673d52261c443b3f23bb7a2873dc9ef Mon Sep 17 00:00:00 2001 From: Logan Riggs Date: Fri, 13 Feb 2026 10:41:55 -0800 Subject: [PATCH 3/3] Add username to tag fix release notes --- .github/workflows/jarbuild.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/jarbuild.yml b/.github/workflows/jarbuild.yml index f293ce6c6..296f32ee0 100644 --- a/.github/workflows/jarbuild.yml +++ b/.github/workflows/jarbuild.yml @@ -540,7 +540,10 @@ jobs: run: | git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" - git tag -a "${{ steps.commit_ids.outputs.release_tag }}" -m "Release ${{ steps.commit_ids.outputs.release_name }} RC${{ steps.commit_ids.outputs.rc }}" -m "Action URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + git tag -a "${{ steps.commit_ids.outputs.release_tag }}" \ + -m "Release ${{ steps.commit_ids.outputs.release_name }} RC${{ steps.commit_ids.outputs.rc }}" \ + -m "Triggered by: ${{ github.actor }}" \ + -m "Action URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" git push origin "${{ steps.commit_ids.outputs.release_tag }}" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -549,7 +552,7 @@ jobs: # GH-499: How to create release notes? echo "Creating release: ${{ steps.commit_ids.outputs.release_tag }}" gh release create "${{ steps.commit_ids.outputs.release_tag }}" \ - -n "Action URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + -n "Release ${{ steps.commit_ids.outputs.release_name }} RC${{ steps.commit_ids.outputs.rc }}
Triggered by: ${{ github.actor }}
Action URL: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ --prerelease \ --repo ${GITHUB_REPOSITORY} \ --title "Apache Arrow Java ${{ steps.commit_ids.outputs.version }} RC${{ steps.commit_ids.outputs.rc }} (arrow-java: ${{ steps.commit_ids.outputs.arrow_java_commit }}, arrow: ${{ steps.commit_ids.outputs.arrow_commit }})"