Building R packages with Packrat and AppVeyor

wibeasley

Can someone point me towards a working example where packrat is used with AppVeyor to build an R package? Searching through Google and GitHub, I can't find any packrat-enable package that uses AppVeyor.

Does the appveyor.yml file need to change? Are there some settings I need to add through the AppVeyor website?

I have a very minimal package (testthat is the only dependency) that broke AppVeyor builds. Here is the code frozen for that commit. Here is the AppVeyor log.

(If this SO question sounds familiar, I'm about to ask a similar question for Travis-CI.)

Ben

Yes, the solution here is similar to the same question for Travis-CI.

Here's an example of an appveyor.yml file that will enable you to use packrat packages in your package:

# DO NOT CHANGE the "init" and "install" sections below

# Download script file from GitHub
init:
  ps: |
        $ErrorActionPreference = "Stop"
        Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1"
        Import-Module '..\appveyor-tool.ps1'
install:
  ps: Bootstrap

# Adapt as necessary starting from here

environment:
  global:
   WARNINGS_ARE_ERRORS: 0
   USE_RTOOLS: true

build_script:
  - R -e  "0" --args --bootstrap-packrat

test_script:
  - travis-tool.sh run_tests

on_failure:
  - 7z a failure.zip *.Rcheck\*
  - appveyor PushArtifact failure.zip

artifacts:
  - path: '*.Rcheck\**\*.log'
    name: Logs

  - path: '*.Rcheck\**\*.out'
    name: Logs

  - path: '*.Rcheck\**\*.fail'
    name: Logs

  - path: '*.Rcheck\**\*.Rout'
    name: Logs

  - path: '\*_*.tar.gz'
    name: Bits

  - path: '\*_*.zip'
    name: Bits

The important parts that differ from the template are:

 environment:
      global:
       WARNINGS_ARE_ERRORS: 0
       USE_RTOOLS: true

    build_script:
      - R -e  "0" --args --bootstrap-packrat

This enables Rtools for the build, and loads the packrat packages.

It's also important to note that we are excluding - travis-tool.sh install_deps because that would cause the packages you depend on to be downloaded from CRAN, rather than built from your packrat directory.

Here's an example of an appveyor build for a simple R package where this is working: https://ci.appveyor.com/project/benmarwick/javaonappveyortest/build/1.0.21

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Using R with git and packrat

From Dev

R: Packrat will not completely uninstall

From Dev

R: Packrat will not completely uninstall

From Dev

AppVeyor error while building csproj

From Dev

Building R packages (C API) with Visual Studio

From Dev

Errors building R-packages for conda

From Dev

Trouble with packrat corrupting R functioning

From Dev

How to publish beta nuget packages out of AppVeyor

From Dev

building R packages--Error : example requires a value

From Dev

### ** Examples ... Error: could not find function building packages in R

From Dev

How do we set constant variables while building R packages?

From Dev

building R packages--Error : example requires a value

From Dev

R Packrat Fails to load private library

From Dev

R Packrat Fails to load private library

From Dev

Can AppVeyor do auto publishing of nuget packages only for specific branch?

From Dev

Building Python Extension Packages for Launchpad

From Dev

No speex packages for freeswitch building on Ubuntu

From Dev

Building packages from launchpad respository

From Dev

How to disable implicit building in packages? {$IMPLICITBUILD}

From Dev

Building packages with conda and python3k

From Dev

Building packages with Rcpp, Attributes not handled correctly

From Dev

Building Python packages succeeds, but package is improperly built

From Dev

Building multiple packages for deployment on different Ubuntu versions

From Dev

Building packages from source on Arch linux

From Dev

Building grpc from source using preinstalled packages

From Dev

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

From Dev

Building curved objects in R

From Dev

recursive function building in R

From Dev

Building network in R

Related Related

  1. 1

    Using R with git and packrat

  2. 2

    R: Packrat will not completely uninstall

  3. 3

    R: Packrat will not completely uninstall

  4. 4

    AppVeyor error while building csproj

  5. 5

    Building R packages (C API) with Visual Studio

  6. 6

    Errors building R-packages for conda

  7. 7

    Trouble with packrat corrupting R functioning

  8. 8

    How to publish beta nuget packages out of AppVeyor

  9. 9

    building R packages--Error : example requires a value

  10. 10

    ### ** Examples ... Error: could not find function building packages in R

  11. 11

    How do we set constant variables while building R packages?

  12. 12

    building R packages--Error : example requires a value

  13. 13

    R Packrat Fails to load private library

  14. 14

    R Packrat Fails to load private library

  15. 15

    Can AppVeyor do auto publishing of nuget packages only for specific branch?

  16. 16

    Building Python Extension Packages for Launchpad

  17. 17

    No speex packages for freeswitch building on Ubuntu

  18. 18

    Building packages from launchpad respository

  19. 19

    How to disable implicit building in packages? {$IMPLICITBUILD}

  20. 20

    Building packages with conda and python3k

  21. 21

    Building packages with Rcpp, Attributes not handled correctly

  22. 22

    Building Python packages succeeds, but package is improperly built

  23. 23

    Building multiple packages for deployment on different Ubuntu versions

  24. 24

    Building packages from source on Arch linux

  25. 25

    Building grpc from source using preinstalled packages

  26. 26

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

  27. 27

    Building curved objects in R

  28. 28

    recursive function building in R

  29. 29

    Building network in R

HotTag

Archive