Reputation: 20746
Greetings and Salutations,
I recently hooked up a github repo containing an R package to Travis CI. I thought the repository would be built fine, however, there are several check errors that arise which I cannot replicate on local installs of Windows, OS X, or Ubuntu 14.04 LTS.
The errors are originating off of functions that share the following in common:
Specifically, I receive the following warning from Travis CI:
Functions or methods with usage in documentation object 'internal function here' but not in code:
This is not particularly problematic as it is a warning. A previous post addressed a different form of this example using @method and @export. However, the Rcpp functions are not of an OO class (S3/S4/RR).
However, when Travis CI starts to evaluate the package's examples, this warning then becomes an error:
Error: could not find function "internal function here"
and causes the build to fail. Though, the build itself should pass the check since the function does exist.
Travis CI is configured using the recommended guidelines in the following manner:
language: r
sudo: required
warnings_are_errors: true
r_packages:
- ggplot2
- devtools
- RcppArmadillo
- knitr
- gridExtra
- grid
r_build_args: "--no-build-vignettes"
r_check_args: "--no-build-vignettes --as-cran"
Note The --no-build-vignettes was added since Travis would error upon building them since the R code calls one of the internal functions listed in the docs.
Here is I believe the latest public facing build: Travis CI report (v1.0.1)
And the results from the first version on CRAN: CRAN report (v1.0.0)
Any thoughts would be welcome.
Upvotes: 4
Views: 638
Reputation: 493
I can replicate the warnings/errors on my laptop (running OS X). I'm also pretty sure that if you check out your repository, build the tar ball and then run R CMD check on it, you will get the same warnings/errors as on Travis CI. (I'm assuming you only checked your package from within R Studio.)
As far as I can tell, the problem is that you added R/RcppExports.R
and src/RcppExports.cpp
to your .gitignore
, which means these files are not on GitHub. Travis CI does not run Rcpp::compileAttributes
for you.
There are two simple solutions:
R/RcppExports.R
and src/RcppExports.cpp
from .gitignore and commit them to GitHub with everything else. That sort of makes sense, because those files are in fact part of your package and you should not necessarily expect an end-user to compile them before installing your package. I think this is the proper way to deal with this.Rscript -e "Rcpp::compileAttributes()"
. Upvotes: 5