-
Notifications
You must be signed in to change notification settings - Fork 154
Description
Hi,
Trying to solve this issue with devtools::install_github (r-lib/devtools#1403), I found that remotes package is probably the next thing for some functions in devtools. So I tried it.
However, I encountered an issue as I am on windows and behind a proxy. Trying to install a github package throws an error
remotes::install_github("hadley/lubridate")
#> Error in utils::download.file(url, path, method = download_method(), quiet = quiet, :
#> cannot download all filesand even crash R session if proxy is not configured correctly.
This issue is clearly proxy-related.
below is what I have done to make it work. See at the end for Suggestions
About proxy configuration
Proxy configuration is not the easy thing but I managed to deal with it most of the time. Configuring R to Use an HTTP or HTTPS Proxy by RStudio support team helps.
However, the easiest way on windows is to rely on wininet methods which is the default for download.file. see in windows help:
If method = "auto" is chosen (the default), on Windows the "wininet" method is used apart from for ftps:// URLs where "libcurl" is tried. The "wininet" method uses the WinINet functions (part of the OS).
wininet deals with proxy using the 'Internet Option' of the system. And it is used even if libcurl is available (capabilities("libcurl") is TRUE)
In remotes, by default remotes:::download calls remotes:::download_method in which the default is libcurl if it is available. Then, if not, it is wininet
At first, default behavior threw an error. With some efforts I manage to make it work by configuring proxy differently.
- The way describe in Configuring R to Use an HTTP or HTTPS Proxy does not work anymore as it is correct for
internalonly. - For
libcurl, the form to use ishttp[s]://[user:password@]machine[:port]. Downloading part ofremotespackage is now working correctly. - For
httrpackage, I usesset_configanduse_proxyto make it work. (Needed fordevtoolsthen as it is working withhttr) but I think thehttp_proxyenvironnement variable is also working
Suggestion
At the end, I found how to deal with the issue. However, I think it could be useful to clarify all this about proxy configuration
- By making
wininetthe default on windows before testingcapabilities("libcurl")inremotes:::download_method - If
libcurlstays the default, by adding some informations in a vignette or in help file to help those behind a proxy. And maybe try to prevent errors or crashes.
What do you think of all this ? I willing to help if you interested as I planned to write something about all this configuration.