From b7c03dfcf2ce6f3a6ffb1e30762d2aa81075c6c7 Mon Sep 17 00:00:00 2001 From: "Zhian N. Kamvar" Date: Tue, 24 Oct 2023 13:22:52 -0700 Subject: [PATCH] exclude lockfile packages from hydration --- R/utils-renv.R | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/R/utils-renv.R b/R/utils-renv.R index a9c23c3bf..54ba727dd 100644 --- a/R/utils-renv.R +++ b/R/utils-renv.R @@ -250,6 +250,12 @@ callr_manage_deps <- function(path, repos, snapshot, lockfile_exists) { deps <- unique(renv::dependencies(path = path, root = path, dev = TRUE)$Package) pkgs <- setdiff(deps, installed) needs_hydration <- length(pkgs) > 0 + if (packageVersion("renv") >= "1.0.0") { + # We only need to hydrate the packages that do not exist in the lockfile + # and that are not installed + lock <- renv::lockfile_read(renv_lock) + pkgs <- setdiff(pkgs, names(lock$Packages)) + } } else { # If there is not a lockfile, we need to run a fully hydration pkgs <- NULL