krlmlr / r-appveyor

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

appveyor failed for devel R4.0.0 with package remotes fail #176

Closed Fredo-XVII closed 4 years ago

Fredo-XVII commented 4 years ago

Hello,

I have tried just about every iteration of choices on the appveyor.yml to try to fix the error below. Any help would be grateful. Appveyor does pass for the current version of R, just not the devel. Travis is also building.

Thank you

My Repo: https://github.com/Fredo-XVII/R.COVID.19

Error:

+ COMMAND=install_deps
+ echo 'Running command: install_deps'
Running command: install_deps
+ shift
+ case $COMMAND in
+ InstallDeps
+ EnsureRemotes
+ Rscript -e 'if (!("remotes" %in% rownames(installed.packages()))) q(status=1)'
+ Rscript -e 'if (!("remotes" %in% rownames(installed.packages()))) q(status=1)'
+ echo 'Installing dependencies'
Installing dependencies
+ Rscript -e 'options(repos = c(CRAN = "https://cloud.r-project.org"), download.file.method = "auto"); remotes::install_deps(dependencies = TRUE, type="both")'
Error: package 'remotes' was installed before R 4.0.0: please re-install it
Execution halted
Command exited with code 1
7z a failure.zip *.Rcheck\*
7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

My Appveyor.yml file:

# 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

cache:
  - C:\RLibrary

#platform: x64

environment:
  #R_ARCH: x64
  NOT_CRAN: true
  # env vars that may need to be set, at least temporarily, from time to time
  # see https://github.com/krlmlr/r-appveyor#readme for details
  #USE_RTOOLS: true
  #R_REMOTES_STANDALONE: true
  R_VERSION: devel
  PKGTYPE: both
  #R_REMOTES_NO_ERRORS_FROM_WARNINGS: true

# Adapt as necessary starting from here

build_script:
  - travis-tool.sh install_deps

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

# My Adds
krlmlr commented 4 years ago

Can you please remove the cache entry in appveyor.yml ? Installation from binary works better without cache.

Fredo-XVII commented 4 years ago

Just fyi, this is my first appeyvor build.

I removed cache and change pkg to binary, got this error:

+ R_CHECK_INSTALL_ARGS=--install-args=--build
+ echo 'Testing with: R CMD check "R.COVID.19_0.0.1.0.tar.gz" --no-manual --as-cran --install-args=--build'
Testing with: R CMD check "R.COVID.19_0.0.1.0.tar.gz" --no-manual --as-cran --install-args=--build
+ _R_CHECK_CRAN_INCOMING_=FALSE
+ [[ FALSE == \F\A\L\S\E ]]
+ echo '(CRAN incoming checks are off)'
(CRAN incoming checks are off)
+ _R_CHECK_CRAN_INCOMING_=FALSE
+ R_QPDF=true
+ R CMD check R.COVID.19_0.0.1.0.tar.gz --no-manual --as-cran --install-args=--build
* using log directory 'C:/projects/r-covid-19/R.COVID.19.Rcheck'
* using R Under development (unstable) (2020-03-29 r78108)
* using platform: x86_64-w64-mingw32 (64-bit)
* using session charset: ISO8859-1
* using options '--no-manual --as-cran'
* checking for file 'R.COVID.19/DESCRIPTION' ... OK
* this is package 'R.COVID.19' version '0.0.1.0'
* package encoding: UTF-8
* checking package namespace information ... OK
* checking package dependencies ... ERROR
Packages required but not available:
  'magrittr', 'readr', 'dplyr', 'rlang', 'tidyr'
Packages suggested but not available: 'roxygen2', 'kableExtra', 'covr'
The suggested packages are required for a complete check.
Checking can be attempted without them by setting the environment
variable _R_CHECK_FORCE_SUGGESTS_ to a false value.
See section 'The DESCRIPTION file' in the 'Writing R Extensions'
manual.
* DONE
Status: 1 ERROR
See
  'C:/projects/r-covid-19/R.COVID.19.Rcheck/00check.log'
for details.
Command exited with code 1
7z a failure.zip *.Rcheck\*
krlmlr commented 4 years ago

Weird. Does it work with R-release?

Fredo-XVII commented 4 years ago

If R-release means the current R version, then yes. I didn't make modifications to the appveyor.yml file until I tried to test devel.

I confirmed this morning that release does pass, as I had experienced before.

Fredo-XVII commented 4 years ago

What I don't understand is why it says that remotes was installed before R 4.0.0. How can that be? Wouldn't you need to have R installed to install any packages?

gaborcsardi commented 4 years ago

That means that the binary package was built (=installed) on a different R version. This is either coming from the cache, or CRAN has a bad binary.

Fredo-XVII commented 4 years ago

So to submit a package to CRAN, don't you need to test your package on the development version of R? Which would probably meant that the binary would be built on a different version of R, a stable/release version of R. I have never been able to submit a package to CRAN because this is where I get hung up. How do a test my package on the development version of R if the packages are not supported on the development version?

gaborcsardi commented 4 years ago

don't you need to test your package on the development version of R?

That is suggested, yes.

Which would probably meant that the binary would be built on a different version of R, a stable/release version of R.

No. You submit a source package, not a binary one. Source packages are portable, binary ones are not.

I have never been able to submit a package to CRAN because this is where I get hung up. How do a test my package on the development version of R if the packages are not supported on the development version?

I am not really sure what you mean, but you submit source packages to CRAN. To create a source package, you run R CMD build. The result is a .tar.gz file, which works on both R-release and R-devel.

From this CRAN creates separate Windows binary packages for R-devel and R-release. These are .zip files. A binary package build on R-release might not work on R-devel and vice-versa.

LiNk-NY commented 4 years ago

What I don't understand is why it says that remotes was installed before R 4.0.0. How can that be? Wouldn't you need to have R installed to install any packages?

Sometimes CRAN creates symbolic links to built tar balls from older versions when they're not available for a particular version.

Fredo-XVII commented 4 years ago

Hello, I submitted the package to CRAN and they didn't have the errors that appveyor did, nor the win_build errors that I was getting. I have other things to fix, just not the ones in this issue.

Thanks for the help!