Skip to content
Merged
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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ repos:
?^ci/scripts/python_wheel_xlinux_build\.sh$|
?^ci/scripts/r_build\.sh$|
?^ci/scripts/r_deps\.sh$|
?^ci/scripts/r_docker_configure\.sh$|
?^ci/scripts/r_revdepcheck\.sh$|
?^ci/scripts/release_test\.sh$|
?^ci/scripts/ruby_test\.sh$|
Expand Down
32 changes: 16 additions & 16 deletions ci/scripts/r_docker_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,44 @@

set -ex

: ${R_BIN:=R}
: "${R_BIN:=R}"
# This is where our docker setup puts things; set this to run outside of docker
: ${ARROW_SOURCE_HOME:=/arrow}
: "${ARROW_SOURCE_HOME:=/arrow}"

# The Dockerfile should have put this file here
if [ -f "${ARROW_SOURCE_HOME}/ci/etc/rprofile" ]; then
# Ensure parallel R package installation, set CRAN repo mirror,
# and use pre-built binaries where possible
cat ${ARROW_SOURCE_HOME}/ci/etc/rprofile >> $(${R_BIN} RHOME)/etc/Rprofile.site
cat "${ARROW_SOURCE_HOME}/ci/etc/rprofile" >> "$(${R_BIN} RHOME)/etc/Rprofile.site"
fi

# Ensure parallel compilation of C/C++ code
echo "MAKEFLAGS=-j$(${R_BIN} -s -e 'cat(parallel::detectCores())')" >> $(R RHOME)/etc/Renviron.site
echo "MAKEFLAGS=-j$(${R_BIN} -s -e 'cat(parallel::detectCores())')" >> "$(R RHOME)/etc/Renviron.site"

# Figure out what package manager we have
if [ "`which dnf`" ]; then
if [ "$(which dnf)" ]; then
PACKAGE_MANAGER=dnf
elif [ "`which yum`" ]; then
elif [ "$(which yum)" ]; then
PACKAGE_MANAGER=yum
elif [ "`which zypper`" ]; then
elif [ "$(which zypper)" ]; then
PACKAGE_MANAGER=zypper
elif [ "`which apk`" ]; then
elif [ "$(which apk)" ]; then
PACKAGE_MANAGER=apk
else
PACKAGE_MANAGER=apt-get
apt-get update --allow-releaseinfo-change # flag needed for when debian version changes
fi

# Enable ccache if requested based on http://dirk.eddelbuettel.com/blog/2017/11/27/
: ${R_CUSTOM_CCACHE:=FALSE}
R_CUSTOM_CCACHE=`echo $R_CUSTOM_CCACHE | tr '[:upper:]' '[:lower:]'`
if [ ${R_CUSTOM_CCACHE} = "true" ]; then
: "${R_CUSTOM_CCACHE:=FALSE}"
R_CUSTOM_CCACHE=$(echo "$R_CUSTOM_CCACHE" | tr '[:upper:]' '[:lower:]')
if [ "${R_CUSTOM_CCACHE}" = "true" ]; then
# install ccache
if [ "$PACKAGE_MANAGER" = "apk" ]; then
$PACKAGE_MANAGER add ccache
"$PACKAGE_MANAGER" add ccache
else
$PACKAGE_MANAGER install -y epel-release || true
$PACKAGE_MANAGER install -y ccache
"$PACKAGE_MANAGER" install -y epel-release || true
"$PACKAGE_MANAGER" install -y ccache
fi

mkdir -p ~/.R
Expand All @@ -80,9 +80,9 @@ fi
# Install rsync for bundling cpp source and curl to make sure it is installed on all images,
# cmake is now a listed sys req.
if [ "$PACKAGE_MANAGER" = "apk" ]; then
$PACKAGE_MANAGER add rsync cmake curl
"$PACKAGE_MANAGER" add rsync cmake curl
else
$PACKAGE_MANAGER install -y rsync cmake curl
"$PACKAGE_MANAGER" install -y rsync cmake curl
fi


Expand Down
Loading