radian crashes with `rmarkdown::render_site()`
Radian crashes with the following error (courtesy of vscode):
The terminal process "c:\Python\Python39\Scripts\radian.exe '--no-save', '--no-restore'" terminated with exit code: 3221225725.
when attempting: rmarkdown::render_site()
The issue persisted when running radian from the console (cmd.exe).
I'm using Windows 10, radian version:
radian version: 0.5.11 r executable: C:\R\R-4.1.0\bin\R r version: 4.1.0 python executable: c:\python\python39\python.exe python version: 3.9.5
To be honest, I have no idea, likely something interactive has broken radian. Could you do debug(rmarkdown::render_site) and check which lines of code are breaking it?
The crash starts with line 13:
if (is.null(generator))
stop("No site generator found.")
generator$render(input_file = input_file, output_format = output_format,
envir = envir, quiet = quiet)
It crashes pretty quickly, so I don't think my document is getting rendered at all.
Could you step in generator$render and check?
I'm not very good at debugging. The farthest I got was here:
where 1: same_path(dir, file.path(dir, ".."))
where 2: proj_root(input, "^index.R?md$", "^\\s*site:.*::.*$")
where 3: doTryCatch(return(expr), name, parentenv, handler)
where 4: tryCatchOne(expr, names, parentenv, handlers[[1L]])
where 5: tryCatchList(expr, classes, parentenv, handlers)
where 6: tryCatch(proj_root(input, "^index.R?md$", "^\\s*site:.*::.*$"),
error = function(e) NULL)
where 7: site_generator(input, output_format)
where 8: rmarkdown::render_site()
but I'm just making blind guesses about where to step in and where to skip functions.
Thanks @fisher-j for the report. We have pushed a fixed in rmarkdown dev version that should solve the issue. It seems using RStudio was hiding the issue somehow.
In my test with radian this seems to be fixed.
I recall that python on Windows has a different stack size which makes radian on windows easily subject to these kind of issues.
Oh this would explain why the issue does not arise on R console then. @fisher-j confirmed it worked in https://github.com/rstudio/rmarkdown/issues/2339#issuecomment-1081139955 so I guess the issue could be closed here.
However, this means than rmarkdown::render_site() with radian require dev version of rmarkdown - Precising for anyone finding this issue and wondering about the fix. Next working release will be rmarkdown 2.14