Unverified Commit f7168e5d authored by James Lamb's avatar James Lamb Committed by GitHub
Browse files

[ci] fall back to source installs of R packages if binary missing (fixes #3875) (#3876)

* [ci] fall back to source installs of R packages if binary missing

* source option

* changing source policy

* install withr separately

* uncomment CI
parent 040b1c54
...@@ -97,13 +97,18 @@ if [[ $OS_NAME == "macos" ]]; then ...@@ -97,13 +97,18 @@ if [[ $OS_NAME == "macos" ]]; then
fi fi
fi fi
# hack to fix https://github.com/microsoft/LightGBM/pull/3876#issuecomment-769187766
if [[ $OS_NAME == "macos" ]]; then
Rscript --vanilla -e "install.packages('withr', repos = '${CRAN_MIRROR}', type = 'source', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'))"
fi
# Manually install Depends and Imports libraries + 'testthat' # Manually install Depends and Imports libraries + 'testthat'
# to avoid a CI-time dependency on devtools (for devtools::install_deps()) # to avoid a CI-time dependency on devtools (for devtools::install_deps())
packages="c('data.table', 'jsonlite', 'Matrix', 'R6', 'testthat')" packages="c('data.table', 'jsonlite', 'Matrix', 'R6', 'testthat')"
if [[ $OS_NAME == "macos" ]]; then if [[ $OS_NAME == "macos" ]]; then
packages+=", type = 'binary'" packages+=", type = 'both'"
fi fi
Rscript --vanilla -e "install.packages(${packages}, repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'))" || exit -1 Rscript --vanilla -e "options(install.packages.compile.from.source = 'both'); install.packages(${packages}, repos = '${CRAN_MIRROR}', lib = '${R_LIB_PATH}', dependencies = c('Depends', 'Imports', 'LinkingTo'))" || exit -1
cd ${BUILD_DIRECTORY} cd ${BUILD_DIRECTORY}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment