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

Should Git Remotes Dependencies Parse Package name #661

Closed muschellij2 closed 2 years ago

muschellij2 commented 2 years ago

Issue: Git Remotes (usually what I use for SSH-auth'd remotes) does not parse the package name when using dev_package_deps

Sys.setenv(GITHUB_PAT = "")
desc = desc::description$new("!new")
desc$set("Imports", "nsrr")
desc$set("Remotes", "git::git@github.com:muschellij2/nsrr")
tfile = tempfile()
dir.create(tfile)
descfile = file.path(tfile, "DESCRIPTION")
desc$write(file = descfile)

remotes::dev_package_deps(tfile)
#> Needs update -----------------------------
#>  package installed available    is_cran remote
#>  NA      NA        c8feb6ad1... FALSE   Git   
#> Not on CRAN ----------------------------
#>  package installed  available is_cran remote
#>  httr    1.4.2.9000 1.4.2     TRUE    CRAN

Trying standalone mode, similar

Sys.setenv(R_REMOTES_STANDALONE="true")
remotes::dev_package_deps(tfile)
#> Needs update -----------------------------
#>  package installed available    is_cran remote
#>  NA      NA        c8feb6ad1... FALSE   Git   
#> Not on CRAN ----------------------------
#>  package installed  available is_cran remote
#>  httr    1.4.2.9000 1.4.2     TRUE    CRAN

Created on 2021-10-22 by the reprex package (v2.0.0)

Session info ``` r sessioninfo::session_info() #> ─ Session info ────────────────────────────────────────────────────────────── #> hash: umbrella with rain drops, bell, snowman without snow #> #> setting value #> version R version 4.1.0 (2021-05-18) #> os Debian GNU/Linux 10 (buster) #> system x86_64, linux-gnu #> ui X11 #> language (EN) #> collate C.UTF-8 #> ctype C.UTF-8 #> tz Etc/UTC #> date 2021-10-22 #> pandoc 2.14.0.2 @ /opt/conda/bin/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> cli 3.0.1.9000 2021-10-22 [1] Github (r-lib/cli@3033bc5) #> crayon 1.4.1 2021-02-08 [2] CRAN (R 4.1.0) #> desc 1.4.0 2021-09-28 [1] CRAN (R 4.1.0) #> digest 0.6.28 2021-09-23 [1] CRAN (R 4.1.0) #> evaluate 0.14 2019-05-28 [2] CRAN (R 4.1.0) #> fastmap 1.1.0 2021-01-25 [2] CRAN (R 4.1.0) #> fs 1.5.0 2020-07-31 [2] CRAN (R 4.1.0) #> glue 1.4.2 2020-08-27 [2] CRAN (R 4.1.0) #> highr 0.9 2021-04-16 [2] CRAN (R 4.1.0) #> htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.1.0) #> knitr 1.36 2021-09-29 [1] CRAN (R 4.1.0) #> magrittr 2.0.1 2020-11-17 [2] CRAN (R 4.1.0) #> R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.0) #> remotes 2.4.1.9000 2021-10-22 [1] Github (r-lib/remotes@eb15a1e) #> reprex 2.0.0 2021-04-02 [2] CRAN (R 4.1.0) #> rlang 0.4.12 2021-10-18 [1] CRAN (R 4.1.0) #> rmarkdown 2.9 2021-06-15 [2] CRAN (R 4.1.0) #> rprojroot 2.0.2 2020-11-15 [2] CRAN (R 4.1.0) #> rstudioapi 0.13 2020-11-12 [2] CRAN (R 4.1.0) #> sessioninfo 1.1.1.9000 2021-10-22 [1] Github (muschellij2/sessioninfo@a4a39f1) #> stringi 1.7.5 2021-10-04 [1] CRAN (R 4.1.0) #> stringr 1.4.0 2019-02-10 [2] CRAN (R 4.1.0) #> withr 2.4.2 2021-04-18 [2] CRAN (R 4.1.0) #> xfun 0.27 2021-10-18 [1] CRAN (R 4.1.0) #> yaml 2.2.1 2020-02-01 [2] CRAN (R 4.1.0) #> #> [1] /home/jupyter/.R/library #> [2] /usr/local/lib/R/site-library #> [3] /usr/lib/R/site-library #> [4] /usr/lib/R/library #> #> ────────────────────────────────────────────────────────────────────────────── ```
muschellij2 commented 2 years ago

Looking into this further, it it fails at remote_package_name: https://github.com/r-lib/remotes/blob/eb15a1eb21cca47ce5601747fd4e033d8606a648/install-github.R#L1128, which fails for GitHub repos as GitHub doesn't allow git archive commands:

https://twitter.com/GitHubHelp/status/322818593748303873

muschellij2 commented 2 years ago

Seeing as this is a GitHub thing and not remotes just adding this for text searching then closing:

Invalid command: 'git-upload-archive 
  You appear to be using ssh to clone a git:// URL.
  Make sure your core.gitProxy config option and the
  GIT_PROXY_COMMAND environment variable are NOT set.