From 0c35e6987fd9118d40d93e29b374461673bf1564 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Sun, 29 Nov 2026 12:43:40 +0000 Subject: [PATCH 1/5] Test on arm --- .github/workflows/r.yml | 72 +++++++++++++++++++++++++++++++++++ ci/scripts/r_windows_build.sh | 44 +++++++++++++++------ 2 files changed, 104 insertions(+), 12 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index c13bc925adb..05ff1fe7bc1 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -252,6 +252,78 @@ jobs: name: libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip path: libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip + # TEMPORARY (GH-50612): find out whether libarrow builds with the Rtools45 + # aarch64 toolchain. Remove before the PR. + windows-arm64-cpp: + name: ARM64 Windows C++ RTools 45 + runs-on: windows-11-arm + timeout-minutes: 180 + steps: + - run: git config --global core.autocrlf false + - name: Checkout Arrow + uses: actions/checkout@v7 + with: + persist-credentials: false + fetch-depth: 0 + - uses: r-lib/actions/setup-r@v2 + with: + r-version: "4.5" + Ncpus: 2 + - name: Report toolchain + if: ${{ !cancelled() }} + continue-on-error: true + shell: bash + run: | + set -x + uname -a || true + env | grep -i -E "rtools|^R_|MSYSTEM|PROCESSOR|^PATH=" || true + ls -d /c/rtools* || true + for d in /c/rtools*; do ls "$d" || true; done + which bash gcc g++ clang clang++ cmake make pkg-config zip || true + gcc --version || true + clang --version || true + cmake --version || true + for t in /c/rtools*/*-w64-mingw32.static.posix; do + ls "$t" "$t/bin" "$t/lib" || true + "$t/bin/clang" --version || true + "$t/bin/gcc" --version || true + "$t/bin/cmake" --version || true + cat "$t/lib/pkgconfig/libcurl.pc" || true + done + - name: Report R + if: ${{ !cancelled() }} + continue-on-error: true + shell: Rscript {0} + run: | + print(R.version) + print(Sys.info()) + print(.Platform) + print(Sys.getenv(c("R_HOME", "R_ARCH", "R_ARCH_BIN", "RTOOLS45_HOME", "RTOOLS45_AARCH64_HOME"))) + print(Sys.which(c("gcc", "clang", "make", "cmake", "pkg-config"))) + for (v in c("CXX20", "CXX20STD", "CXX20FLAGS", "CC", "LOCAL_SOFT")) { + cat(v, ": ", sep = "") + system2(file.path(R.home("bin"), "R"), c("CMD", "config", v)) + } + for (f in list.files(R.home("etc"), "Makeconf", recursive = TRUE, full.names = TRUE)) { + cat("==", f, "==\n") + lines <- readLines(f) + writeLines(grep("R_ARCH|LOCAL_SOFT|COMPILED_BY|CRT|^CXX|^CC |WIN ?=|BINPREF", lines, value = TRUE)) + } + - name: Build Arrow C++ + if: ${{ !cancelled() }} + shell: bash + env: + RTOOLS_VERSION: 45 + RTOOLS_ARCH: aarch64 + run: ci/scripts/r_windows_build.sh + - name: Rename libarrow.zip + shell: bash + run: mv libarrow.zip libarrow-rtools45-aarch64.zip + - uses: actions/upload-artifact@v7 + with: + name: libarrow-rtools45-aarch64.zip + path: libarrow-rtools45-aarch64.zip + windows-r: needs: [windows-cpp] name: AMD64 Windows R ${{ matrix.config.rversion }} diff --git a/ci/scripts/r_windows_build.sh b/ci/scripts/r_windows_build.sh index ebecb7d3f33..746831257df 100755 --- a/ci/scripts/r_windows_build.sh +++ b/ci/scripts/r_windows_build.sh @@ -32,8 +32,27 @@ ARROW_HOME="$(cd "${ARROW_HOME}" && pwd)" export ARROW_HOME : "${RTOOLS_VERSION:=45}" -: "${RTOOLS_HOME:=/c/rtools${RTOOLS_VERSION}}" -TOOLCHAIN="${RTOOLS_HOME}/x86_64-w64-mingw32.static.posix" +# x86_64 or aarch64 +: "${RTOOLS_ARCH:=x86_64}" +case "${RTOOLS_ARCH}" in + x86_64) + : "${RTOOLS_HOME:=/c/rtools${RTOOLS_VERSION}}" + LIB_SUBDIR="x64-ucrt" + ;; + aarch64) + : "${RTOOLS_HOME:=/c/rtools${RTOOLS_VERSION}-aarch64}" + LIB_SUBDIR="aarch64-ucrt" + # The aarch64 toolchain is LLVM. Without this CMake tries gcc first and + # could find one for another architecture elsewhere on PATH. + export CC="${CC:-clang}" + export CXX="${CXX:-clang++}" + ;; + *) + echo "Unknown RTOOLS_ARCH: ${RTOOLS_ARCH}" >&2 + exit 1 + ;; +esac +TOOLCHAIN="${RTOOLS_HOME}/${RTOOLS_ARCH}-w64-mingw32.static.posix" export PATH="${TOOLCHAIN}/bin:${RTOOLS_HOME}/usr/bin:${PATH}" # CMake is a native Windows program, so give it Windows-style paths @@ -44,8 +63,8 @@ INSTALL_DIR="${BUILD_DIR}/install" INSTALL_DIR_WIN="$(cygpath -am "${INSTALL_DIR}")" printenv -gcc --version -g++ --version +"${CC:-gcc}" --version +"${CXX:-g++}" --version cmake --version make --version | head -n 1 ls "${TOOLCHAIN}/lib" @@ -126,18 +145,19 @@ popd ccache --show-stats || echo "ccache not found" VERSION="$(grep Version "${ARROW_HOME}/r/DESCRIPTION" | cut -d " " -f 2)" -DST_DIR="r-libarrow-windows-x86_64-rtools${RTOOLS_VERSION}-${VERSION}" +DST_DIR="r-libarrow-windows-${RTOOLS_ARCH}-rtools${RTOOLS_VERSION}-${VERSION}" # Make the zip layout r/configure.win expects: include/ and lib/x64-ucrt/ +# (lib/aarch64-ucrt/ for aarch64) pushd "${BUILD_DIR}" rm -rf "${DST_DIR}" -mkdir -p "${DST_DIR}/lib/x64-ucrt" +mkdir -p "${DST_DIR}/lib/${LIB_SUBDIR}" cp -r install/include "${DST_DIR}/include" -cp install/lib/*.a "${DST_DIR}/lib/x64-ucrt/" +cp install/lib/*.a "${DST_DIR}/lib/${LIB_SUBDIR}/" # Rtools libraries in PKG_LIBS in r/configure.win; keep in sync for lib in z zstd lz4 bz2 crypto ssl curl; do - cp "${TOOLCHAIN}/lib/lib${lib}.a" "${DST_DIR}/lib/x64-ucrt/" + cp "${TOOLCHAIN}/lib/lib${lib}.a" "${DST_DIR}/lib/${LIB_SUBDIR}/" done # cURL's link dependencies vary by Rtools version, so read them from @@ -159,7 +179,7 @@ while read -r flag; do curl | z | zstd | ssl | crypto) ;; # already copied above *) if [ -f "${TOOLCHAIN}/lib/lib${lib}.a" ]; then - cp "${TOOLCHAIN}/lib/lib${lib}.a" "${DST_DIR}/lib/x64-ucrt/" + cp "${TOOLCHAIN}/lib/lib${lib}.a" "${DST_DIR}/lib/${LIB_SUBDIR}/" fi ;; esac @@ -175,9 +195,9 @@ case " ${CURL_LIBS} " in exit 1 ;; esac -echo "${CURL_LIBS}${CURL_SYS_LIBS}" >"${DST_DIR}/lib/x64-ucrt/libcurl.libs" -cat "${DST_DIR}/lib/x64-ucrt/libcurl.libs" -ls -la "${DST_DIR}/lib/x64-ucrt" +echo "${CURL_LIBS}${CURL_SYS_LIBS}" >"${DST_DIR}/lib/${LIB_SUBDIR}/libcurl.libs" +cat "${DST_DIR}/lib/${LIB_SUBDIR}/libcurl.libs" +ls -la "${DST_DIR}/lib/${LIB_SUBDIR}" # Create build artifact zip -r "${DST_DIR}.zip" "${DST_DIR}" From 643fb93a0c7827c75f399e30de10d154c529667c Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Sun, 29 Nov 2026 13:30:36 +0000 Subject: [PATCH 2/5] Try linking arrow cpp to arrow r on arm --- .github/workflows/r.yml | 76 +++++++++++++++++++++++++++++++++++++++++ r/configure.win | 12 +++++-- r/tools/nixlibs.R | 10 ++++-- r/tools/test-nixlibs.R | 22 ++++++++++++ 4 files changed, 115 insertions(+), 5 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 05ff1fe7bc1..d53f9413c59 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -324,6 +324,82 @@ jobs: name: libarrow-rtools45-aarch64.zip path: libarrow-rtools45-aarch64.zip + # TEMPORARY (GH-50612): link the R package against the aarch64 libarrow and + # run R CMD check. Remove before the PR. Differences from windows-r: no + # MinIO (ci/scripts/install_minio.sh has no windows-arm64 checksum), no + # -Werror, R 4.5 rather than release. + windows-arm64-r: + needs: [windows-arm64-cpp] + name: ARM64 Windows R 4.5 + runs-on: windows-11-arm + timeout-minutes: 180 + env: + _R_CHECK_TESTS_NLINES_: 0 + steps: + - run: git config --global core.autocrlf false + - name: Checkout Arrow + uses: actions/checkout@v7 + with: + persist-credentials: false + fetch-depth: 0 + - name: Download Timezone Database + shell: bash + run: ci/scripts/download_tz_database.sh + - run: mkdir r/windows + - name: Download artifacts + uses: actions/download-artifact@v8 + with: + name: libarrow-rtools45-aarch64.zip + path: r/windows + - name: Unzip and rezip libarrows + shell: bash + run: | + cd r/windows + ls *.zip | xargs -n 1 unzip -uo + rm -rf *.zip + - uses: r-lib/actions/setup-r@v2 + with: + r-version: "4.5" + Ncpus: 2 + - uses: r-lib/actions/setup-r-dependencies@v2 + env: + GITHUB_PAT: "${{ github.token }}" + with: + cache: false + working-directory: 'r' + extra-packages: | + any::rcmdcheck + - name: Check + shell: Rscript {0} + run: | + setwd("r/windows") + zip("libarrow.zip", ".") + setwd("..") + + Sys.setenv( + RWINLIB_LOCAL = file.path(Sys.getenv("GITHUB_WORKSPACE"), "r", "windows", "libarrow.zip"), + MAKEFLAGS = paste0("-j", parallel::detectCores()), + ARROW_R_DEV = TRUE, + "_R_CHECK_FORCE_SUGGESTS_" = FALSE, + "_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_" = TRUE, + "_R_CHECK_DONTTEST_EXAMPLES_" = TRUE + ) + rcmdcheck::rcmdcheck(".", + build_args = '--no-build-vignettes', + args = c('--no-manual', '--as-cran', '--ignore-vignettes'), + error_on = 'warning', + check_dir = 'check', + timeout = 3600 + ) + - name: Dump install logs + shell: cmd + run: cat r/check/arrow.Rcheck/00install.out + if: always() + - name: Dump test logs + shell: bash + run: find r/check -name 'testthat.Rout*' -exec cat '{}' \; || true + if: always() + windows-r: needs: [windows-cpp] name: AMD64 Windows R ${{ matrix.config.rversion }} diff --git a/r/configure.win b/r/configure.win index 23869ed5e4d..3cc1d0fb381 100755 --- a/r/configure.win +++ b/r/configure.win @@ -87,7 +87,13 @@ function configure_binaries() { # (GH-55165). UTF8PROC_SNAPPY_LIBS="-lutf8proc -lsnappy" RE2_LIBS="-lre2" - CURL_LIBS_FILE="${RWINLIB#../}/lib/x64-ucrt/libcurl.libs" + # The zip's lib dir is lib/x64-ucrt, or lib/aarch64-ucrt in the aarch64 zip. + # It isn't built from $(R_ARCH) because that is empty in aarch64 R. + case "$("${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e 'cat(R.version$arch)')" in + aarch64) RWINLIB_ARCH_DIR="aarch64-ucrt" ;; + *) RWINLIB_ARCH_DIR="x64-ucrt" ;; + esac + CURL_LIBS_FILE="${RWINLIB#../}/lib/${RWINLIB_ARCH_DIR}/libcurl.libs" if [ -f "${CURL_LIBS_FILE}" ]; then UTF8PROC_SNAPPY_LIBS="" RE2_LIBS="" @@ -100,11 +106,11 @@ function configure_binaries() { -DARROW_R_WITH_DATASET -DARROW_R_WITH_JSON \ -DARROW_R_WITH_S3 -DARROW_R_WITH_GCS" # -DARROW_R_WITH_AZURE PKG_LIBS="-L${RWINLIB}/lib"'$(subst gcc,,$(COMPILED_BY))$(R_ARCH) ' - PKG_LIBS="$PKG_LIBS -L${RWINLIB}/lib"'$(R_ARCH)$(CRT) ' + PKG_LIBS="$PKG_LIBS -L${RWINLIB}/lib/${RWINLIB_ARCH_DIR} " PKG_LIBS="$PKG_LIBS -larrow_dataset -larrow_acero -lparquet -larrow_compute -larrow_s3 \ -larrow_gcs \$(if \$(wildcard \ ${RWINLIB}/lib\$(subst gcc,,\$(COMPILED_BY))\$(R_ARCH)/libarrow_gcs_bundled_dependencies.a \ - ${RWINLIB}/lib\$(R_ARCH)\$(CRT)/libarrow_gcs_bundled_dependencies.a),-larrow_gcs_bundled_dependencies) -larrow \ + ${RWINLIB}/lib/${RWINLIB_ARCH_DIR}/libarrow_gcs_bundled_dependencies.a),-larrow_gcs_bundled_dependencies) -larrow \ -larrow_bundled_dependencies \ ${UTF8PROC_SNAPPY_LIBS} -lz -lzstd -llz4 -lbz2 -lole32 \ ${MIMALLOC_LIBS} ${OPENSSL_LIBS} ${RE2_LIBS} ${AWS_LIBS} ${GCS_LIBS}" # ${AZURE_LIBS} diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 9c217d5839a..e7692c86279 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -200,14 +200,20 @@ download_binary <- function(lib) { # * "darwin-x86_64" # These string values, along with `NULL`, are the potential return values of # this function. On Windows, LIBARROW_BINARY is ignored and the binary is -# chosen by R version: "windows-x86_64-rtools40" or "windows-x86_64-rtools45". +# chosen by architecture and R version: "windows-aarch64-rtools45", +# "windows-x86_64-rtools40" or "windows-x86_64-rtools45". identify_binary <- function( lib = Sys.getenv("LIBARROW_BINARY"), info = distro(), - r_version = getRversion() + r_version = getRversion(), + # The architecture R was built for, as in configure.win, not the machine's + arch = tolower(R.version$arch) ) { if (on_windows) { if (VERSION_22_OR_LATER) { + if (normalise_arch(arch) == "arm64") { + return("windows-aarch64-rtools45") + } # The binary built with Rtools45 can't be linked by Rtools43 or earlier, # which R < 4.4 uses, so those get the one built with Rtools40. if (package_version(r_version) < "4.4") { diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R index 5de1d2015fb..472104db0e9 100644 --- a/r/tools/test-nixlibs.R +++ b/r/tools/test-nixlibs.R @@ -496,3 +496,25 @@ test_that("identify_binary() picks the Windows binary by R version", { expect_identical(identify_binary(r_version = "4.4.0"), "windows-x86_64-rtools45") expect_identical(identify_binary(r_version = "4.6.0"), "windows-x86_64-rtools45") }) + +test_that("identify_binary() picks the Windows binary by architecture", { + local_binding("on_windows", TRUE) + local_binding("VERSION_22_OR_LATER", TRUE) + + expect_identical( + identify_binary(r_version = "4.5.3", arch = "aarch64"), + "windows-aarch64-rtools45" + ) + expect_identical( + identify_binary(r_version = "4.5.3", arch = "arm64"), + "windows-aarch64-rtools45" + ) + expect_identical( + identify_binary(r_version = "4.5.3", arch = "x86_64"), + "windows-x86_64-rtools45" + ) + expect_identical( + identify_binary(r_version = "4.3.3", arch = "x86_64"), + "windows-x86_64-rtools40" + ) +}) From b3c9b42ff3ce6884528dbe969cd8cdf1395ba31f Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Sun, 29 Nov 2026 17:36:01 +0000 Subject: [PATCH 3/5] r-release and duckdb binary --- .github/workflows/r.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index d53f9413c59..c59cb4cc3de 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -327,10 +327,10 @@ jobs: # TEMPORARY (GH-50612): link the R package against the aarch64 libarrow and # run R CMD check. Remove before the PR. Differences from windows-r: no # MinIO (ci/scripts/install_minio.sh has no windows-arm64 checksum), no - # -Werror, R 4.5 rather than release. + # -Werror. windows-arm64-r: needs: [windows-arm64-cpp] - name: ARM64 Windows R 4.5 + name: ARM64 Windows R release runs-on: windows-11-arm timeout-minutes: 180 env: @@ -359,8 +359,22 @@ jobs: rm -rf *.zip - uses: r-lib/actions/setup-r@v2 with: - r-version: "4.5" + r-version: "release" Ncpus: 2 + - name: Install duckdb binary + shell: Rscript {0} + run: | + # CRAN has no Windows aarch64 binaries, and duckdb 2.0.1 takes 40 + # minutes to compile on this runner. r-universe builds aarch64 + # binaries for R 4.6, in a separate index from its x86_64 ones. + r_minor <- paste(R.version$major, sub("\\..*", "", R.version$minor), sep = ".") + install.packages( + "duckdb", + contriburl = paste0("https://cran.r-universe.dev/bin/windows/aarch64/contrib/", r_minor), + type = "win.binary" + ) + print(packageDescription("duckdb")$Built) + library(duckdb) - uses: r-lib/actions/setup-r-dependencies@v2 env: GITHUB_PAT: "${{ github.token }}" From 7b9f7a56f45ed2703a25bfc8636e22799751b2a8 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Sun, 29 Nov 2026 18:26:37 +0000 Subject: [PATCH 4/5] remove duckdb workaround --- .github/workflows/r.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index c59cb4cc3de..34eb0c6673a 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -335,6 +335,10 @@ jobs: timeout-minutes: 180 env: _R_CHECK_TESTS_NLINES_: 0 + # setup-r makes https://cran.r-universe.dev the CRAN repository on + # Windows aarch64 with R 4.6.2. It has no src/contrib/PACKAGES.in, so + # the CRAN incoming feasibility check of --as-cran stops R CMD check. + _R_CHECK_CRAN_INCOMING_: false steps: - run: git config --global core.autocrlf false - name: Checkout Arrow @@ -361,20 +365,6 @@ jobs: with: r-version: "release" Ncpus: 2 - - name: Install duckdb binary - shell: Rscript {0} - run: | - # CRAN has no Windows aarch64 binaries, and duckdb 2.0.1 takes 40 - # minutes to compile on this runner. r-universe builds aarch64 - # binaries for R 4.6, in a separate index from its x86_64 ones. - r_minor <- paste(R.version$major, sub("\\..*", "", R.version$minor), sep = ".") - install.packages( - "duckdb", - contriburl = paste0("https://cran.r-universe.dev/bin/windows/aarch64/contrib/", r_minor), - type = "win.binary" - ) - print(packageDescription("duckdb")$Built) - library(duckdb) - uses: r-lib/actions/setup-r-dependencies@v2 env: GITHUB_PAT: "${{ github.token }}" From f8b52daa5d5aa3f1c8e1d7d70b5acf4c0fa69fb6 Mon Sep 17 00:00:00 2001 From: Nic Crane Date: Sun, 29 Nov 2026 19:56:35 +0000 Subject: [PATCH 5/5] Update job matrices etc --- .github/workflows/r.yml | 152 -------------------------------- .github/workflows/r_nightly.yml | 1 + dev/tasks/macros.jinja | 6 +- dev/tasks/r/github.packages.yml | 20 +++-- dev/tasks/tasks.yml | 1 + 5 files changed, 18 insertions(+), 162 deletions(-) diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml index 34eb0c6673a..c13bc925adb 100644 --- a/.github/workflows/r.yml +++ b/.github/workflows/r.yml @@ -252,158 +252,6 @@ jobs: name: libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip path: libarrow-rtools${{ matrix.config.rtools }}-${{ matrix.config.arch }}.zip - # TEMPORARY (GH-50612): find out whether libarrow builds with the Rtools45 - # aarch64 toolchain. Remove before the PR. - windows-arm64-cpp: - name: ARM64 Windows C++ RTools 45 - runs-on: windows-11-arm - timeout-minutes: 180 - steps: - - run: git config --global core.autocrlf false - - name: Checkout Arrow - uses: actions/checkout@v7 - with: - persist-credentials: false - fetch-depth: 0 - - uses: r-lib/actions/setup-r@v2 - with: - r-version: "4.5" - Ncpus: 2 - - name: Report toolchain - if: ${{ !cancelled() }} - continue-on-error: true - shell: bash - run: | - set -x - uname -a || true - env | grep -i -E "rtools|^R_|MSYSTEM|PROCESSOR|^PATH=" || true - ls -d /c/rtools* || true - for d in /c/rtools*; do ls "$d" || true; done - which bash gcc g++ clang clang++ cmake make pkg-config zip || true - gcc --version || true - clang --version || true - cmake --version || true - for t in /c/rtools*/*-w64-mingw32.static.posix; do - ls "$t" "$t/bin" "$t/lib" || true - "$t/bin/clang" --version || true - "$t/bin/gcc" --version || true - "$t/bin/cmake" --version || true - cat "$t/lib/pkgconfig/libcurl.pc" || true - done - - name: Report R - if: ${{ !cancelled() }} - continue-on-error: true - shell: Rscript {0} - run: | - print(R.version) - print(Sys.info()) - print(.Platform) - print(Sys.getenv(c("R_HOME", "R_ARCH", "R_ARCH_BIN", "RTOOLS45_HOME", "RTOOLS45_AARCH64_HOME"))) - print(Sys.which(c("gcc", "clang", "make", "cmake", "pkg-config"))) - for (v in c("CXX20", "CXX20STD", "CXX20FLAGS", "CC", "LOCAL_SOFT")) { - cat(v, ": ", sep = "") - system2(file.path(R.home("bin"), "R"), c("CMD", "config", v)) - } - for (f in list.files(R.home("etc"), "Makeconf", recursive = TRUE, full.names = TRUE)) { - cat("==", f, "==\n") - lines <- readLines(f) - writeLines(grep("R_ARCH|LOCAL_SOFT|COMPILED_BY|CRT|^CXX|^CC |WIN ?=|BINPREF", lines, value = TRUE)) - } - - name: Build Arrow C++ - if: ${{ !cancelled() }} - shell: bash - env: - RTOOLS_VERSION: 45 - RTOOLS_ARCH: aarch64 - run: ci/scripts/r_windows_build.sh - - name: Rename libarrow.zip - shell: bash - run: mv libarrow.zip libarrow-rtools45-aarch64.zip - - uses: actions/upload-artifact@v7 - with: - name: libarrow-rtools45-aarch64.zip - path: libarrow-rtools45-aarch64.zip - - # TEMPORARY (GH-50612): link the R package against the aarch64 libarrow and - # run R CMD check. Remove before the PR. Differences from windows-r: no - # MinIO (ci/scripts/install_minio.sh has no windows-arm64 checksum), no - # -Werror. - windows-arm64-r: - needs: [windows-arm64-cpp] - name: ARM64 Windows R release - runs-on: windows-11-arm - timeout-minutes: 180 - env: - _R_CHECK_TESTS_NLINES_: 0 - # setup-r makes https://cran.r-universe.dev the CRAN repository on - # Windows aarch64 with R 4.6.2. It has no src/contrib/PACKAGES.in, so - # the CRAN incoming feasibility check of --as-cran stops R CMD check. - _R_CHECK_CRAN_INCOMING_: false - steps: - - run: git config --global core.autocrlf false - - name: Checkout Arrow - uses: actions/checkout@v7 - with: - persist-credentials: false - fetch-depth: 0 - - name: Download Timezone Database - shell: bash - run: ci/scripts/download_tz_database.sh - - run: mkdir r/windows - - name: Download artifacts - uses: actions/download-artifact@v8 - with: - name: libarrow-rtools45-aarch64.zip - path: r/windows - - name: Unzip and rezip libarrows - shell: bash - run: | - cd r/windows - ls *.zip | xargs -n 1 unzip -uo - rm -rf *.zip - - uses: r-lib/actions/setup-r@v2 - with: - r-version: "release" - Ncpus: 2 - - uses: r-lib/actions/setup-r-dependencies@v2 - env: - GITHUB_PAT: "${{ github.token }}" - with: - cache: false - working-directory: 'r' - extra-packages: | - any::rcmdcheck - - name: Check - shell: Rscript {0} - run: | - setwd("r/windows") - zip("libarrow.zip", ".") - setwd("..") - - Sys.setenv( - RWINLIB_LOCAL = file.path(Sys.getenv("GITHUB_WORKSPACE"), "r", "windows", "libarrow.zip"), - MAKEFLAGS = paste0("-j", parallel::detectCores()), - ARROW_R_DEV = TRUE, - "_R_CHECK_FORCE_SUGGESTS_" = FALSE, - "_R_CHECK_STOP_ON_INVALID_NUMERIC_VERSION_INPUTS_" = TRUE, - "_R_CHECK_DONTTEST_EXAMPLES_" = TRUE - ) - rcmdcheck::rcmdcheck(".", - build_args = '--no-build-vignettes', - args = c('--no-manual', '--as-cran', '--ignore-vignettes'), - error_on = 'warning', - check_dir = 'check', - timeout = 3600 - ) - - name: Dump install logs - shell: cmd - run: cat r/check/arrow.Rcheck/00install.out - if: always() - - name: Dump test logs - shell: bash - run: find r/check -name 'testthat.Rout*' -exec cat '{}' \; || true - if: always() - windows-r: needs: [windows-cpp] name: AMD64 Windows R ${{ matrix.config.rversion }} diff --git a/.github/workflows/r_nightly.yml b/.github/workflows/r_nightly.yml index 6becf880615..a4a167ea1cd 100644 --- a/.github/workflows/r_nightly.yml +++ b/.github/workflows/r_nightly.yml @@ -179,6 +179,7 @@ jobs: prune repo/libarrow/r-libarrow-linux-x86_64-* || : prune repo/libarrow/r-libarrow-windows-x86_64-rtools40-* || : prune repo/libarrow/r-libarrow-windows-x86_64-rtools45-* || : + prune repo/libarrow/r-libarrow-windows-aarch64-rtools45-* || : - name: Update Repository Index shell: Rscript {0} run: | diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index db775b6e262..56539094796 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -229,11 +229,11 @@ env: shell: bash run: mkdir repo {% if get_win %} - {% for rtools in ["40", "45"] %} - - name: Get windows Rtools{{ rtools }} binary + {% for binary in ["x86_64-rtools40", "x86_64-rtools45", "aarch64-rtools45"] %} + - name: Get windows {{ binary }} binary uses: actions/download-artifact@v4 with: - name: r-libarrow-windows-x86_64-rtools{{ rtools }} + name: r-libarrow-windows-{{ binary }} path: repo/libarrow {% endfor %} {% endif %} diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index 499ad7f0620..b73485bdd0b 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -171,20 +171,22 @@ jobs: {{ '${{ env.PKG_FILE }}' }}.sha512 windows-cpp: - name: C++ Binary Windows RTools {{ '${{ matrix.config.rtools }}' }} + name: C++ Binary Windows {{ '${{ matrix.config.arch }}' }} RTools {{ '${{ matrix.config.rtools }}' }} needs: source - runs-on: windows-latest + runs-on: {{ '${{ matrix.config.runs_on }}' }} strategy: fail-fast: false matrix: config: # R is not used, but setup-r picks Rtools from r-version: R 4.1 was # the last R to use Rtools40. The Rtools40 binary is for R < 4.4. - - { rtools: 40, r: "4.1", script: r_windows_build_rtools40.sh } - - { rtools: 45, r: "4.5", script: r_windows_build.sh } + # On windows-11-arm setup-r installs the aarch64 Rtools45. + - { rtools: 40, arch: x86_64, r: "4.1", script: r_windows_build_rtools40.sh, runs_on: windows-latest } + - { rtools: 45, arch: x86_64, r: "4.5", script: r_windows_build.sh, runs_on: windows-latest } + - { rtools: 45, arch: aarch64, r: "4.5", script: r_windows_build.sh, runs_on: windows-11-arm } env: - PKG_ID: r-libarrow-windows-x86_64-rtools{{ '${{ matrix.config.rtools }}' }} - PKG_FILE: r-libarrow-windows-x86_64-rtools{{ '${{ matrix.config.rtools }}' }}-{{ '${{ needs.source.outputs.pkg_version }}' }}.zip + PKG_ID: r-libarrow-windows-{{ '${{ matrix.config.arch }}' }}-rtools{{ '${{ matrix.config.rtools }}' }} + PKG_FILE: r-libarrow-windows-{{ '${{ matrix.config.arch }}' }}-rtools{{ '${{ matrix.config.rtools }}' }}-{{ '${{ needs.source.outputs.pkg_version }}' }}.zip steps: - run: git config --global core.autocrlf false {{ macros.github_checkout_arrow()|indent }} @@ -202,6 +204,7 @@ jobs: env: ARROW_HOME: "arrow" MINGW_ARCH: "ucrt64" + RTOOLS_ARCH: {{ '${{ matrix.config.arch }}' }} {{ macros.github_set_sccache_envvars()|indent(8) }} run: arrow/ci/scripts/{{ '${{ matrix.config.script }}' }} - name: Create Checksum @@ -234,6 +237,9 @@ jobs: # Tests the Rtools40 libarrow binary, which R < 4.4 downloads. The # R package built here is not uploaded. - { platform: { runs_on: 'windows-latest', name: "Windows"}, r_version: "4.3" } + # Tests the aarch64 libarrow binary. The R package built here is not + # uploaded. + - { platform: { runs_on: 'windows-11-arm', name: "Windows aarch64"}, r_version: "release" } steps: - uses: r-lib/actions/setup-r@v2 with: @@ -314,7 +320,7 @@ jobs: cat(cmd, file = Sys.getenv("GITHUB_OUTPUT"), append = TRUE) - name: Upload binary artifact - if: matrix.r_version != '4.3' + if: matrix.r_version != '4.3' && matrix.platform.name != 'Windows aarch64' uses: actions/upload-artifact@v4 with: name: r-pkg{{ '${{ steps.build.outputs.path }}' }} diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml index dc20595b5de..1eeae9f5ec8 100644 --- a/dev/tasks/tasks.yml +++ b/dev/tasks/tasks.yml @@ -243,6 +243,7 @@ tasks: artifacts: - r-libarrow-windows-x86_64-rtools40-{no_rc_r_version}\.zip - r-libarrow-windows-x86_64-rtools45-{no_rc_r_version}\.zip + - r-libarrow-windows-aarch64-rtools45-{no_rc_r_version}\.zip - r-libarrow-linux-x86_64-{no_rc_r_version}\.zip - r-libarrow-linux-arm64-{no_rc_r_version}\.zip - r-libarrow-darwin-arm64-{no_rc_r_version}\.zip