MichaelChirico / r-bugs

A ⚠️read-only⚠️mirror of https://bugs.r-project.org/
20 stars 0 forks source link

[BUGZILLA #17416] R CMD build doesn't handle non-Sweave vignettes properly #6590

Open MichaelChirico opened 4 years ago

MichaelChirico commented 4 years ago

Some vignettes can be split across multiple files. For example, in this question https://stackoverflow.com/questions/50078849/package-build-fails-because-vignette-does-not-find-child-rmd-files an R Markdown vignette tries to include a child file. Current R-devel and release versions fail to build packages with these vignettes, because they split up the files into separate directories before calling pkgVignettes, and it fails.

Sweave also supports multiple file inputs; I don't know if they will show this problem.

It's not clear to me how this should be fixed. It's not sufficient for build to copy the extra files into the doc directory: that fixes the build, but then check complains because they look like vignettes but aren't vignettes.


METADATA

MichaelChirico commented 4 years ago

Created attachment 2342 [details] Patch to R-devel


METADATA

INCLUDED PATCH

MichaelChirico commented 4 years ago

The patch I just uploaded should fix both problems, though it needs a little thinking.

It copies the .install_extras to the doc directory, so people with child documents can include them there and the build will work.

The patch to src/library/tools/R/Vignettes.R also removes the NOTE that is generated when check sees the child document that is named like a vignette but has no vignette engine. This is the part that needs some thought: the note is a false positive in the case of a multi-file vignette, but would be valid if a package writer forgot to include the \VignetteEngine markup in the main file of their vignette. So it needs some judgement about whether the NOTE should be included and sometimes ignored or never included.


METADATA

MichaelChirico commented 4 years ago

Created attachment 2343 [details] Patch to R-devel

This is a revision to the previous patch to deal with the R CMD check issue. If a file whose name looks like a vignette source file contains %\VignetteEngine{none}, it will not be treated as a vignette source by R CMD check or build. This way authors who forget the %\VignetteEngine entry will still get the NOTE, but others have a way to suppress it.


METADATA

INCLUDED PATCH