Search code examples
rr-packageappveyorstringi

Appveyor problem - R package stringi can't be installed


Lately the build with Appveyor does not work any more. It fails before actually building the program, because somehow the package stringi can't be installed.

Locally everything works fine, but I need a workaround for Appveyor. Has anybody a solution on how to fix this?

This is the error message on Appveyor:

  • installing source package 'stringi' ... ** package 'stringi' successfully unpacked and MD5 sums checked ** libs * arch - i386 c:/Rtools/mingw_32/bin/g++ -std=gnu++11 -I"c:/R/include" -DNDEBUG -I. -Iicu61/ -Iicu61/unicode -Iicu61/common -Iicu61/i18n -DU_STATIC_IMPLEMENTATION -DU_COMMON_IMPLEMENTATION -DU_I18N_IMPLEMENTATION -DUCONFIG_USE_LOCAL -DU_TOOLUTIL_IMPLEMENTATION -DNDEBUG -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DU_USE_STRTOD_L=0 -O2 -Wall -mtune=generic -c stri_ICU_settings.cpp -o stri_ICU_settings.o /bin/sh: c:/Rtools/mingw_32/bin/g++: No such file or directory make: * [stri_ICU_settings.o] Error 127 ERROR: compilation failed for package 'stringi'
  • removing 'c:/RLibrary/stringi' In R CMD INSTALL Error in i.p(...) : (converted from warning) installation of package 'stringi' had non-zero exit status Calls: ... with_rprofile_user -> with_envvar -> force -> force -> i.p Execution halted Command exited with code 1

See also: https://ci.appveyor.com/project/frehbach/eventdetectr/builds/19569698


Solution

  • You can fix this by adding

    USE_RTOOLS: true
    

    to your appveyor.yml (see here).

    The issue is that since you don't have any code that needs compiling, AppVeyor doesn't install Rtools, but compiling stringi obviously requires Rtools; see line 40 of the build log you linked to:

    == 10/17/2018 06:33:11: Skipping download of Rtools because src/ directory is missing.
    

    Using the AppVeyor setting mentioned above will force the installation of Rtools anyway.