Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quarto vignettes use the installed version of the package, but Rmd vignettes use the current dev version #2830

Open
venpopov opened this issue Dec 7, 2024 · 6 comments
Labels

Comments

@venpopov
Copy link

venpopov commented Dec 7, 2024

I just found out you can have Quarto vignettes and to try them out, I created a new package. I added a quarto vignette, but when I tried to build the site with build_site(), I got the following error:

── Installing package mytestpkg into temporary library ───────────────────────────────────────────
Error: 
! in callr subprocess.
Caused by error in `quarto::quarto_render(path, metadata_file = metadata_path, execute_dir = output_dir, …`:
! ✖ Error running quarto cli.
ℹ Rerun with `quiet = FALSE` to see the full error message.
Caused by error:
! System command 'quarto' failed
ℹ See `$stderr` for standard error.
Type .Last.error to see the more details.

Rendering regular .Rmd vignettes was fine. I was finally able to track down the issue: the code library(mytestpkg) in the vignette failed for the Quarto vignette, because in contrast to the Rmd vignette, it did not use see the temporary library.

Ok, so I install() the package locally and then it renders successfully. The problem is that if you make any updates, and you rebuild the website, the Quarto vignette will be built with the locally installed version, while the Rmd vignettes will be built with the current version that build_site() installs to a temporary library.

Screenshot 2024-12-07 at 07 11 58
Screenshot 2024-12-07 at 07 12 13

The deployment via github pages workflow doesn't have this problem and everything works fine, but locally Rmd and Qmd vignettes are built differently.

@hadley
Copy link
Member

hadley commented Dec 7, 2024

Hmmm, probably need to set R_LIBS to the temporary directory that we install the package into so that quarto uses it.

@Robinlovelace
Copy link

This may be related or the same: quarto-dev/quarto-actions#120

@Robinlovelace
Copy link

Update: @cderv confirmed that the above issue is the same as this. It is a bug that hinders use of .qmd files for vignettes and, unlike @venpopov's statement above, we found it can lead to error messages in Actions. I would say this is fairly high priority, anything I can do to help with diagnostics/fix testing let me know 🙏

@cderv
Copy link
Contributor

cderv commented Dec 19, 2024

Hmmm, probably need to set R_LIBS to the temporary directory that we install the package into so that quarto uses it.

I agree with this. @jayhesselberth I can help with that. I'll try to do a PR to fix this.

@jayhesselberth
Copy link
Collaborator

@cderv If is something that will come up frequently maybe this could also be adressed in the quarto R package with a lib_dir param for quarto_render()?

@cderv
Copy link
Contributor

cderv commented Dec 19, 2024

I am not sure it will be often, but surely in some context like pkgdown when

  • A package is installed in a temp directory added to current session .libPath()
  • quarto_render() is run with expectation of the library being available, which won't be the case if R_LIBS was not modified and passed to the new process.

pkgdown being the one to install in a temp directory, it would make sense for it to be sure this libs is known to the new process.

Thouhg, I wonder if this can create some issue with vignette engine too, so I'll check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants