Skip to content

[R-pkg-devel] CRAN Windows failure due to old pandoc ?

5 messages · Duncan Murdoch, Dirk Eddelbuettel

#
I had a submission fail and bomb with this error on Windows:

  Flavor: r-devel-windows-ix86+x86_64
  Check: re-building of vignette outputs, Result: WARNING
    Error(s) in re-building vignettes:
    --- re-building 'vignettefilename.Rmd' using rmarkdown
    pandoc.exe: unrecognized option `--lua-filter'
    unrecognized option `--lua-filter'
    unrecognized option `--lua-filter'
    Try pandoc.exe --help for more information.
    Error: processing vignette 'vignettefilename.Rmd' failed with diagnostics:
    pandoc document conversion failed with error 2
    --- failed re-building 'vignettefilename.Rmd'
    
    SUMMARY: processing the following file failed:
      'vignettefilename.Rmd'
    
    Error: Vignette re-building failed.
    Execution halted

This looks like a host configuration problem:

  edd at rob:~$ pandoc --help | grep lua
    -L SCRIPTPATH         --lua-filter=SCRIPTPATH                         
  edd at rob:~$ pandoc --version | head -1
  pandoc 2.9.2.1
  edd at rob:~$ 

Can we expect CRAN to update its pandoc binary? Or will we have to 'for now'
rely on 'reply-all', explaining to CRAN that the failure is from their end?

As they in the press, I had reached out to CRAN but they 'have not yet
responded to requests for comments' as we know they're busy. Anybody seen
this error though?

Dirk
#
On 26/09/2020 9:14 a.m., Dirk Eddelbuettel wrote:
I haven't seen that one, but I regularly get errors in rgl and tables 
because of missing or insufficient pandoc on some systems.  I added 
lines like

   SystemRequirements:  pandoc (>= 1.12.3) for vignettes

to DESCRIPTION to state the Pandoc version, added rmarkdown to the 
Suggests list, and added code like this to the start of HTML vignettes:

```{r echo = FALSE}
if (!requireNamespace("rmarkdown") || 
!rmarkdown::pandoc_available("1.12.3")) {
   warning("This vignette requires pandoc version 1.12.3; code will not 
run in older versions.")
   knitr::opts_chunk$set(eval = FALSE)
}
```

This makes the test happy, though it also makes the vignette pretty 
useless on systems that don't meet the stated requirements.  Since 
SystemRequirements is free-form, I can see why CRAN doesn't do automatic 
interpretation of it, but it would be nice if they did.

Duncan Murdoch
#
On 26 September 2020 at 11:50, Duncan Murdoch wrote:
| On 26/09/2020 9:14 a.m., Dirk Eddelbuettel wrote:
| > 
| > I had a submission fail and bomb with this error on Windows:
| > 
| >    Flavor: r-devel-windows-ix86+x86_64
| >    Check: re-building of vignette outputs, Result: WARNING
| >      Error(s) in re-building vignettes:
| >      --- re-building 'vignettefilename.Rmd' using rmarkdown
| >      pandoc.exe: unrecognized option `--lua-filter'
| >      unrecognized option `--lua-filter'
| >      unrecognized option `--lua-filter'
| >      Try pandoc.exe --help for more information.
| >      Error: processing vignette 'vignettefilename.Rmd' failed with diagnostics:
| >      pandoc document conversion failed with error 2
| >      --- failed re-building 'vignettefilename.Rmd'
| >      
| >      SUMMARY: processing the following file failed:
| >        'vignettefilename.Rmd'
| >      
| >      Error: Vignette re-building failed.
| >      Execution halted
| > 
| > This looks like a host configuration problem:
| > 
| >    edd at rob:~$ pandoc --help | grep lua
| >      -L SCRIPTPATH         --lua-filter=SCRIPTPATH
| >    edd at rob:~$ pandoc --version | head -1
| >    pandoc 2.9.2.1
| >    edd at rob:~$
| > 
| > Can we expect CRAN to update its pandoc binary? Or will we have to 'for now'
| > rely on 'reply-all', explaining to CRAN that the failure is from their end?
| > 
| > As they in the press, I had reached out to CRAN but they 'have not yet
| > responded to requests for comments' as we know they're busy. Anybody seen
| > this error though?
| 
| I haven't seen that one, but I regularly get errors in rgl and tables 
| because of missing or insufficient pandoc on some systems.  I added 
| lines like
| 
|    SystemRequirements:  pandoc (>= 1.12.3) for vignettes
| 
| to DESCRIPTION to state the Pandoc version, added rmarkdown to the 
| Suggests list, and added code like this to the start of HTML vignettes:
| 
| ```{r echo = FALSE}
| if (!requireNamespace("rmarkdown") || 
| !rmarkdown::pandoc_available("1.12.3")) {
|    warning("This vignette requires pandoc version 1.12.3; code will not 
| run in older versions.")
|    knitr::opts_chunk$set(eval = FALSE)
| }
| ```

Good point!  Brooke and I actually recommend exactly that---conditional
vignette builds---in our R Journal paper on drat for data repos (via Suggests).

But (because of the overall fragility of these pipelines as well as
preference for generally lighter setups) my vignettes actually tend to not
even run code.  I mostly just use three backticks followed by the language
for which I desire highlighting from pandoc, i.e. ```r or ```c++.

Maybe we would need to pass the minimum version check into rmarkdown as an
option so that rmarkdown knows not to ask for `--lua-filter` on setups where
rmarkdown knows pandoc is too old?  Or maybe make the vignette builder barf?
 
| This makes the test happy, though it also makes the vignette pretty 
| useless on systems that don't meet the stated requirements.  Since 
| SystemRequirements is free-form, I can see why CRAN doesn't do automatic 
| interpretation of it, but it would be nice if they did.

Alas, the free-form requirement has been a constraint for a long time indeed.

Dirk
#
On 26/09/2020 12:54 p.m., Dirk Eddelbuettel wrote:
Hmmm, that's strange.  From what I can see you only get the --lua-filter 
if pandoc 2.0 is available:

https://github.com/rstudio/rmarkdown/blob/66d27e09befd5f0579f0f4e27c4b9325284b9b15/R/pandoc.R#L719

I think this is the current rmarkdown version.

Duncan Murdoch
#
On 26 September 2020 at 14:20, Duncan Murdoch wrote:
| On 26/09/2020 12:54 p.m., Dirk Eddelbuettel wrote:
| Hmmm, that's strange.  From what I can see you only get the --lua-filter 
| if pandoc 2.0 is available:
| 
| https://github.com/rstudio/rmarkdown/blob/66d27e09befd5f0579f0f4e27c4b9325284b9b15/R/pandoc.R#L719
| 
| I think this is the current rmarkdown version.

I was using a different document driver which may not make that check.

In the meantime, I think I will just follow the usual advice 'stop doing that
then' after complaining that it hurts and may just switch to a pdf vignette.

Dirk

--
https://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org