krlmlr / r-appveyor

Tools for using R with AppVeyor (https://appveyor.com)
132 stars 60 forks source link

Build fails when Rtools is not needed (no /src dir), but source packages will be downloaded #133

Closed msberends closed 5 years ago

msberends commented 5 years ago

I think this line troubles my run: https://github.com/krlmlr/r-appveyor/blob/545199b4e630febe6af795621cb4de32a33851d4/r-travis/scripts/travis-tool.sh#L11

It defines that both binaries and sources package may be downloaded from https://cran.rstudio.com. But I don't have a src directory, so Rtools won't be installed (see first couple of lines below). This makes installation of the current markdown package fail, since it tries to install the source version of v0.9:

[1] compiler_3.5.1
== 12/07/2018 12:51:32: Skipping download of Rtools because src/ directory is missing.
== 12/07/2018 12:51:32: Downloading and installing travis-tool.sh

# (...)

+ Rscript -e 'options(repos=c(CRAN="https://cran.rstudio.com")); remotes::install_deps(dependencies = TRUE, type="both")'

# (...)

  There is a binary version available but the source version is later:
         binary source needs_compilation
markdown    0.8    0.9              TRUE
installing the source package 'markdown'
trying URL 'https://cran.rstudio.com/src/contrib/markdown_0.9.tar.gz'

# (...)

/bin/sh: c:/Rtools/mingw_32/bin/gcc: No such file or directory
ERROR: compilation failed for package 'markdown'

And so all my builds fail, until there's a binary available for Windows at https://cran.r-project.org/package=markdown.

msberends commented 5 years ago

'Fixed' it for now by adding PKGTYPE = win.binary to my appveyor.yml. But that shouldn't be necessary.

Rtools install should be skipped when there's no src dir AND PKGTYPE is not set to source or both.

krlmlr commented 5 years ago

Thanks. Perhaps the default for PKGTYPE should be win.binary ? This will be disruptive to power users, but easy enough to detect and override.

msberends commented 5 years ago

That’s the most pragmatic solution I guess :smile:

msberends commented 5 years ago

Closed in #132. Thanks!