Skip to content
Open
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 @@ -338,6 +338,7 @@ repos:
?^ci/scripts/python_wheel_macos_build\.sh$|
?^ci/scripts/python_wheel_xlinux_build\.sh$|
?^ci/scripts/r_build\.sh$|
?^ci/scripts/r_deps\.sh$|
?^ci/scripts/r_revdepcheck\.sh$|
?^ci/scripts/release_test\.sh$|
?^ci/scripts/ruby_test\.sh$|
Expand Down
26 changes: 13 additions & 13 deletions ci/scripts/r_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@

set -ex

: ${R_BIN:=R}
: "${R_BIN:=R}"

: ${R_PRUNE_DEPS:=FALSE}
R_PRUNE_DEPS=`echo $R_PRUNE_DEPS | tr '[:upper:]' '[:lower:]'`
: "${R_PRUNE_DEPS:=FALSE}"
R_PRUNE_DEPS=$(echo "$R_PRUNE_DEPS" | tr '[:upper:]' '[:lower:]')

: ${R_DUCKDB_DEV:=FALSE}
R_DUCKDB_DEV=`echo $R_DUCKDB_DEV | tr '[:upper:]' '[:lower:]'`
: "${R_DUCKDB_DEV:=FALSE}"
R_DUCKDB_DEV=$(echo "$R_DUCKDB_DEV" | tr '[:upper:]' '[:lower:]')

source_dir=${1}/r
source_dir="${1}/r"

pushd ${source_dir}
pushd "${source_dir}"

if [ ${R_PRUNE_DEPS} = "true" ]; then
if [ "${R_PRUNE_DEPS}" = "true" ]; then
# To prevent the build from timing out, let's prune some optional deps (and their possible version requirements)
${R_BIN} -e 'd <- read.dcf("DESCRIPTION")
"${R_BIN}" -e 'd <- read.dcf("DESCRIPTION")
to_prune <- c("duckdb", "DBI", "dbplyr", "decor", "knitr", "rmarkdown", "pkgload", "reticulate")
pattern <- paste0("\\n?", to_prune, " (\\\\(.*\\\\))?,?", collapse = "|")
d[,"Suggests"] <- gsub(pattern, "", d[,"Suggests"])
Expand All @@ -43,15 +43,15 @@ fi
# install.packages() emits warnings if packages fail to install,
# but we want to error/fail the build.
# options(warn=2) turns warnings into errors
${R_BIN} -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '"${INSTALL_ARGS}"')"
"${R_BIN}" -e "options(warn=2); install.packages('remotes'); remotes::install_cran(c('glue', 'rcmdcheck', 'sys')); remotes::install_deps(INSTALL_opts = '${INSTALL_ARGS}')"

# Install DuckDB from github when requested
if [ ${R_DUCKDB_DEV} == "true" ]; then
${R_BIN} -e "remotes::install_github('duckdb/duckdb-r', build = FALSE)"
if [ "${R_DUCKDB_DEV}" == "true" ]; then
"${R_BIN}" -e "remotes::install_github('duckdb/duckdb-r', build = FALSE)"
fi

# Separately install the optional/test dependencies but don't error on them,
# they're not available everywhere and that's ok
${R_BIN} -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '"${INSTALL_ARGS}"')"
"${R_BIN}" -e "remotes::install_deps(dependencies = TRUE, INSTALL_opts = '${INSTALL_ARGS}')"

popd
Loading