Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backports/curl dependency may cause devtools::install_github("PolMine/cwbtools") to fail #21

Closed
ablaette opened this issue Jun 6, 2020 · 1 comment

Comments

@ablaette
Copy link
Collaborator

ablaette commented Jun 6, 2020

Just like many other packages, the function devtools::install_github() is recommended to install the development version of cwbtools. README.md recommends to use the following snippet:

devtools::install_github("PolMine/cwbtools", ref = "dev")

On Windows (not on macOS, Linux untested), this update mechanism may fail if a newer version of the packages curl or backports is available. The user is prompted whether the packages shall be updated, and if he/she agrees (the user behavior to be expected), binary packages are downloaded. But ultimately, there is an error telling that 'backports' or 'curl' cannot be deleted.

The reason seems to be as follows: The devtools package reimports the remotes package. The remotes package has curl as a dependency and attaches curl when it is attached, including loading the dll (dynamic library). However, the dll file is then write protected and cannot be overwritten / updated, causing the error.

The error can be cirumvented by not upgrading dependencies when being prompted to do so. An alternative might be to setting the argument upgrade as "never".

"Human" users may find this difficulty very hard to understand. Is there a recommended way to bring this issue to the attention of users?

@ablaette
Copy link
Collaborator Author

ablaette commented Jun 7, 2020

I posted this issue on the R-devel mailing list and received this very helpful hint from Gabor Csardi:

Hi, you can use the remotes package (that devtools itself uses under
the hood), and set the R_REMOTES_STANDALONE="true" environment
variable. Then remotes will not use any packages to perform the
downloads and the installations. See more here:
https://github.com/r-lib/remotes#standalone-mode

Gabor


Thus, this piece of code is included in the README file and explained somewhat:

Sys.setenv(R_REMOTES_STANDALONE = "true")
remotes::install_github("PolMine/cwbtools", ref = "dev", force = TRUE)

@ablaette ablaette closed this as completed Jun 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant