I am trying to run Travis CI for one of my R packages. The problem is the build fails with an error stating that one dependency of the package is not available (the package named 'ridge')
Here the error log:
* checking extension type ... Package
* this is package ‘imputeR’ version ‘2.1’
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Package suggested but not available: ‘ridge’
The suggested packages are required for a complete check.
Checking can be attempted without them by setting the environment
variable _R_CHECK_FORCE_SUGGESTS_ to a false value.
See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’
manual.
* DONE
Status: 1 ERROR
See
‘/home/travis/build/SteffenMoritz/imputeR/imputeR.Rcheck/00check.log’
for details.
0.38schecking package dependencies ... ERROR
Package suggested but not available: ‘ridge’
Here is also the link to the Travis built:
https://travis-ci.org/SteffenMoritz/imputeR/builds/436334069
The package that is not available to Travis is a normal package that is currently on CRAN. Could this be related to Gnu Scientific Library version >= 1.14 being required for ridge..? Can I somehow solve this problem?
You are right by saying that it is because ridge requires an external library (Gnu Scientific Library) that is not installed by default on travis.
Travis CI docs explain in detail how you can install external packages.
In your case, you need to add
addons:
apt:
packages: libgsl0-dev
to your .travis.yml
Found a solution that let's at least TRAVIS complete the check
You can add this to the Travis configuration yaml file:
env:
global:
- _R_CHECK_FORCE_SUGGESTS_: false
Downside as far as I understand is: everything which includes suggested packages is not checked at all. So the solution is not completely satisfying.
Related
I've recently started encountering the same errors on my various R packages updated after mid-December on Travis-CI (https://travis-ci.org/TGuillerme/). This is specially weird since for the three concerned packages, the changes were not any code change (only comments changes) but Travis-CI seems now not able to install some packages (namely magick and libgit2) using a pretty simple .yml file runing the package and codecov for coverage:
language: r
warnings_are_errors: false
branches:
only:
- master
- release
except:
- CRAN
# Code coverage
r_packages:
- covr
after_success:
- Rscript -e 'library(covr); codecov(token = "5f041826-63f1-47fa-b4a8-9a32633f47fa")'
The error I get in this case (although it varies with the different packages) is with the magick package:
** package ‘magick’ successfully unpacked and MD5 sums checked
Package Magick++ was not found in the pkg-config search path.
Perhaps you should add the directory containing `Magick++.pc'
to the PKG_CONFIG_PATH environment variable
No package 'Magick++' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lMagick++-6.Q16
line 2625-2631
Along with one suspicious message prior to this:
Unable to find the libgit2 library on this system. Building 'git2r'
using the bundled source of the libgit2 library.
line 1563-1564
Is there something obvious that I am missing? Is there a way to force Travis-CI to automatically install the the errored packages?
Again, this is specially weird to me since the running code changes committed do not differ since last build running without errors.
I have been able to fix similar issues by installing packages from their binaries.
The following might help in the .travis.yml:
r_binary_packages:
- libgit2
- magick
I am trying to build my first R package (GitHub link). It is currently passing all local checks with devtools::check(), but failing on Travis:
ERROR: dependency ‘Rmpfr’ is not available for package ‘streamDepletr’
Looking at the Installed package versions section of the travis-ci output, Rmpfr is not listed. However, my DESCRIPTION file includes it as an import:
Imports:
Rmpfr,
dplyr,
magrittr
and Rmpfr is available on CRAN; my question is, how do I get travis-ci to install it?
The solution may be related to this previous question where the author had to include Java in their .travis.yml file. For Rmpfr, it looks like the MPFR C library is necessary. Is there a way to instruct travis to install this library in my .travis.yml file? Or am I barking up the wrong tree?
As you found out, you need the libmpfr-dev package to be installed. You can do this by adding
addons:
apt:
packages:
- libmpfr-dev
to your .travis.yml. See the documentation for reference.
I am trying to use Travis CI with an R package (specifically this in-development package here).
When I update a repository, I get the following message (see the logs here):
Error: processing vignette 'comparing-mclust-and-mplus-output.Rmd' failed with diagnostics:
'roxygen2' >= 5.0.0 must be installed for this functionality.
Execution halted
This is consistent across two different packages--although the version of roxygen2 that I have is 6.0.1. I haven't been able to find others with this particular issue on either Stack Overflow or the roxygen2 GitHub page. I used usethis::use_travis() to set up the package for use with Travis (i.e., add travis.yml file.
Any ideas about how to address this?
So I believe the problem you have is with your DESCRIPTION file. Travis will install all package dependencies before trying to build the package / vignettes, so the version you have installed locally is of no consequence.
Rather, you need to be sure that roxygen2 is a dependency of your package (probably only needed in Suggests if it is necessary to build but not use your package). So adding:
Suggests:
roxygen2
To your DESCRIPTION file should fix the issue!
I've been using travis-ci successfully so far but I'm having trouble when using travis-ci with R 3.4.0 at the vignette building step with the following error in the "building package" section:
* installing the package to build vignettes
* creating vignettes ... ERROR
Error in loadVignetteBuilder(vigns$pkgdir) :
vignette builder 'knitr' not found
Calls: <Anonymous> -> loadVignetteBuilder
Execution halted
When I run R-CMD-check locally it passes and I don't get any errors
Here's the current .travis.yml
language: R
sudo: false
install:
- R -e "0" --args --bootstrap-packrat
cache:
directories:
- $TRAVIS_BUILD_DIR/packrat/src
- $TRAVIS_BUILD_DIR/packrat/lib
packages: true
r_packages:
- covr
after_success:
- Rscript -e 'library(covr); codecov()'
DESCRIPTION has the vignette line in it:
VignetteBuilder: knitr
knitr is also in my packrat.lock file and packrat is used for the build in .travis.yml.
I've tried the following to no avail:
added knitr to the r_packages in .travis.yml
added knitr to the Imports in DESCRIPTION
added r_check_args: "--no-vignettes" to travis.yml in the hopes of skipping the vignette building step.
added packrat call in travis.yml from install to before_install
I'm pretty knew to building R packages, never mind travis-ci so I'm not sure if I understand why the vignette builder would not have access to the knitr package.
Repo: https://github.com/cormac85/datakindr
Travis: https://travis-ci.org/cormac85/datakindr
One potential problem involves the 'Imports' and/or 'Suggests' sections in your description file.
dplyr needs to be in your suggests, if not imports.
See Hadley's 2015 O'Reilly book, R Packages:
Common problems:
The vignette builds interactively, but when checking, it fails with an error about a missing package that you know is installed. This means that you’ve forgotten to declare that dependency in the DESCRIPTION (usually it should go in Suggests).
So in the end I got the build to pass by just removing packrat config from .travis.yml and replacing it with the normal package building config: cache: packages.
The packrat config I used was suggested in the Travis R Documentation and worked well for the rest of the items in the package but it did not work for the loadVignetteBuilder() step during the build.
The package causing the problem is apparently numbers. My best guess as to why is because numbers was built under an older version of R (as is indicated by the warning message I get when I library(numbers) in R).
But I'm pretty new to Travis CI and R packages in general, so I could be missing something.
The Travis CI log is here
I'm confused not only because the R pacakge numbers is available to me (OSX), but also because my package passes the devtools::check(). My package passed on Travis previously (when it only depended on ssh.utils), so I'm pretty sure the problem is somehow related to numbers.
Is this Travis error message related to the way I've asked Travis to install a package? Is there a setting I can change in my Travis yml to allow the build to pass? Any help would be appreciated.
From your logs, the package gmp install is failing, as Travis systems don't have gmp installed:
* installing *source* package ‘gmp’ ...
** package ‘gmp’ successfully unpacked and MD5 sums checked
creating cache ./config.cache
checking for __gmpz_ui_sub in -lgmp... no
configure: error: GNU MP not found, or not 4.1.4 or up, see http://gmplib.org
ERROR: configuration failed for package ‘gmp’
* removing ‘/usr/local/lib/R/site-library/gmp’
See this answer here for how to install it, you can probably add the code:
sudo apt-get install libgmp3-dev
to your Travis config file (not tested).