Skip to content

Apache DataFusion SQL Query Engine

ARROW-8604: [R][CI] Update CI to use R 4.0

Neal Richardson3d37c78718d3
diff --git a/.env b/.env
index 0340ed7e14..87a11ef2e8 100644
--- a/.env
+++ b/.env
@@ -40,7 +40,7 @@ KARTOTHEK=latest
HDFS=2.9.2
SPARK=master
DOTNET=2.1
-R=3.6
+R=4.0
ARROW_R_DEV=TRUE
# These correspond to images on Docker Hub that contain R, e.g. rhub/ubuntu-gcc-release:latest
R_ORG=rhub
diff --git a/.github/workflows/r.yml b/.github/workflows/r.yml
index 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-latest
if: ${{ !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 Arrow
uses: actions/checkout@v2
@@ -67,8 +71,8 @@ jobs:
uses: actions/cache@v1
with:
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 Python
uses: actions/setup-python@v1
with:
@@ -89,13 +93,20 @@ jobs:
run: archery docker push ubuntu-r
rstudio:
- name: AMD64 CentOS 7 RStudio R 3.6
+ name: "rstudio/r-base:${{ matrix.r_version }}-${{ matrix.r_image }}"
runs-on: ubuntu-latest
if: ${{ !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:
+ - centos7
env:
R_ORG: rstudio
R_IMAGE: r-base
- R_TAG: 3.6-centos7
+ R_TAG: ${{ matrix.r_version }}-${{ matrix.r_image }}
steps:
- name: Checkout Arrow
uses: actions/checkout@v2
@@ -109,8 +120,8 @@ jobs:
uses: actions/cache@v1
with:
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 Python
uses: actions/setup-python@v1
with:
@@ -137,17 +148,13 @@ jobs:
strategy:
fail-fast: false
matrix:
- # TODO: test on rtools40
- rtools: [35]
+ rtools: [35, 40]
env:
TEST_R_WITH_ARROW: "TRUE"
ARROW_R_CXXFLAGS: '-Werror'
_R_CHECK_TESTS_NLINES_: 0
steps:
- run: git config --global core.autocrlf false
- - uses: numworks/setup-msys2@v1
- with:
- update: true
- name: Checkout Arrow
uses: actions/checkout@v2
with:
@@ -161,18 +168,25 @@ jobs:
cd r/tests
sed -i.bak -E -e 's/"arrow"/"arrow", reporter = "location"/' testthat.R
rm -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@master
with:
- 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: 35
r-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@v1
with:
- name: Rtools Arrow C++
+ name: Rtools ${{ matrix.rtools }} Arrow C++
path: libarrow.zip
- name: Install R package dependencies
shell: 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.out
diff --git a/ci/docker/linux-apt-r.dockerfile b/ci/docker/linux-apt-r.dockerfile
index 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 packages
diff --git a/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile b/ci/docker/ubuntu-18.04-r-sanitizer.dockerfile
index 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 possible
RUN 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/rprofile
index 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/PKGBUILD
index 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"
+ fi
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe \
diff --git a/ci/scripts/r_test.sh b/ci/scripts/r_test.sh
index 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" ]; then
ls -alh ~/.cmake/packages
exit 1
fi
diff --git a/ci/scripts/r_windows_build.sh b/ci/scripts/r_windows_build.sh
index 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 exported
export 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"
+fi
cp $ARROW_HOME/ci/scripts/PKGBUILD .
-export PKGEXT='.pkg.tar.xz' # pacman default changed to .zst in 2020, but keep the old ext for compat
printenv
makepkg-mingw --noconfirm --noprogressbar --skippgpcheck --nocheck --syncdeps --cleanbuild
@@ -56,7 +48,7 @@ cp mingw* build
cd 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/x64
mkdir -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/x64
diff --git a/dev/tasks/r/azure.linux.yml b/dev/tasks/r/azure.linux.yml
index 4b4211c44c..85ad839e61 100644
--- a/dev/tasks/r/azure.linux.yml
+++ b/dev/tasks/r/azure.linux.yml
@@ -33,9 +33,9 @@ jobs:
docker -v
docker-compose -v
cd 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 r
docker-compose build r
displayName: Docker build
@@ -43,9 +43,9 @@ jobs:
- script: |
set -ex
cd 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 env
export ARROW_R_DEV={{ not_cran }}
# Note that ci/scripts/r_test.sh sets NOT_CRAN=true if ARROW_R_DEV=TRUE
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 528f375602..0f91fc7449 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -1655,39 +1655,39 @@ tasks:
r_tag: 3.6-centos6
not_cran: "TRUE"
- test-r-rstudio-r-base-3.6-opensuse15:
+ test-r-rstudio-r-base-3.6-centos8:
ci: azure
template: r/azure.linux.yml
params:
r_org: rstudio
r_image: r-base
- r_tag: 3.6-opensuse15
+ r_tag: 3.6-centos8
not_cran: "TRUE"
- test-r-rstudio-r-base-3.6-opensuse42:
+ test-r-rstudio-r-base-3.6-opensuse15:
ci: azure
template: r/azure.linux.yml
params:
r_org: rstudio
r_image: r-base
- r_tag: 3.6-opensuse24
+ r_tag: 3.6-opensuse15
not_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.yml
params:
- 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: github
template: docker-tests/github.linux.yml
params:
env:
- R: 3.6
+ R: 4.0
run: conda-r
test-ubuntu-18.04-r-sanitizer: