Executing quarto render [target]
randomly emits 'renv-snapshot dependency-discovery'-messages at random locations and intervals
#10493
-
DescriptionHello, I am quite a bit confused. $ quarto render experiments/ --to html
scripts/pre-render/isQuartoProject.R
NOTE: Dependency discovery took 11 seconds during snapshot.
Consider using .renvignore to ignore files, or switching to explicit snapshots.
See `?renv::dependencies` for more information. This project uses renv; and during pre-render it will manually call cat("\014") ## clear console
library(stringr)
remove (list = ls()) ## clear environment variables
start <- Sys.time()
root <- fs::path_abs(".")
source(normalizePath(str_c(root, "\\scripts\\utility\\log.R")))
renv_path <- normalizePath(str_c(root,"\\renv.lock"))
commit_renv <- function(renv_path,message = "") {
system(paste("git add renv.lock"))
date_string <- format(Sys.time(), "%Y-%m-%d %H:%M")
commit_message <- str_c(message," ",date_string)
commit_command <- paste0("git commit -q -m", shQuote(commit_message))
system(commit_command)
}
if (isFALSE(file.exists(renv_path))) {
cli::cli_alert_danger(str_c("No renv-lockfile found. Package dependencies are not tracked for this project!"))
} else {
current_branch <- system("git rev-parse --abbrev-ref HEAD", intern = TRUE)
if (isFALSE(current_branch=="master")) {
cli::cli_alert_warning("Current branch is not master. Lockfile will not be updated/committed.")
} else {
minutes <- 60
threshold <- 60 * minutes # set update-threshold in minutes.
current_time <- Sys.time()
# make sure lockfile is only updated every X hours/minutes
last_renv_update_file <- normalizePath(str_c(root,"\\scripts\\excludes\\logs\\lastrenvupdate.txt"))
if (isFALSE(file.exists(last_renv_update_file))) {
# If the file does not exist, create it and write the timestamp of the current time minus the threshold
initial_time <- current_time - threshold
write(as.character(initial_time), file = last_renv_update_file)
}
stored_time <- as.POSIXct(readLines(last_renv_update_file))
time_difference <- difftime(Sys.time(), stored_time, units = "secs")
# threshold in seconds: 20 minues
if (time_difference>=threshold) {
cli::cli_alert_info("Updating renv-lockfile.")
renv::snapshot(confirm = FALSE)
cli::cli_alert_success("The renv-lockfile was updated.")
cli::cli_alert_info("Committing renv-lockfile")
commit_renv(renv_path = renv_path, message = "Chore: update renv-lockfile.")
cli::cli_alert_success("Changes to renv-lockfile were committed.")
write(as.character(current_time), file = last_renv_update_file)
} else {
cli::cli_alert_info(str_c("The renv-file was updated and committed within the last ", minutes, " minutes. Skipping updates."))
}
}
} This script is executed second: project:
type: website
output-dir: _site
execute-dir: project
render: # order in project.render is important; because documents are rendered in this order. a change that should suppress an update in 5 minutes
- report/manuscript.qmd
- "*.qmd"
- "*.md"
- "!__packages-citations.md"
- "!excludes/*.md"
- "!excludes/*.qmd"
- "!private/*/*.md"
- "!private/*/*.qmd"
- "!private/*.md"
- "!private/*.qmd"
- "!assets/*/*.md"
- "!assets/*/*.qmd"
- "!report/parts/*introduction.md"
- "!report/parts/*.qmd"
- "!report/exp_analyses/*.qmd" # do not render parts which are only to be embedded into the report
- "!README.md"
pre-render:
- scripts/pre-render/isQuartoProject.R
- scripts/pre-render/update_renv_lockfile.R
- scripts/pre-render/run_OK_on_OKRequired.R
- scripts/pre-render/rename_to_QMD.R
- scripts/pre-render/updateCodeReferences.R There are a couple things to note:
At the bottom of this discussion I have attached parts of a I cannot currently reliably replicate this issue, I don't even know what triggers it. I am posting this because I don't see how this message should be displaceable like this. No other message emitted by any other script so far has shown similar behaviour. Does quarto interact with renv under the hood in any way that could reasonably lead to this super weird behaviour? Thank you. quarto check: Quarto 1.5.54
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.2.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.41.0: OK
Typst version 0.11.0: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.5.54
Path: D:\CLI\quarto\bin
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: v2024.02
Chromium: 869685
[>] Checking LaTeX....................OK
Using: TinyTex
Path: C:\ProgramData\TinyTeX\bin\windows\
Version: 2023
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....(None)
Unable to locate an installed version of Python 3.
Install Python 3 from https://www.python.org/downloads/
[>] Checking R installation...........OK
Version: 4.4.0
Path: D:/CLI/r/R-4.4.0
LibPaths:
- D:/Dokumente neu/Obsidian NoteTaking/BE31-Thesis-quarto/.renv/library/R-4.4/x86_64-w64-mingw32
- C:/Users/Claudius Main/AppData/Local/R/cache/R/renv/sandbox/R-4.4/x86_64-w64-mingw32/501e432c
knitr: 1.45
rmarkdown: 2.25
[>] Checking Knitr engine render......OK Partial output of
Footnotes
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
This message comes from |
Beta Was this translation helpful? Give feedback.
You are asking in the wrong repository.
Quarto is only starting R process, everything else is not Quarto's doing.
If you want to understand
renv
dependencies discovery go torenv
repository.