r-lib / remotes

Install R packages from GitHub, GitLab, Bitbucket, git, svn repositories, URLs
https://remotes.r-lib.org/
Other
331 stars 152 forks source link

update_packages() fails if R_REMOTES_STANDALONE=true #667

Closed jonathan-g closed 2 years ago

jonathan-g commented 2 years ago

On my system, if I run remotes::update_packages() after Sys.setenv(R_REMOTES_STANDALONE="true"), I reproducibly get an error message

Sys.setenv(R_REMOTES_STANDALONE="true")
remotes::update_packages()
#> Error in utils::download.file(url, path, method = method, quiet = quiet, : cannot open URL 'https://api.github.com/repos/gadenbuie/ggpomological/commits/master'

Created on 2021-11-08 by the reprex package (v2.0.1)

but if I run Sys.unsetenv("R_REMOTES_STANDALONE") in the same session, then remotes::update_packages() works.

Sys.unsetenv("R_REMOTES_STANDALONE")
remotes::update_packages()
#> These packages have more recent versions available.
#> It is recommended to update all of them.
#> Which would you like to update?
#>
#> 1: All                                            
#> 2: CRAN packages only                             
#> 3: None                                           
#> ...
Session info ``` r sessioninfo::session_info() #> - Session info -------------------------------------------------------------- #> hash: bowl with spoon, woman farmer: medium-light skin tone, glass of milk #> #> setting value #> version R version 4.1.1 (2021-08-10) #> os Windows 10 x64 (build 19043) #> system x86_64, mingw32 #> ui RTerm #> language (EN) #> collate English_United States.1252 #> ctype English_United States.1252 #> tz America/Chicago #> date 2021-11-08 #> pandoc 2.14.0.3 @ C:/Program Files/RStudio/bin/pandoc/ (via rmarkdown) #> #> - Packages ------------------------------------------------------------------- #> package * version date (UTC) lib source #> backports 1.3.0 2021-10-27 [1] CRAN (R 4.1.1) #> cli 3.1.0 2021-10-27 [1] CRAN (R 4.1.1) #> crayon 1.4.2 2021-10-29 [1] CRAN (R 4.1.1) #> digest 0.6.28 2021-09-23 [1] CRAN (R 4.1.1) #> ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.0) #> fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.0) #> fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.1.0) #> fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.0) #> glue 1.5.0 2021-11-07 [1] CRAN (R 4.1.1) #> highr 0.9 2021-04-16 [1] CRAN (R 4.1.0) #> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.1.1) #> knitr 1.36 2021-09-29 [1] CRAN (R 4.1.1) #> lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.1) #> magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.0) #> pillar 1.6.4 2021-10-18 [1] CRAN (R 4.1.1) #> pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.0) #> purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.0) #> R.cache 0.15.0 2021-04-30 [1] CRAN (R 4.1.0) #> R.methodsS3 1.8.1 2020-08-26 [1] CRAN (R 4.1.0) #> R.oo 1.24.0 2020-08-26 [1] CRAN (R 4.1.0) #> R.utils 2.11.0 2021-09-26 [1] CRAN (R 4.1.1) #> remotes 2.4.1 2021-09-29 [1] CRAN (R 4.1.1) #> reprex 2.0.1 2021-08-05 [1] CRAN (R 4.1.0) #> rlang 0.99.0.9000 2021-11-08 [1] Github (r-lib/rlang@5ec22a6) #> rmarkdown 2.11.3 2021-10-30 [1] local #> rstudioapi 0.13.0-9000 2021-07-07 [1] Github (rstudio/rstudioapi@96fad1d) #> sessioninfo 1.2.1 2021-11-02 [1] CRAN (R 4.1.1) #> stringi 1.7.5 2021-10-04 [1] CRAN (R 4.1.1) #> stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.0) #> styler 1.6.2 2021-09-23 [1] CRAN (R 4.1.1) #> tibble 3.1.6 2021-11-07 [1] CRAN (R 4.1.1) #> utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.0) #> vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.0) #> withr 2.4.2 2021-04-18 [1] CRAN (R 4.1.0) #> xfun 0.28 2021-11-04 [1] CRAN (R 4.1.1) #> yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0) #> #> [1] C:/Users/Jonathan/Documents/R/win-library/4.1 #> [2] C:/Program Files/R/R-4.1.1/library #> #> ------------------------------------------------------------------------------ ```
jonathan-g commented 2 years ago

I have figured out that this has to do with the GitHub repository having moved the default branch from master to main. If I reinstall the GitHub package using install_github() with ref = "main", then the problem goes away, so I'm closing this issue.