r-hub / rhub

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

rhub_check() fails in processing a vignette. #629

Closed rolfTurner closed 2 months ago

rolfTurner commented 2 months ago

I need to to build a Windoze binary of a package that I am developing. I tried to do this using rhub v2. First, I created a github repository for the package, explicitly https://github.com/rolfTurner/kanova. Then I went to the local (cloned) directory for the package, started R, and executed

library(rhub) rhub_check(platforms="windows")

After some time, failure was reported. The problem seems to be with the vignette. I pre-compiled the vignette, doing

pdflatex testStat.ltx

in the vignettes directory. This creates a file testStat.pdf in that directory. In "ordinary circumstances" (doing a local build), the build uses this pre-compiled file (i.e. testStat.pdf).

However when I use rhub_check(), the system seems not to use testStat.pdf, tries to re-compile testStat.ltx and complains that pdflatex is not available. See the screenshot:

Screenshot 2024-08-02 at 11-20-32 incredulous-allosaurus windows · rolfTurner_kanova@1444609

Is there any way to either:

(a) get rhub_check() to use the pre-compiled file testStat.pdf, or (b) make pdflatex available to rhub_check() ?

Thanks for any ideas.

gaborcsardi commented 2 months ago

I am not sure how the prebuilt vignette is supposed to work, but this certainly needs latex for me when I run R CMD build:

❯ R CMD build kanova
* checking for file ‘kanova/DESCRIPTION’ ... OK
* preparing ‘kanova’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... ERROR
--- re-building ‘testStat.ltx’ using tex
Error: processing vignette 'testStat.ltx' failed with diagnostics:
Running 'texi2dvi' on 'testStat.ltx' failed.
LaTeX errors:
! LaTeX Error: File `isodate.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

! Emergency stop.
<read *>

l.11 \usepackage
                [round]{natbib}^^M
!  ==> Fatal error occurred, no output PDF file produced!
--- failed re-building ‘testStat.ltx’

SUMMARY: processing the following file failed:
  ‘testStat.ltx’

Error: Vignette re-building failed.
Execution halted
rolfTurner commented 2 months ago

There is some difference, somewhere, between your system and mine. Building locally, I get

R CMD build  kanova  
* checking for file ‘kanova/DESCRIPTION’ ... OK
* preparing ‘kanova’:
* checking DESCRIPTION meta-information ... OK
* installing the package to build vignettes
* creating vignettes ... OK
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* re-saving image files
* building ‘kanova_0.1-7.tar.gz’

No complaints, no problem. And the tarball can be installed, again without problem.

gaborcsardi commented 2 months ago

Because you have a complete LaTeX installation, and I don't. That's my point. R CMD build is still building the vignette, it is not using the pre-built vignette. Not just on R-hub, but on my machine as well and I would guess everywhere. So this is not an issue with R-hub.

rolfTurner commented 2 months ago

Well, I'll have to find another approach. :-(

gaborcsardi commented 2 months ago

Literally all I did was adding back the deleted workflow file, and apart from some minor check issues, it is working fine: https://github.com/gaborcsardi/kanova/actions/runs/10226059265