Apache DataFusion SQL Query Engine
ARROW-8604: [R][CI] Update CI to use R 4.0
Neal Richardson3d37c78718d3
diff --git a/.env b/.envindex 0340ed7e14..87a11ef2e8 100644--- a/.env+++ b/.env@@ -40,7 +40,7 @@ KARTOTHEK=latestHDFS=2.9.2SPARK=masterDOTNET=2.1-R=3.6+R=4.0ARROW_R_DEV=TRUE# These correspond to images on Docker Hub that contain R, e.g. rhub/ubuntu-gcc-release:latestR_ORG=rhubdiff --git a/.github/workflows/r.yml b/.github/workflows/r.ymlindex 04c0706995..918c9224cd 100644--- a/.github/workflows/r.yml+++ b/.github/workflows/r.yml@@ -46,14 +46,18 @@ env:ARCHERY_DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }}jobs:-ubuntu:- name: AMD64 Ubuntu 18.04 R 3.6+ name: AMD64 Ubuntu ${{ matrix.ubuntu }} R ${{ matrix.r }}runs-on: ubuntu-latestif: ${{ !contains(github.event.pull_request.title, 'WIP') }}+ strategy:+ fail-fast: false+ matrix:+ r: ["3.6", "4.0"]+ ubuntu: [18.04]env:- R: '3.6'- UBUNTU: '18.04'+ R: ${{ matrix.r }}+ UBUNTU: ${{ matrix.ubuntu }}steps:- name: Checkout Arrowuses: actions/checkout@v2@@ -67,8 +71,8 @@ jobs:uses: actions/cache@v1with:path: .docker- key: ubuntu-18.04-r-3.6-${{ hashFiles('cpp/**') }}- restore-keys: ubuntu-18.04-r-3.6-+ key: ubuntu-${{ matrix.ubuntu }}-r-${{ matrix.r }}-${{ hashFiles('cpp/**') }}+ restore-keys: ubuntu-${{ matrix.ubuntu }}-r-${{ matrix.r }}-- name: Setup Pythonuses: actions/setup-python@v1with:@@ -89,13 +93,20 @@ jobs:run: archery docker push ubuntu-rrstudio:- name: AMD64 CentOS 7 RStudio R 3.6+ name: "rstudio/r-base:${{ matrix.r_version }}-${{ matrix.r_image }}"runs-on: ubuntu-latestif: ${{ !contains(github.event.pull_request.title, 'WIP') }}+ strategy:+ fail-fast: false+ matrix:+ # See https://hub.docker.com/r/rstudio/r-base+ r_version: ["3.6", "4.0"]+ r_image:+ - centos7env:R_ORG: rstudioR_IMAGE: r-base- R_TAG: 3.6-centos7+ R_TAG: ${{ matrix.r_version }}-${{ matrix.r_image }}steps:- name: Checkout Arrowuses: actions/checkout@v2@@ -109,8 +120,8 @@ jobs:uses: actions/cache@v1with:path: .docker- key: centos-7-r-${{ hashFiles('cpp/**') }}- restore-keys: centos-7-r-+ key: ${{ matrix.r_image }}-r-${{ hashFiles('cpp/**') }}+ restore-keys: ${{ matrix.r_image }}-r-- name: Setup Pythonuses: actions/setup-python@v1with:@@ -137,17 +148,13 @@ jobs:strategy:fail-fast: falsematrix:- # TODO: test on rtools40- rtools: [35]+ rtools: [35, 40]env:TEST_R_WITH_ARROW: "TRUE"ARROW_R_CXXFLAGS: '-Werror'_R_CHECK_TESTS_NLINES_: 0steps:- run: git config --global core.autocrlf false- - uses: numworks/setup-msys2@v1- with:- update: true- name: Checkout Arrowuses: actions/checkout@v2with:@@ -161,18 +168,25 @@ jobs:cd r/testssed -i.bak -E -e 's/"arrow"/"arrow", reporter = "location"/' testthat.Rrm -f testthat.R.bak- - name: Fetch Submodules and Tags- shell: bash- run: ci/scripts/util_checkout.sh+ # We use the makepkg-mingw setup that is included in rtools40 even when+ # we use the rtools35 compilers, so we always install R 4.0/Rtools40- uses: r-lib/actions/setup-r@masterwith:- rtools-version: ${{ matrix.rtools }}+ rtools-version: 40+ r-version: '4.0'+ Ncpus: 2+ - uses: r-lib/actions/setup-r@master+ if: ${{ matrix.rtools == 35 }}+ with:+ rtools-version: 35r-version: '3.6'+ Ncpus: 2- name: Build Arrow C++- run: msys2do ci/scripts/r_windows_build.sh+ run: |+ C:\rtools40\usr\bin\bash --login -c "export RTOOLS_VERSION=${{ matrix.rtools }} && cd /d/a/arrow/arrow && ci/scripts/r_windows_build.sh"- uses: actions/upload-artifact@v1with:- name: Rtools Arrow C+++ name: Rtools ${{ matrix.rtools }} Arrow C++path: libarrow.zip- name: Install R package dependenciesshell: Rscript {0}@@ -193,3 +207,6 @@ jobs:error_on = 'warning',check_dir = 'check')+ - name: Dump install logs+ shell: cmd+ run: cat check/arrow.Rcheck/00install.outdiff --git a/ci/docker/linux-apt-r.dockerfile b/ci/docker/linux-apt-r.dockerfileindex 8b6287a50e..7f81e11e54 100644--- a/ci/docker/linux-apt-r.dockerfile+++ b/ci/docker/linux-apt-r.dockerfile@@ -30,10 +30,13 @@ RUN apt-get update -y && \apt-key adv \--keyserver keyserver.ubuntu.com \--recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 && \- # NOTE: as of 2019-12, R 3.5 and 3.6 are available in the repos with -cran35 suffix+ # NOTE: R 3.5 and 3.6 are available in the repos with -cran35 suffix+ # for trusty, xenial, bionic, and eoan (as of May 2020)+ # -cran40 has 4.0 versions for bionic and focal# R 3.2, 3.3, 3.4 are available without the suffix but only for trusty and xenial# TODO: make sure OS version and R version are valid together and conditionally set repo suffix- add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu '$(lsb_release -cs)'-cran35/' && \+ # This is a hack to turn 3.6 into 35 and 4.0 into 40:+ add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu '$(lsb_release -cs)'-cran'$(echo "${r}" | tr -d . | tr 6 5)'/' && \apt-get install -y \r-base=${r}* \# system libs needed by core R packagesdiff --git a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfileindex 473f39092c..a865f9fe70 100644--- a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile+++ b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile@@ -53,7 +53,7 @@ RUN apt-get update -y -q && \# and use pre-built binaries where possibleRUN printf "\options(Ncpus = parallel::detectCores(), \- repos = 'https://demo.rstudiopm.com/all/__linux__/bionic/latest', \+ repos = 'https://packagemanager.rstudio.com/cran/__linux__/bionic/latest', \HTTPUserAgent = sprintf(\'R/%%s R (%%s)', getRversion(), \paste(getRversion(), R.version\$platform, R.version\$arch, R.version\$os)))\n" \diff --git a/ci/etc/rprofile b/ci/etc/rprofileindex 8b7e401388..524eb50aee 100644--- a/ci/etc/rprofile+++ b/ci/etc/rprofile@@ -1,6 +1,6 @@.pick_cran <- function() {# Return a CRAN repo URL, preferring RSPM binaries if available for this OS- rspm_template <- "https://demo.rstudiopm.com/all/__linux__/%s/latest"+ rspm_template <- "https://packagemanager.rstudio.com/cran/__linux__/%s/latest"supported_os <- c("xenial", "bionic", "centos7", "opensuse42", "opensuse15")if (nzchar(Sys.which("lsb_release"))) {diff --git a/ci/scripts/PKGBUILD b/ci/scripts/PKGBUILDindex c1266c9bd9..51975bdb05 100644--- a/ci/scripts/PKGBUILD+++ b/ci/scripts/PKGBUILD@@ -64,11 +64,13 @@ build() {# This is the difference between rtools-packages and rtools-backports# Remove this when submitting to rtools-packages- export CC="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/gcc"- export CXX="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/g++"- export PATH="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin:$PATH"- export CPPFLAGS="-I${MINGW_PREFIX}/include"- export LIBS="-L${MINGW_PREFIX}/libs"+ if [ "$RTOOLS_VERSION" = "35" ]; then+ export CC="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/gcc"+ export CXX="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin/g++"+ export PATH="/C/Rtools${MINGW_PREFIX/mingw/mingw_}/bin:$PATH"+ export CPPFLAGS="-I${MINGW_PREFIX}/include"+ export LIBS="-L${MINGW_PREFIX}/libs"+ fiMSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \${MINGW_PREFIX}/bin/cmake.exe \diff --git a/ci/scripts/r_test.sh b/ci/scripts/r_test.shindex 78ce43071d..282538751e 100755--- a/ci/scripts/r_test.sh+++ b/ci/scripts/r_test.sh@@ -60,7 +60,7 @@ ${R_BIN} -e "as_cran <- !identical(tolower(Sys.getenv('NOT_CRAN')), 'true')}"AFTER=$(ls -alh ~/)-if [ "$BEFORE" != "$AFTER" ]; then+if [ "$NOT_CRAN" != "true" ] && [ "$BEFORE" != "$AFTER" ]; thenls -alh ~/.cmake/packagesexit 1fidiff --git a/ci/scripts/r_windows_build.sh b/ci/scripts/r_windows_build.shindex d263d51dc8..2e8e87dd16 100755--- a/ci/scripts/r_windows_build.sh+++ b/ci/scripts/r_windows_build.sh@@ -23,26 +23,18 @@ set -ex# Make sure it is absolute and exportedexport ARROW_HOME="$(cd "${ARROW_HOME}" && pwd)"-# ccache may be broken on MinGW.-# pacman --sync --noconfirm ccache--wget https://raw.githubusercontent.com/r-windows/rtools-backports/master/pacman.conf-cp -f pacman.conf /etc/pacman.conf--pacman --noconfirm -Scc-pacman --noconfirm -Syyu-pacman --noconfirm --needed -S git base-devel binutils zip--# Install core build stuff-pacman --noconfirm --needed -S mingw-w64-{i686,x86_64}-{toolchain,crt,winpthreads,gcc,libtre,pkg-config,xz}--# Force static linking-rm -f /mingw32/lib/*.dll.a-rm -f /mingw64/lib/*.dll.a-export PKG_CONFIG="/${MINGW_PREFIX}/bin/pkg-config --static"+if [ "$RTOOLS_VERSION" = "35" ]; then+ # Use rtools-backports if building with rtools35+ curl https://raw.githubusercontent.com/r-windows/rtools-backports/master/pacman.conf > /etc/pacman.conf+ pacman --noconfirm -Scc+ pacman --noconfirm -Syyu+ # lib-4.9.3 is for libraries compiled with gcc 4.9 (Rtools 3.5)+ RWINLIB_LIB_DIR="lib-4.9.3"+else+ RWINLIB_LIB_DIR="lib"+ficp $ARROW_HOME/ci/scripts/PKGBUILD .-export PKGEXT='.pkg.tar.xz' # pacman default changed to .zst in 2020, but keep the old ext for compatprintenvmakepkg-mingw --noconfirm --noprogressbar --skippgpcheck --nocheck --syncdeps --cleanbuild@@ -56,7 +48,7 @@ cp mingw* buildcd build# This may vary by system/CI provider-MSYS_LIB_DIR="D:/a/_temp/msys/msys64"+MSYS_LIB_DIR="/c/rtools40"ls $MSYS_LIB_DIR/mingw64/lib/ls $MSYS_LIB_DIR/mingw32/lib/@@ -69,20 +61,20 @@ mv mingw64/include $DST_DIR# Make the rest of the directory structure# lib-4.9.3 is for libraries compiled with gcc 4.9 (Rtools 3.5)-mkdir -p $DST_DIR/lib-4.9.3/x64-mkdir -p $DST_DIR/lib-4.9.3/i386+mkdir -p $DST_DIR/${RWINLIB_LIB_DIR}/x64+mkdir -p $DST_DIR/${RWINLIB_LIB_DIR}/i386# lib is for the new gcc 8 toolchain (Rtools 4.0)mkdir -p $DST_DIR/lib/x64mkdir -p $DST_DIR/lib/i386# Move the 64-bit versions of libarrow into the expected location-mv mingw64/lib/*.a $DST_DIR/lib-4.9.3/x64+mv mingw64/lib/*.a $DST_DIR/${RWINLIB_LIB_DIR}/x64# Same for the 32-bit versions-mv mingw32/lib/*.a $DST_DIR/lib-4.9.3/i386+mv mingw32/lib/*.a $DST_DIR/${RWINLIB_LIB_DIR}/i386-# These are from https://dl.bintray.com/rtools/backports/-cp $MSYS_LIB_DIR/mingw64/lib/lib{thrift,snappy}.a $DST_DIR/lib-4.9.3/x64-cp $MSYS_LIB_DIR/mingw32/lib/lib{thrift,snappy}.a $DST_DIR/lib-4.9.3/i386+# These may be from https://dl.bintray.com/rtools/backports/+cp $MSYS_LIB_DIR/mingw64/lib/lib{thrift,snappy}.a $DST_DIR/${RWINLIB_LIB_DIR}/x64+cp $MSYS_LIB_DIR/mingw32/lib/lib{thrift,snappy}.a $DST_DIR/${RWINLIB_LIB_DIR}/i386# These are from https://dl.bintray.com/rtools/mingw{32,64}/cp $MSYS_LIB_DIR/mingw64/lib/lib{zstd,lz4,crypto}.a $DST_DIR/lib/x64diff --git a/dev/tasks/r/azure.linux.yml b/dev/tasks/r/azure.linux.ymlindex 4b4211c44c..85ad839e61 100644--- a/dev/tasks/r/azure.linux.yml+++ b/dev/tasks/r/azure.linux.yml@@ -33,9 +33,9 @@ jobs:docker -vdocker-compose -vcd arrow- R_ORG={{ r_org }}- R_IMAGE={{ r_image }}- R_TAG={{ r_tag }}+ export R_ORG={{ r_org }}+ export R_IMAGE={{ r_image }}+ export R_TAG={{ r_tag }}docker-compose pull --ignore-pull-failures rdocker-compose build rdisplayName: Docker build@@ -43,9 +43,9 @@ jobs:- script: |set -excd arrow- R_ORG={{ r_org }}- R_IMAGE={{ r_image }}- R_TAG={{ r_tag }}+ export R_ORG={{ r_org }}+ export R_IMAGE={{ r_image }}+ export R_TAG={{ r_tag }}# we have to export this (right?) because we need it in the build envexport ARROW_R_DEV={{ not_cran }}# Note that ci/scripts/r_test.sh sets NOT_CRAN=true if ARROW_R_DEV=TRUEdiff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.ymlindex 528f375602..0f91fc7449 100644--- a/dev/tasks/tasks.yml+++ b/dev/tasks/tasks.yml@@ -1655,39 +1655,39 @@ tasks:r_tag: 3.6-centos6not_cran: "TRUE"- test-r-rstudio-r-base-3.6-opensuse15:+ test-r-rstudio-r-base-3.6-centos8:ci: azuretemplate: r/azure.linux.ymlparams:r_org: rstudior_image: r-base- r_tag: 3.6-opensuse15+ r_tag: 3.6-centos8not_cran: "TRUE"- test-r-rstudio-r-base-3.6-opensuse42:+ test-r-rstudio-r-base-3.6-opensuse15:ci: azuretemplate: r/azure.linux.ymlparams:r_org: rstudior_image: r-base- r_tag: 3.6-opensuse24+ r_tag: 3.6-opensuse15not_cran: "TRUE"- test-ubuntu-18.04-r-3.6:+ test-r-rstudio-r-base-3.6-opensuse42:ci: azure- template: docker-tests/azure.linux.yml+ template: r/azure.linux.ymlparams:- env:- UBUNTU: 18.04- R: 3.6- run: ubuntu-r+ r_org: rstudio+ r_image: r-base+ r_tag: 3.6-opensuse42+ not_cran: "TRUE"- test-conda-r-3.6:+ test-conda-r-4.0:ci: githubtemplate: docker-tests/github.linux.ymlparams:env:- R: 3.6+ R: 4.0run: conda-rtest-ubuntu-18.04-r-sanitizer: