1

I'd like to use the checkpoint package or the MRAN snapshot repo to set the versions of packages that get used when my package is built on Travis-CI.

I'm looking for advice on getting either of these working:

  1. Travis using the local files (i.e. stored in the github repo of my pkg) of the packages that my package depends on. For example, if I use checkpoint to download the sources of the packages and store them in a directory with my package, how can I get Travis to install the packages from that local location, rather than from CRAN? or,

  2. Travis use the MRAN snapshot URL to download the packages archived on a specific date, as set in the URL.

I've been experimenting with various options in the .travis.yml file in this test package: https://github.com/benmarwick/checkpointtest

For example, here are .travis.yml files that I've tried:

# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages
warnings_are_errors: false

cran: https://mran.revolutionanalytics.com/

and

# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages
warnings_are_errors: false

repos:
  CRAN: https://mran.revolutionanalytics.com/snapshot/2016-09-02

and

# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false
cache: packages
cran: https://mran.revolutionanalytics.com/snapshot/2016-09-02
env:
  global:
  - R_LIBS_USER=~/vignettes/packages/.checkpoint/2016-09-02/lib/x86_64-w64-mingw32/3.3.1
  - R_LIBS_SITE=~/vignettes/packages/.checkpoint/2016-09-02/lib/x86_64-w64-mingw32/3.3.1

And several other combinations.

So far everything has resulted in an error (https://travis-ci.org/benmarwick/checkpointtest), often this is the error message:

W: Failed to fetch https://mran.revolutionanalytics.com//bin/linux/ubuntu/precise/Packages server certificate verification failed.
 CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

How can I get Travis-CI to be aware of the checkpoint package, and not contact CRAN to download dependencies?

This question is related to my packrat question about getting Travis to use non-CRAN package sources.

Community
  • 1
  • 1
Ben
  • 41,615
  • 18
  • 132
  • 227
  • 1
    Likely not the answer you want to hear, but in the 'maintained version' of the old Travis that I use (and maintain) I think I would have appropriate control levels to do this (and do related things to add PPAs for more prebuilt .deb packages). Then again, I also don't use MRAN so I can't be sure. Ultimately, we're all still mad at Travis for not letting us bring our own Docker containers. Seemingly Gitlab does ... – Dirk Eddelbuettel Sep 04 '16 at 00:43
  • ok, thanks for the pointers. I'll take a look at the old travis config files for R – Ben Sep 05 '16 at 04:06
  • I suspect your last attempt to set the R_LIBS_* using env vars is most promising. However, I can tell from the path you are using that your local build is Windows (x86_64-w64-mingw32) so you are uploading windows packages to Travis, but Travis runs Linux (AFAIK). For this to work, your local dev environment should match the Travis environment. – Andrie Sep 07 '16 at 08:51
  • Also, I think a more promising avenue would be to use `miniCRAN` instead of checkpoint. Then set your CRAN to the `miniCRAN` folder. With miniCRAN you have more control over the packages to install, i.e. you can specify the type and R version. – Andrie Sep 07 '16 at 08:52
  • Thanks, I imagine there must be a way to get Travis to contact the MRAN repo to get the packages when building my package (in the case that I don't want to include the packages in my repo). I'll have another look at miniCRAN, that's been very useful for me in other situations! – Ben Sep 08 '16 at 23:21

1 Answers1

1

This appears to work:

# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r

language: R
sudo: false

cache:
  packages: true

repos:
  MRAN: "https://mran.microsoft.com/snapshot/2016-11-08"

warnings_are_errors: false
Ben
  • 41,615
  • 18
  • 132
  • 227