r-hub / rhub

R-hub API client
https://r-hub.github.io/rhub/
Other
353 stars 52 forks source link

rhub Windows errors on vignette building with no error output? #499

Closed hiweller closed 2 years ago

hiweller commented 2 years ago

I'm preparing a package for CRAN (here: https://github.com/hiweller/recolorize), but I'm running into a problem checking it on Windows. The package builds fine on win-builder, with only a note about this being a new submission, but on rhub I get this warning:

* checking re-building of vignette outputs ... WARNING
  ...
Error(s) in re-building vignettes:
--- re-building 'Introduction.Rmd' using rmarkdown

I'm assuming this is because rhub uses the --as-cran option, but I'm not sure what the ... warning means or how to fix it. The vignettes build fine on the other rhub platforms, locally (Linux), travis-ci, and win-builder, and I can't find any further details on the problem in any of the other .Rcheck files. Is there a way for me to figure this out?

gaborcsardi commented 2 years ago

I'm assuming this is because rhub uses the --as-cran option

rhub uses whatever you set. check_for_cran() defaults to using --as-cran, check() defaults not to. But you can always set your command line arguments with check_args.

The vignettes build fine on the other rhub platforms, locally (Linux), travis-ci, and win-builder

It seems to me that win-builder has the same issue? https://win-builder.r-project.org/incoming_pretest/recolorize_0.1.0_20211205_021403/Windows/00check.log says

* checking re-building of vignette outputs ... [53s] WARNING
Error(s) in re-building vignettes:
--- re-building 'Introduction.Rmd' using rmarkdown
--- finished re-building 'Introduction.Rmd'
--- re-building 'gallery.Rmd' using rmarkdown

So maybe your vignette does not work on Windows?

Is there a way for me to figure this out?

You could try to debug it on a Windows machine?

hiweller commented 2 years ago

Thanks! Mine turned out to be a fairly niche issue: larger .Rmd vignette files and Dropbox syncing interference. I switched to my Windows partition and found that my vignettes would only knit about half the time, but not for any reason to do with the content. I would knit once and get an error, then immediately knit again and it would succeed. I think the same thing happened on win-builder when I tried vs. when you did?

On Windows, when I got errors, it was usually some version of:

Error in file(con,   "w") : cannot open connection
calls: <Anonymous> ... extract_preserve_chunks -> write_utf8 -> writeLines -> file

In file(con, "w") :
cannot open file '[vignette name].knit.md': Invalid argument

At first I thought this was some mysterious missing file, but after finding this post, I realized that because I had Dropbox syncing turned on, Dropbox was sometimes syncing the temporary files that are generated in going from .Rmd to html (such as .knit.md files), which would then cause issues with re-building the vignettes. Because it's hard to reliably reproduce the problem, I didn't track it down more than that. I paused Dropbox syncing while running checks and submitting to rhub/win-builder, and now I only get the "First submission" note.

TL;DR: turning off Dropbox syncing and/or making vignettes smaller turned out to be the solution for me.