Skip to content

Commit 5819943

Browse files
jonkeanenealrichardson
authored andcommitted
ARROW-10856: [R] CC and CXX environment variables passing to cmake
Ensure that the environment variables are properly passed to cmake. Closes #8932 from jonkeane/centos-ARROW-10856 Authored-by: Jonathan Keane <[email protected]> Signed-off-by: Neal Richardson <[email protected]>
1 parent 5c15af9 commit 5819943

File tree

9 files changed

+39
-4
lines changed

9 files changed

+39
-4
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,5 @@ ARROW_R_DEV=TRUE
4747
R_ORG=rhub
4848
R_IMAGE=ubuntu-gcc-release
4949
R_TAG=latest
50+
# -1 does not attempt to install a devtoolset version, any positive integer will install devtoolset-n
51+
DEVTOOLSET_VERSION=-1

ci/docker/linux-r.dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ ENV R_BIN=${r_bin}
2727
ARG r_dev=FALSE
2828
ENV ARROW_R_DEV=${r_dev}
2929

30+
ARG devtoolset_version=-1
31+
ENV DEVTOOLSET_VERSION=${devtoolset_version}
32+
3033
# Make sure R is on the path for the R-hub devel versions (where RPREFIX is set in its dockerfile)
3134
ENV PATH "${RPREFIX}/bin:${PATH}"
3235

ci/scripts/r_docker_configure.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@ if [ "$RHUB_PLATFORM" = "linux-x86_64-fedora-clang" ]; then
3939
rm -rf $(${R_BIN} RHOME)/etc/Makeconf.bak
4040
fi
4141

42+
# Special hacking to try to reproduce quirks on centos using non-default build
43+
# tooling.
44+
if [[ "$DEVTOOLSET_VERSION" -gt 0 ]]; then
45+
if [ "`which dnf`" ]; then
46+
dnf install -y centos-release-scl
47+
dnf install -y "devtoolset-$DEVTOOLSET_VERSION"
48+
else
49+
yum install -y centos-release-scl
50+
yum install -y "devtoolset-$DEVTOOLSET_VERSION"
51+
fi
52+
fi
53+
4254
# Install openssl for S3 support
4355
if [ "$ARROW_S3" == "ON" ] || [ "$ARROW_R_DEV" == "TRUE" ]; then
4456
if [ "`which dnf`" ]; then

ci/scripts/r_test.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ export TEXMFVAR=/tmp/texmf-var
5252
# Not all Suggested packages are needed for checking, so in case they aren't installed don't fail
5353
export _R_CHECK_FORCE_SUGGESTS_=FALSE
5454

55+
if [[ "$DEVTOOLSET_VERSION" -gt 0 ]]; then
56+
# enable the devtoolset version to use it
57+
source /opt/rh/devtoolset-$DEVTOOLSET_VERSION/enable
58+
fi
59+
5560
# Make sure we aren't writing to the home dir (CRAN _hates_ this but there is no official check)
5661
BEFORE=$(ls -alh ~/)
5762

cpp/thirdparty/versions.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# format).
2525

2626
ARROW_ABSL_BUILD_VERSION=2eba343b51e0923cd3fb919a6abd6120590fc059
27-
ARROW_AWSSDK_BUILD_VERSION=1.8.57
27+
ARROW_AWSSDK_BUILD_VERSION=1.8.90
2828
ARROW_AWS_CHECKSUMS_BUILD_VERSION=v0.1.5
2929
ARROW_AWS_C_COMMON_BUILD_VERSION=v0.4.59
3030
ARROW_AWS_C_EVENT_STREAM_BUILD_VERSION=v0.1.5

dev/tasks/r/azure.linux.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
export R_ORG={{ r_org }}
3737
export R_IMAGE={{ r_image }}
3838
export R_TAG={{ r_tag }}
39+
export DEVTOOLSET_VERSION={{ devtoolset_version|default("-1") }}
3940
docker-compose pull --ignore-pull-failures r
4041
docker-compose build r
4142
displayName: Docker build

dev/tasks/tasks.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1766,6 +1766,16 @@ tasks:
17661766
r_tag: 3.6-centos8
17671767
not_cran: "TRUE"
17681768

1769+
test-r-rstudio-r-base-3.6-centos7-devtoolset-8:
1770+
ci: azure
1771+
template: r/azure.linux.yml
1772+
params:
1773+
r_org: rstudio
1774+
r_image: r-base
1775+
r_tag: 3.6-centos7
1776+
not_cran: "TRUE"
1777+
devtoolset_version: 8
1778+
17691779
test-r-rstudio-r-base-3.6-opensuse15:
17701780
ci: azure
17711781
template: r/azure.linux.yml

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,13 +867,15 @@ services:
867867
args:
868868
base: ${R_ORG}/${R_IMAGE}:${R_TAG}
869869
r_dev: ${ARROW_R_DEV}
870+
devtoolset_version: ${DEVTOOLSET_VERSION}
870871
shm_size: *shm-size
871872
environment:
872873
LIBARROW_DOWNLOAD: "false"
873874
ARROW_HOME: "/arrow"
874875
ARROW_R_DEV: ${ARROW_R_DEV}
875876
# To test for CRAN release, delete ^^ these two env vars so we download the Apache release
876877
ARROW_USE_PKG_CONFIG: "false"
878+
DEVTOOLSET_VERSION: ${DEVTOOLSET_VERSION}
877879
volumes:
878880
- .:/arrow:delegated
879881
command: >

r/tools/linuxlibs.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ with_s3_support <- function(env_vars) {
384384
if (arrow_s3) {
385385
# User wants S3 support. Let's make sure they're not on gcc < 4.9
386386
# and make sure that we have curl and openssl system libs
387-
info <- system(paste(env_vars, "&& $CMAKE --system-information"), intern = TRUE)
387+
info <- system(paste("export", env_vars, "&& $CMAKE --system-information"), intern = TRUE)
388388
info <- grep("^[A-Z_]* .*$", info, value = TRUE)
389389
vals <- as.list(sub('^.*? "?(.*?)"?$', "\\1", info))
390390
names(vals) <- sub("^(.*?) .*$", "\\1", info)
@@ -410,9 +410,9 @@ cmake_find_package <- function(pkg, version = NULL, env_vars) {
410410
find_package <- paste0("find_package(", pkg, " ", version, " REQUIRED)")
411411
writeLines(find_package, file.path(td, "CMakeLists.txt"))
412412
cmake_cmd <- paste0(
413-
env_vars,
413+
"export ", env_vars,
414414
" && cd ", td,
415-
" && $CMAKE",
415+
" && $CMAKE ",
416416
" -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON",
417417
" -DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON",
418418
" ."

0 commit comments

Comments
 (0)