Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ci/docker/linux-r.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ ENV R_CUSTOM_CCACHE=${r_custom_ccache}
ARG r_update_clang=false
ENV R_UPDATE_CLANG=${r_update_clang}

ARG r_old_clang=false
ENV R_OLD_CLANG=${r_old_clang}

ARG tz="UTC"
ENV TZ=${tz}

Expand Down
28 changes: 28 additions & 0 deletions ci/scripts/r_docker_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,33 @@ if [ "$R_UPDATE_CLANG" = true ]; then
apt install -y clang-20 lld-20
fi

# Use an old clang version to simulate CRAN's macos clang-14 environment.
# This is only for rhub/clang20. If we change the base image from rhub/clang20,
# we need to update this part too.
if [ "$R_OLD_CLANG" = true ]; then
apt update -y --allow-releaseinfo-change # flag needed for when debian version changes
apt install -y clang-14 lld-14 g++-12 libstdc++-12-dev

update-alternatives --install /usr/bin/clang clang /usr/bin/clang-14 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-14 100
update-alternatives --install /usr/bin/lld lld /usr/bin/lld-14 100

clang --version
clang++ --version

mkdir -p ~/.R
cat <<'EOF' > ~/.R/Makevars
CC=clang-14
CXX=clang++-14

CXX11=clang++-14
CXX14=clang++-14
CXX17=clang++-14
CXX20=clang++-14

LDFLAGS=-fuse-ld=lld
EOF
fi

# Workaround for html help install failure; see https://github.com/r-lib/devtools/issues/2084#issuecomment-530912786
Rscript -e 'x <- file.path(R.home("doc"), "html"); if (!file.exists(x)) {dir.create(x, recursive=TRUE); file.copy(system.file("html/R.css", package="stats"), x)}'
1 change: 1 addition & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,7 @@ services:
r_prune_deps: ${R_PRUNE_DEPS}
r_custom_ccache: ${R_CUSTOM_CCACHE}
r_update_clang: ${R_UPDATE_CLANG}
r_old_clang: ${R_OLD_CLANG}
shm_size: *shm-size
environment:
<<: [*common, *sccache]
Expand Down
2 changes: 2 additions & 0 deletions dev/tasks/r/github.linux.cran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ jobs:
- { r_image: "ubuntu-next" } # ~ r-patched-linux-x86_64
- { r_image: "ubuntu-release" } # ~ r-release-linux-x86_64
- { r_image: "clang20", skip_vignettes: true, r_update_clang: true } # ~ r-devel-linux-x86_64-fedora-clang
- { r_image: "clang16", skip_vignettes: true, r_old_clang: true } # ~ r-devel-linux-x86_64-fedora-clang
env:
R_ORG: "rhub"
R_IMAGE: {{ '${{ matrix.config.r_image }}' }}
R_TAG: "latest"
ARROW_R_DEV: "FALSE"
R_UPDATE_CLANG: {{ '${{ matrix.config.r_update_clang }}' }}
R_OLD_CLANG: {{ '${{ matrix.config.r_old_clang }}' }}
steps:
{{ macros.github_checkout_arrow()|indent }}
{{ macros.github_install_archery()|indent }}
Expand Down
Loading