krlmlr/r-appveyor

Build check fails due to `contrib.url()` attempting to use CRAN without mirror

mjsteinbaugh opened this issue · 5 comments

Hi @krlmlr, I think I'm seeing a new error pop up for AppVeyor checking an R package that depends on Bioconductor:

+ Rscript -e 'if (getRversion() >= '\''3.5.0'\'') {if (!requireNamespace('\''BiocManager'\'', quietly=TRUE)) install.packages('\''BiocManager'\''); if (TRUE) BiocManager::install(version = '\''devel'\''); options(repos=BiocManager::repositories())} else {source('\''http://bioconductor.org/biocLite.R'\''); tryCatch(useDevel(TRUE), error=function(e) {if (!grepl('\''already in use'\'', e)) {e}}); options(repos=biocinstallRepos())}; library(devtools); install_deps(dependencies = TRUE, type="both")'
Installing package into 'c:/RLibrary'
(as 'lib' is unspecified)
Error in contrib.url(repos, "source") : 
  trying to use CRAN without setting a mirror
Calls: install.packages -> contrib.url
Execution halted

Here's a link to a recent build check log file where this error occurs:
https://ci.appveyor.com/api/buildjobs/nwpqkrbqpctc40py/log

I think it's related to pull request #125.

@LiNk-NY: Could you please take a look?

It sounds like it's from the build environment that doesn't have a default CRAN setting in ~/.Rprofile.
It was a similar issue on Travis CI:
craigcitro/r-travis#173

Usually you get something like below by default in R:

getOption("repos")
    CRAN 
"@CRAN@"

I can set a default repos argument, in the install.packages function

@mjsteinbaugh can you confirm the issue is resolved? Thanks!