krlmlr / r-appveyor

Tools for using R with AppVeyor (https://appveyor.com)
132 stars 60 forks source link

"Cannot open URL" when downloading GitHub dependency on R 3.4.1 #153

Closed grst closed 5 years ago

grst commented 5 years ago

On R 3.4.1 the download of Github dependencies fails in appveyor. More recent R versions (tested 3.5.1 and release) work without problems.

    C:\Users\appveyor\AppData\Local\Temp\1\RtmpieB5b0\downloaded_packages
+ return
+ Rscript -e 'if (!("remotes" %in% rownames(installed.packages()))) q(status=1)'
+ Rscript -e 'options(repos=c(CRAN="https://cran.rstudio.com")); remotes::install_deps(dependencies = TRUE, type="both")'
Error in utils::download.file(url, path, method = download_method(), quiet = quiet,  : 
  cannot open URL 'https://api.github.com/repos/r-lib/conflicted/contents/DESCRIPTION?ref=master&access_token=*****'
Calls: <Anonymous> ... remote_package_name.github_remote -> github_DESCRIPTION -> download -> base_download
Execution halted
Command exited with code 1

I could reproduce the issue in a minimal example repo:

The problem seems to be related to the download.file.method. This has already been discussed in https://github.com/r-lib/remotes/issues/130, but the issue has not been fixed there. When I patch r-appveyor and force the download method to wininet, everything works fine. (Neither curl, libcurl, wget worked...).

Maybe it makes sense to use wininet as default method in r-appveyor? After all, it's intended for windows only.

krlmlr commented 5 years ago

Thanks. Perhaps we can expose this through an environment variable first? Would you like to submit a PR?

krlmlr commented 5 years ago

I'm seeing this too now for R 3.2. Thanks for confirming the minimum version.

krlmlr commented 5 years ago

Done in 0c08e43b.