Specify valgrind options to R package on Travis CI

Johan Larsson

I am trying to build an R package with c++ code on Travis CI and checking it with valgrind by running R CMD check with the --use-valgrind option. In the R extensions manual it says to either provide a ~/.valgrindrc file with the required options or set them in the environment variable VALGRIND_OPTS but I haven't been able to figure out either of these.

I have created a demo repo here that includes a Rcpp function which valgrind ought to respond to.

My .travis.yml setup looks like this:

language: r
sudo: false
cache: packages

r_check_args: '--use-valgrind'

addons:
  apt:
    packages:
      - valgrind

I have a .valgrindrc file with the following,

--leak-check=full
--track-origins=yes

, and have tried to put it in ./inst/ and the root directory but none of that has worked. Does anybody know how to set these options properly?

Edit: here is a link to the latest travis build.

joepd

According to the docs, the file ./.valgrindrc (so in the current working directory, is only read if the file ~/.valgrindrc does not exist, and the environment variable $VALGRIND_OPTS is not set.

Not sure what is the case, but you might want to do the following:

before_install:
  - "head ~/.valgrindrc || echo '~/.valgrindrc does not exist'"
  - echo VALGRIND_OPTS: $VALGRIND_OPTS
  - cat ./valgrindrc >> ~/.valgrindrc

The first two are there for diagnostic purposes. The last one might fix the issue (it appends your configuration to the global configuration). If it would not work, you will likely have some more insight in what is at play.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Travis CI R package error in documentation

travis-ci build for r package

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

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

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

How I can specify the version of JDK for travis CI

Can you specify minor jdk version for travis ci

Travis CI for R packages: no deploy key found

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

specify R package path (Android)

GitLab CI with r testthat package

Installation failed: Bad credentials (401) travis ci with R

Installing Android NDK r10d for Travis CI

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

How to use different R versions to test packages with Travis-CI?

Where can I find a list of 'os' and 'dist' options for Travis-CI / Multi OS Build Matrix

How to specify nodes' positions in visNetwork package in R

Build webpack on travis ci

Using Travis CI with Android

Update SQLite in travis CI

SShpass not allowed with Travis CI

Multiple Environments in Travis CI

Chromedriver crashes on Travis CI