Skip to content

Internal R tar is not handling long filenames. #648

@galachad

Description

@galachad

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?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions