r-lib / pkgbuild

Find tools needed to build R packages
https://pkgbuild.r-lib.org
Other
66 stars 35 forks source link

`pkgbuild::build(..., args=c())` failing #159

Closed alexWhitworth closed 1 year ago

alexWhitworth commented 1 year ago

When building my package via pkgbuild::build instead of command line R CMD BUILD I am generating new errors.

To Reproduce

$> R
R> devtools::check_built("./imputeMulti_0.8.4.tar.gz")  # result = "Status: OK"
R> pkgbuild::build("./imputeMulti", vignettes=TRUE, args= c("--compact-vignettes='gs+qpdf'"))
R> devtools::check_built("./imputeMulti_0.8.4.tar.gz") # result = "0 errors ✔ | 1 warning ✖ | 0 notes ✔"

checking sizes of PDF files under ‘inst/doc’ ... WARNING ‘gs+qpdf’ made some significant size reductions: compacted ‘imputeMulti.pdf’ from 492Kb to 127Kb consider running tools::compactPDF(gs_quality = "ebook") on these files

gaborcsardi commented 1 year ago

This does not have much to do with pkgbuild. devtools::check_built() uses different flags than plain R CMD check, in particular, it adds --as-cran by default.

EDIT: oh, wait, I missed that you also ran devtools::check_built() on the R CMD build output.

OTOH I see:

   Warning in tools:::.build_packages() :
     invalid value for '--compact-vignettes', assuming "qpdf"

which is because devtools::check_built() does not use a shell, so you should pass the build arguments without quoting:

pkgbuild::build("./imputeMulti", vignettes=TRUE, args= c("--compact-vignettes=gs+qpdf"))
alexWhitworth commented 1 year ago

@gaborcsardi running R CMD CHECK ... --as-cran does not reproduce the warning from pkgbuild... This does indeed have to do with pkgbuild.

Edit. Ah, thanks for the syntax correction. This does indeed resolve the issue locally. I'm still getting the warning with submission to CRAN. But perhaps that's a separate issue.