From 6c675c35349a066c52758dac09e7b08fd990d239 Mon Sep 17 00:00:00 2001 From: Jacob Wujciak-Jens Date: Mon, 12 Sep 2022 19:03:46 +0200 Subject: [PATCH] ARROW-15481: [R] [CI] Add a crossbow job that mimics CRAN's old macOS (#13925) Authored-by: Jacob Wujciak-Jens Signed-off-by: Neal Richardson --- dev/tasks/macros.jinja | 3 +++ dev/tasks/r/github.macos.autobrew.yml | 2 +- dev/tasks/r/github.packages.yml | 34 ++++++++++++++++++--------- r/tools/autobrew | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja index e7099a5163e91..4cf4830cf650e 100644 --- a/dev/tasks/macros.jinja +++ b/dev/tasks/macros.jinja @@ -286,6 +286,9 @@ on: {%- macro github_test_r_src_pkg() -%} source("https://raw.githubusercontent.com/apache/arrow/HEAD/ci/etc/rprofile") + # always remove arrow (mainly for self-hosted runners) + try(remove.packages("arrow"), silent = TRUE) + install.packages( "arrow", repos = c(getOption("arrow.dev_repo"), getOption("repos")), diff --git a/dev/tasks/r/github.macos.autobrew.yml b/dev/tasks/r/github.macos.autobrew.yml index 1633682a430b4..fd5492873db40 100644 --- a/dev/tasks/r/github.macos.autobrew.yml +++ b/dev/tasks/r/github.macos.autobrew.yml @@ -22,7 +22,7 @@ jobs: autobrew: - name: "Autobrew {{ "${{ matrix.platform }}" }}" + name: "Autobrew {{ '${{ matrix.platform }} R ${{ matrix.r-version }}' }}" runs-on: {{ "${{ matrix.platform }}" }} strategy: fail-fast: false diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml index d1a95f64caa51..090735f0fa11a 100644 --- a/dev/tasks/r/github.packages.yml +++ b/dev/tasks/r/github.packages.yml @@ -137,36 +137,45 @@ jobs: matrix: platform: - windows-latest - # This is newer than what CRAN builds on, but Travis is no longer an option for us, so... - - macos-10.15 + - macos-10.13 # self-hosted # - devops-managed # No M1 until the runner application runs native r_version: - { rtools: 40, r: "4.1" } - { rtools: 42, r: "4.2" } steps: - uses: r-lib/actions/setup-r@v2 + if: matrix.platform != 'macos-10.13' with: r-version: {{ '${{ matrix.r_version.r }}' }} rtools-version: {{ '${{ matrix.r_version.rtools }}' }} Ncpus: 2 + - name: Setup R Self-Hosted + if: matrix.platform == 'macos-10.13' + run: | + # rig is a system utility that allows for switching + # between pre-installed R version on the self-hosted runners + rig default {{ '${{ matrix.r_version.r }}' }} + rig system setup-user-lib + rig system add-pak {{ macros.github_setup_local_r_repo(false, true)|indent }} + - name: Prepare Dependency Installation + + shell: bash + run: | + tar -xzf repo/src/contrib/arrow_*.tar.gz arrow/DESCRIPTION + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + working-directory: 'arrow' + extra-packages: cpp11 - name: Build Binary id: build shell: Rscript {0} env: + NOT_CRAN: "true" # actions/setup-r sets this implicitly ARROW_R_DEV: TRUE run: | on_windows <- tolower(Sys.info()[["sysname"]]) == "windows" - # Install dependencies by installing (yesterday's) binary, then removing it - install.packages(c("arrow", "cpp11"), - type = "binary", - repos = c("https://nightlies.apache.org/arrow/r", "https://cloud.r-project.org") - ) - - cat("Remove old arrow version.\n") - remove.packages("arrow") - # Build Sys.setenv(MAKEFLAGS = paste0("-j", parallel::detectCores())) INSTALL_opts <- "--build" @@ -175,6 +184,9 @@ jobs: INSTALL_opts <- c(INSTALL_opts, "--strip") } + # always remove arrow (mainly for self-hosted runners) + try(remove.packages("arrow"), silent = TRUE) + cat("Install arrow from dev repo.\n") install.packages( "arrow", diff --git a/r/tools/autobrew b/r/tools/autobrew index 55fe9576086f4..d895b57eaf9d7 100644 --- a/r/tools/autobrew +++ b/r/tools/autobrew @@ -62,7 +62,7 @@ fi # Hardcode this for my custom autobrew build rm -f $BREWDIR/lib/*.dylib AWS_LIBS="-laws-cpp-sdk-config -laws-cpp-sdk-transfer -laws-cpp-sdk-identity-management -laws-cpp-sdk-cognito-identity -laws-cpp-sdk-sts -laws-cpp-sdk-s3 -laws-cpp-sdk-core -laws-c-event-stream -laws-checksums -laws-c-common -laws-crt-cpp -laws-c-io -laws-c-s3 -laws-c-auth -laws-c-http -laws-c-cal -laws-c-compression -laws-c-mqtt -lpthread -lcurl" -PKG_LIBS="-lparquet -larrow_dataset -larrow -larrow_bundled_dependencies -lthrift -lbrotlienc -lbrotlidec -lbrotlicommon -llz4 -lsnappy -lzstd $AWS_LIBS" +PKG_LIBS="-lparquet -larrow_dataset -larrow -larrow_bundled_dependencies -lthrift -lbrotlienc-static -lbrotlidec-static -lbrotlicommon-static -llz4 -lsnappy -lzstd $AWS_LIBS" PKG_DIRS="-L$BREWDIR/lib" # Prevent CRAN builder from linking against old libs in /usr/local/lib