Travis CI R package error in documentation

coatless

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:

  1. Have roxygen2 help documentation that is coded with the @keyword internal.
  2. Are written using Rcpp / RcppArmadillo.

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.

jtilly

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:

  1. Remove 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.
  2. Add a line to your travis.yml to run Rcpp::compileAttributes before building the package, e.g. Rscript -e "Rcpp::compileAttributes()".

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

R package dependency error on travis-ci but not local machine

Specify valgrind options to R package on Travis CI

travis-ci build for r package

Error using Travis CI with R package: 'roxygen2' >= 5.0.0 must be installed for this functionality

Travis CI build error with my R package that uses C++, Rcpp and RcppArmadillo

Auto-build an Mkdocs documentation in Travis CI

Travis-CI error: installing nloptr pkg (r pkg check)

Travis CI error importing module

Error with integration in Travis-CI

"failed to find package directory" error on Travis-CI while computing code coverage

Install package on Travis-ci with sudo:false

Using R package source files in packrat (rather than CRAN) with Travis-CI

Installing specific R package from specific branch from github repo on travis-ci

Travis-CI does not publish doxygen file-level documentation

Travis CI Spring Boot Error (Gradle Error)

Travis error: package is not in the npm registry

R object documentation: Package documentation as first item

Key - Error when running in Travis CI| Pytest

Error authenticating Github using Travis CI

Travis-CI GoLang Examples test error

Travis-CI with: ERROR: Cannot find schemes

Travis CI for R packages: no deploy key found

c++ documentation in an R package

short url in R package documentation

Data package-r documentation

How to make Travis CI test package for Linux, OS X, Windows?

Travis CI: "Unable to locate package python-opencv" Python 2.7

Travis CI - Swift Package Manage - checkout already exists?

Issue with Travis-ci, unable to fetch dependencies Swift Package Manager