Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions renv/activate.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
local({

# the requested version of renv
version <- "1.1.7"
attr(version, "md5") <- "dd5d60f155dadff4c88c2fc6680504b4"
version <- "1.2.0"
attr(version, "md5") <- "b7d230b07507f361d3bcf794d157a188"
attr(version, "sha") <- NULL

# the project directory
Expand Down Expand Up @@ -226,13 +226,17 @@ local({
section <- header(sprintf("Bootstrapping renv %s", friendly))
catf(section)

# ensure the target library path exists; required for file.copy(..., recursive = TRUE)
dir.create(library, showWarnings = FALSE, recursive = TRUE)

# try to install renv from cache
md5 <- attr(version, "md5", exact = TRUE)
if (length(md5)) {
pkgpath <- renv_bootstrap_find(version)
if (length(pkgpath) && file.exists(pkgpath)) {
file.copy(pkgpath, library, recursive = TRUE)
return(invisible())
ok <- file.copy(pkgpath, library, recursive = TRUE)
if (isTRUE(ok))
return(invisible())
}
}

Expand Down Expand Up @@ -1231,6 +1235,21 @@ local({
}

renv_bootstrap_run <- function(project, libpath, version) {
tryCatch(
renv_bootstrap_run_impl(project, libpath, version),
error = function(e) {
msg <- paste(
"failed to bootstrap renv: the project will not be loaded.",
paste("Reason:", conditionMessage(e)),
"Use `renv::activate()` to re-initialize the project.",
sep = "\n"
)
warning(msg, call. = FALSE)
}
)
}

renv_bootstrap_run_impl <- function(project, libpath, version) {

# perform bootstrap
bootstrap(version, libpath)
Expand Down
8 changes: 4 additions & 4 deletions renv/profiles/lesson-requirements/renv.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"R": {
"Version": "4.5.2",
"Version": "4.5.3",
"Repositories": [
{
"Name": "carpentries",
Expand All @@ -19,7 +19,7 @@
"Packages": {
"renv": {
"Package": "renv",
"Version": "1.1.7",
"Version": "1.2.0",
"Source": "Repository",
"Type": "Package",
"Title": "Project Environments",
Expand Down Expand Up @@ -61,16 +61,16 @@
"webfakes"
],
"Encoding": "UTF-8",
"NeedsCompilation": "yes",
"RoxygenNote": "7.3.3",
"VignetteBuilder": "knitr",
"Config/Needs/website": "tidyverse/tidytemplate",
"Config/testthat/edition": "3",
"Config/testthat/parallel": "true",
"Config/testthat/start-first": "bioconductor,python,install,restore,snapshot,retrieve,remotes",
"NeedsCompilation": "no",
"Author": "Kevin Ushey [aut, cre] (ORCID: <https://orcid.org/0000-0003-2880-7407>), Hadley Wickham [aut] (ORCID: <https://orcid.org/0000-0003-4757-117X>), Posit Software, PBC [cph, fnd]",
"Maintainer": "Kevin Ushey <kevin@rstudio.com>",
"Repository": "CRAN"
"Repository": "https://packagemanager.posit.co/cran/__linux__/jammy/latest"
}
}
}
Loading