Hi pacrat is using tar="internal". It's perfect solution for compatibility between different systems but internal R tar is not handling long directory names.
|
suppressWarnings(untar(srczip, exdir = scratchDir, tar = "internal")) |
Impact: RStudio products, Windows users
Example: Installing package from gitlab with long slug is not working. (https://gitlab.com/adam.forys/long-test-slug-skeleton)
Why it's happening?
Gitlab endpoint {gitlab_host}/api/v4/projects/{repository}/repository/archive?sha={sha}
generate tar.gz file that contains directory created as repository-slug-sha-sha/ so it gave long-test-slug-skeleton-958296dbbbf7f1d82f7f5dd1b121c7558604809f-958296dbbbf7f1d82f7f5dd1b121c7558604809f and untar(tar="internal") returns error Error in file(name, "wb") : cannot open the connection.
Installing package by packrat for repository slug that has more that 16 characters will fail.
Because packrat is soft deprecated it's only impact RStudio Connect/shinyapps etc. (Rstudio product).
This problem is not an issue for renv as renv is detecting system tar.
My recommendation is replace "internal" with Sys.getenv("TAR", "internal").
untar(srczip, exdir = scratchDir, tar = Sys.getenv("TAR", "internal"))
After this change untar will be using system tar when set.
Question:
Is any chance this change will be apply in next Rstudio Connect release?
Hi pacrat is using
tar="internal". It's perfect solution for compatibility between different systems but internal R tar is not handling long directory names.packrat/R/restore.R
Line 481 in 3df1d62
Impact: RStudio products, Windows users
Example: Installing package from gitlab with long slug is not working. (https://gitlab.com/adam.forys/long-test-slug-skeleton)
Why it's happening?
Gitlab endpoint
{gitlab_host}/api/v4/projects/{repository}/repository/archive?sha={sha}generate
tar.gzfile that contains directory created asrepository-slug-sha-sha/so it gavelong-test-slug-skeleton-958296dbbbf7f1d82f7f5dd1b121c7558604809f-958296dbbbf7f1d82f7f5dd1b121c7558604809fanduntar(tar="internal")returns errorError in file(name, "wb") : cannot open the connection.Installing package by packrat for repository slug that has more that 16 characters will fail.
Because packrat is soft deprecated it's only impact RStudio Connect/shinyapps etc. (Rstudio product).
This problem is not an issue for
renvasrenvis detecting system tar.My recommendation is replace
"internal"withSys.getenv("TAR", "internal").After this change untar will be using system tar when set.
Question:
Is any chance this change will be apply in next Rstudio Connect release?