This is an automated email from the ASF dual-hosted git repository.

thisisnic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 2d447c467b GH-36193: [R] arm64 binaries for R  (#48574)
2d447c467b is described below

commit 2d447c467b745fd2854610696d76531809a7f196
Author: Nic Crane <[email protected]>
AuthorDate: Wed Feb 4 09:12:12 2026 -0500

    GH-36193: [R] arm64 binaries for R  (#48574)
    
    ### Rationale for this change
    
    Issues building on ARM
    
    ### What changes are included in this PR?
    
    CI job and nixlibs update
    
    ### Are these changes tested?
    
    On CI
    
    ### Are there any user-facing changes?
    
    No
    
    AI changes :robot:: Claude decided where to make the changes and helped 
debug failing builds, but I updated most of it (e.g. rstudio -> posit, choice 
of runners etc)
    
    * GitHub Issue: #36193
    
    Authored-by: Nic Crane <[email protected]>
    Signed-off-by: Nic Crane <[email protected]>
---
 compose.yaml                          |  2 +-
 dev/tasks/macros.jinja                |  6 +++--
 dev/tasks/r/github.linux.versions.yml |  4 ++--
 dev/tasks/r/github.packages.yml       | 42 +++++++++++++++++++++++------------
 r/tools/nixlibs.R                     | 12 ++++++++--
 r/tools/test-nixlibs.R                |  4 ++--
 6 files changed, 47 insertions(+), 23 deletions(-)

diff --git a/compose.yaml b/compose.yaml
index 8ca006b60f..87b7930001 100644
--- a/compose.yaml
+++ b/compose.yaml
@@ -1749,7 +1749,7 @@ services:
       cache_from:
         - ${REPO}:r-rstudio-r-base-4.2-focal-revdepcheck
       args:
-        base: rstudio/r-base:4.2-focal
+        base: posit/r-base:4.2-focal
         r_dev: ${ARROW_R_DEV}
         tz: ${TZ}
     shm_size: *shm-size
diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja
index 01541dcecb..60c38dbbc4 100644
--- a/dev/tasks/macros.jinja
+++ b/dev/tasks/macros.jinja
@@ -223,11 +223,13 @@ env:
       path: repo/libarrow
   {% endif %}
   {% if get_nix %}
-  - name: Get Linux binary
+    {% for arch in ["x86_64", "arm64"] %}
+  - name: Get Linux {{ arch }} binary
     uses: actions/download-artifact@v4
     with:
-      name: r-libarrow-linux-x86_64
+      name: r-libarrow-linux-{{ arch }}
       path: repo/libarrow
+    {% endfor %}
   {% endif %}
   {% if get_mac %}
     {% for arch in ["x86_64", "arm64"] %}
diff --git a/dev/tasks/r/github.linux.versions.yml 
b/dev/tasks/r/github.linux.versions.yml
index b7b55ca825..e5ed151a93 100644
--- a/dev/tasks/r/github.linux.versions.yml
+++ b/dev/tasks/r/github.linux.versions.yml
@@ -21,12 +21,12 @@
 
 jobs:
   r-versions:
-    name: "rstudio/r-base:{{ MATRIX }}-jammy"
+    name: "posit/r-base:{{ MATRIX }}-jammy"
     runs-on: ubuntu-latest
     strategy:
       fail-fast: false
       matrix:
-        # See https://hub.docker.com/r/rstudio/r-base
+        # See https://hub.docker.com/r/posit/r-base
         r_version:
           # We test devel, release, and oldrel in regular CI.
           # This is for older versions
diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml
index 40d3457292..3fca3b37e8 100644
--- a/dev/tasks/r/github.packages.yml
+++ b/dev/tasks/r/github.packages.yml
@@ -110,14 +110,22 @@ jobs:
             {{ '${{ env.PKG_FILE }}' }}.sha512
 
   linux-cpp:
-    name: C++ Binary Linux
-    runs-on: ubuntu-latest
+    name: C++ Binary Linux {{ '${{ matrix.arch }}' }}
+    runs-on: {{ '${{ matrix.runs-on }}' }}
     needs: source
     strategy:
       fail-fast: false
+      matrix:
+        include:
+          - arch: x86_64
+            runs-on: ubuntu-latest
+            ubuntu: "22.04"
+          - arch: arm64
+            runs-on: ubuntu-24.04-arm
+            ubuntu: "22.04"
     env:
-      PKG_ID: r-libarrow-linux-x86_64
-      PKG_FILE: r-libarrow-linux-x86_64-{{ '${{ 
needs.source.outputs.pkg_version }}' }}.zip
+      PKG_ID: r-libarrow-linux-{{ '${{ matrix.arch }}' }}
+      PKG_FILE: r-libarrow-linux-{{ '${{ matrix.arch }}' }}-{{ '${{ 
needs.source.outputs.pkg_version }}' }}.zip
     steps:
       {{ macros.github_checkout_arrow()|indent }}
       {{ macros.github_change_r_pkg_version(is_fork, '${{ 
needs.source.outputs.pkg_version }}')|indent }}
@@ -125,7 +133,8 @@ jobs:
       - name: Build libarrow
         shell: bash
         env:
-          UBUNTU: "22.04"
+          ARCH: {{ "${{ matrix.arch == 'x86_64' && 'amd64' || 'arm64v8' }}" }}
+          UBUNTU: {{ '${{ matrix.ubuntu }}' }}
         {{ macros.github_set_sccache_envvars()|indent(8) }}
         run: |
           source arrow/ci/scripts/util_enable_core_dumps.sh
@@ -291,8 +300,8 @@ jobs:
           path: arrow_*
   test-linux-binary:
     needs: [source, linux-cpp]
-    name: Test binary {{ '${{ matrix.config.image }}' }}
-    runs-on: ubuntu-latest
+    name: Test binary {{ '${{ matrix.config.image }}' }} {{ '${{ 
matrix.config.runner }}' }}
+    runs-on: {{ '${{ matrix.config.runner }}' }}
     container: {{ '${{ matrix.config.image }}' }}
     strategy:
       fail-fast: false
@@ -303,13 +312,18 @@ jobs:
           # an OS that is not in the allowlist, so we have to opt-in to use the
           # binary. Other env vars used in r_docker_configure.sh can be added
           # here and wired up in the later steps.
-          - {image: "rhub/ubuntu-clang", libarrow_binary: "TRUE"}
+          # x86_64 tests
+          - {image: "rhub/ubuntu-clang", libarrow_binary: "TRUE", runner: 
"ubuntu-latest"}
           # fedora-clang-devel cannot use binaries bc of libc++ (uncomment to 
see the error)
-          # - {image: "rhub/fedora-clang-devel", libarrow_binary: "TRUE"}
-          - {image: "rhub/ubuntu-release"} # currently ubuntu-22.04
-          - {image: "rstudio/r-base:4.1-jammy"}
-          - {image: "rstudio/r-base:4.2-jammy"}
-          - {image: "rstudio/r-base:4.3-noble"}
+          # - {image: "rhub/fedora-clang-devel", libarrow_binary: "TRUE", 
runner: "ubuntu-latest"}
+          - {image: "rhub/ubuntu-release", runner: "ubuntu-latest"} # 
currently ubuntu-24.04
+          - {image: "posit/r-base:4.3-noble", runner: "ubuntu-latest"}
+          - {image: "posit/r-base:4.4-noble", runner: "ubuntu-latest"}
+          - {image: "posit/r-base:4.5-noble", runner: "ubuntu-latest"}
+          # ARM64 tests
+          - {image: "posit/r-base:4.3-noble", runner: "ubuntu-24.04-arm"}
+          - {image: "posit/r-base:4.4-noble", runner: "ubuntu-24.04-arm"}
+          - {image: "posit/r-base:4.5-noble", runner: "ubuntu-24.04-arm"}
     steps:
       # Get the arrow checkout just for the docker config scripts
       # Don't need submodules for this (hence false arg to macro): they fail on
@@ -350,7 +364,7 @@ jobs:
     if: false
     needs: test-linux-binary
     runs-on: ubuntu-latest
-    container: "rstudio/r-base:4.2-centos7"
+    container: "posit/r-base:4.2-centos7"
     steps:
       - uses: actions/download-artifact@v4
         with:
diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R
index 151dd47f5d..d50191ac18 100644
--- a/r/tools/nixlibs.R
+++ b/r/tools/nixlibs.R
@@ -255,13 +255,21 @@ check_allowlist <- function(
   any(grepl(paste(allowlist, collapse = "|"), os))
 }
 
+normalise_arch <- function(arch) {
+  if (arch %in% c("aarch64", "arm64")) {
+    return("arm64")
+  }
+  arch
+}
+
 select_binary <- function(
   os = tolower(Sys.info()[["sysname"]]),
   arch = tolower(Sys.info()[["machine"]]),
   test_program = test_for_curl_and_openssl
 ) {
-  if (identical(os, "darwin") || (identical(os, "linux") && identical(arch, 
"x86_64"))) {
-    # We only host x86 linux binaries and x86 & arm64 macos today
+  arch <- normalise_arch(arch)
+
+  if (identical(os, "darwin") || identical(os, "linux")) {
     binary <- tryCatch(
       # Somehow the test program system2 call errors on the sanitizer builds
       # so globally handle the possibility that this could fail
diff --git a/r/tools/test-nixlibs.R b/r/tools/test-nixlibs.R
index b1d6214fd8..f7711c97ce 100644
--- a/r/tools/test-nixlibs.R
+++ b/r/tools/test-nixlibs.R
@@ -52,8 +52,8 @@ test_that("identify_binary() based on LIBARROW_BINARY", {
 
 test_that("select_binary() based on system", {
   expect_output(
-    expect_null(select_binary("linux", arch = "aarch64")), # Not built today
-    "Building on linux aarch64"
+    expect_null(select_binary("freebsd", arch = "x86_64")),
+    "Building on freebsd x86_64"
   )
 })
 

Reply via email to