craigcitro / r-travis

Tools for using R with Travis (http://travis-ci.org) in lieu of a website:

Home Page:https://github.com/craigcitro/r-travis/wiki

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple R build failure on travis

jackolney opened this issue · comments

I'm just trying to get an instance of R up and running on travis to compile some C++ code.

As a test case, I was just trying to setup the .travis.yml file and check some gcc flags.

language: r
warnings_are_errors: true
sudo: required
notifications:
  email:
    on_success: change
    on_failure: always
before_script:
  - R CMD config CXX

However, as soon as I push to github, travis begins to install R, but then fails with the error message:

The command "Rscript -e 'options(repos = "http://cran.rstudio.com"); tryCatch({   deps <- devtools::install_deps(dependencies = TRUE) }, 
error = function(e) {   message(e);   q(status=1) }); if (!all(deps %in% installed.packages())) {  message("missing: ", paste(setdiff(deps, installed.packages()), 
collapse=", "));  q(status = 1, save = "no") }'" failed and exited with 1 during .

The whole log is available here: https://travis-ci.org/jackolney/r-build-test/builds/97946329

Does anyone have any ideas why such a simple build is failing? Or am I perhaps missing something very obvious here.

Thanks in advance,
Jack

hi @jackolney -- I think it's just failing because there's no R package in the repository.

the error message could be better here -- we should detect that there's no package and say "no package, don't know what to do" ...

Thanks @craigcitro -- what I really want to be doing is calling R CMD SHLIB on to compile a whole bunch of C++ files, so was just using this as a test.

I'm guessing then, that if I set language: r in the .yml file, that I need to supply it a package in the repo. Therefore, maybe its just easier to avoid setting R as the language and just install it an alternate way?

hey jack -- yeah, if you're just looking to test some files, i'd recommend using language: c and the files in this repo directly. this is probably the closest sample, though you can of course search around on github for more.

Thanks @craigcitro, really appreciate the help and the example. I have it all working now, but have decided to put the code into a package as to hopefully avoid any platform dependency issues. Thanks again.