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

large directories in tempdir cause error with NULL root #1658

Closed
aronatkins opened this issue Aug 22, 2023 · 3 comments
Closed

large directories in tempdir cause error with NULL root #1658

aronatkins opened this issue Aug 22, 2023 · 3 comments

Comments

@aronatkins
Copy link
Contributor

t <- tempfile()
dir.create(t)
for (each in seq_len(1001)) { writeLines(character(0), file.path(t, paste0(each, ".txt")))}
renv::dependencies(t)
#> Error in dirname(root): a character vector argument expected

Created on 2023-08-22 with reprex v2.0.2

This happens because renv:::renv_dependencies_root() returns NULL when provided the temporary directory as its path.

renv/R/dependencies.R

Lines 218 to 219 in ac7126d

path <- renv_path_normalize(path, mustWork = TRUE)
root <- root %||% renv_dependencies_root(path)

This is the underlying issue causing rstudio/rsconnect#968

@aronatkins
Copy link
Contributor Author

Workaround is to set renv.config.dependencies.limit.

options(renv.config.dependencies.limit = 10000)

Bypassing the "large directory" handling lets renv::dependencies() complete.

@aronatkins
Copy link
Contributor Author

This problem can be avoided by passing in a root argument to renv::dependencies():

renv::dependencies(t, root = t)

@kevinushey
Copy link
Collaborator

I think it ultimately comes down to this:

> renv:::renv_dependencies_root(t)
NULL

So, I think that setting root is the right solution here.

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

2 participants