Skip to content

build_readme() extremely slow due to pak::local_install_deps() installing full dependency tree in temp #2683

@BjarkeHautop

Description

@BjarkeHautop

After the release of devtools 2.5.0, build_readme() has become very slow for packages with moderate dependency trees.

build_readme() installs the package in a temporary directory

withr::local_temp_libpaths(.local_envir = env)

Because of this, pak::local_install_deps() installs the entire dependency tree in temp, even if all dependencies are already installed in the user's normal libraries. This is intended pak behavior, see
https://github.com/r-lib/pak/blob/63d646be4d2d59c29ea02cd99a68fb5b2c4164fd/R/package.R#L15-L17
(and is different from how remotes does it).

For packages with heavier dependency trees, this can add several minutes to build_readme(). E.g. for a package I maintain, on my machine it takes ~7 minutes to complete the pak::local_install_deps() call (~90 seconds if using Posit Package Manager binaries).

While this is happening, no useful progress information is printed, even with quiet = FALSE. The user sees no indication that a large dependency installation is occurring.

Metadata

Metadata

Assignees

No one assigned

    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