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

error reporting large directories #968

Closed
aronatkins opened this issue Aug 22, 2023 · 4 comments · Fixed by #969
Closed

error reporting large directories #968

aronatkins opened this issue Aug 22, 2023 · 4 comments · Fixed by #969

Comments

@aronatkins
Copy link
Contributor

Set-up:

# create a new project
usethis::create_project("~/Desktop/many-files")
# within the project, create a shiny application
writeLines(c(
        "shinyApp(ui = fluidPage('so many files.'), server = function(input, output){})"
    ), "app.R")
# create many (tiny) files
dir.create("so-many-files")
for (each in seq_len(1001)) { writeLines(character(0), file.path("so-many-files", paste0(each, ".txt")))}

Error:

rsconnect::writeManifest()
#> ℹ Capturing R dependencies with renv
#> Error in dirname(root): a character vector argument expected

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

@aronatkins
Copy link
Contributor Author

This may be related to rstudio/renv#1657.

Additionally, renv has its own renv.config.dependencies.limit option that is used to control the number of files allowed when scanning for dependencies.

rsconnect should mirror its rsconnect.max.bundle.files value onto renv.config.dependencies.limit before using renv::dependencies().

@aronatkins
Copy link
Contributor Author

aronatkins commented Aug 22, 2023

The stack from the rsconnect::writeManifest() error:

21: dirname(root) at dependencies.R#429
20: nchar(prefix)
19: substring(string, 1, nchar(prefix)) at bootstrap.R#36
18: startswith(path, root) at path.R#147
17: renv_path_relative(path, dirname(root)) at dependencies.R#429
16: renv_dependencies_find_dir_children(path, root, depth) at dependencies.R#399
15: renv_dependencies_find_dir(path, root, depth) at dependencies.R#376
14: FUN(X[[i]], ...)
13: lapply(x, f, ...) at utils-map.R#57
12: map(children, renv_dependencies_find_impl, root = root, depth = depth) at dependencies.R#406
11: renv_dependencies_find_dir(path, root, depth) at dependencies.R#376
10: FUN(X[[i]], ...)
9: lapply(path, renv_dependencies_find_impl, root = root, depth = 0) at dependencies.R#353
8: renv_dependencies_find(path, root) at dependencies.R#236
7: renv_dependencies_impl(path = path, root = root, quiet = quiet, 
       progress = progress, errors = errors, dev = dev, ...) at dependencies.R#195
6: renv::dependencies(bundleDir) at bundlePackageRenv.R#14
5: snapshotRenvDependencies(bundleDir, extraPackages, verbose = verbose) at bundlePackage.R#66
4: computePackageDependencies(bundleDir, extraPackages, quiet = quiet, 
       verbose = verbose) at bundlePackage.R#7
3: bundlePackages(bundleDir = appDir, extraPackages = extraPackages, 
       verbose = verbose, quiet = quiet) at bundle.R#118
2: createAppManifest(appDir = bundleDir, appMetadata = appMetadata, 
       pythonConfig = pythonConfig, retainPackratDirectory = FALSE, 
       image = image, verbose = verbose, quiet = quiet) at writeManifest.R#58
1: rsconnect::writeManifest()

@aronatkins
Copy link
Contributor Author

Caused by rstudio/renv#1658

@aronatkins
Copy link
Contributor Author

Workaround: Avoid renv large-directory enforcement.

options(rsconnect.max.bundle.files = 100000, renv.config.dependencies.limit = 100000)

aronatkins added a commit that referenced this issue Aug 22, 2023
additionally, do not let renv infer the root.

fixes #968
aronatkins added a commit that referenced this issue Aug 22, 2023
* renv dependency limit mirrors the rsconnect bundle limit

additionally, do not let renv infer the root.

fixes #968

* news

* skip large directory test on CRAN and CI

Windows is producing (unexpected) snapshot differences that
appear related to file enumeration.

* no progress output; re-enable tests
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

Successfully merging a pull request may close this issue.

1 participant