Winbuilder error when using a package made by rstantools

Hi all

I am testing the R-package “EcoEnsemble” before updating it on CRAN.

When checking locally on a Windows machine I get a few Notes, but all seems to be fine and on the Mac checker I get a couple of notes.

However, when I check on the windows using:

I get an error.

It says:

  • using log directory ‘d:/RCompile/CRANguest/R-release/EcoEnsemble.Rcheck’
  • using R version 4.3.0 (2023-04-21 ucrt)
  • using platform: x86_64-w64-mingw32 (64-bit)
  • R was compiled by
    gcc.exe (GCC) 12.2.0
    GNU Fortran (GCC) 12.2.0
  • running under: Windows Server 2022 x64 (build 20348)
  • using session charset: UTF-8
  • checking for file ‘EcoEnsemble/DESCRIPTION’ … OK
  • this is package ‘EcoEnsemble’ version ‘1.0.4’
  • package encoding: UTF-8
  • checking CRAN incoming feasibility … [10s] NOTE
    Maintainer: ‘Michael A. Spence
    Found the following (possibly) invalid URLs:
    Status: 403
    Message: Forbidden
  • checking package namespace information … OK
  • checking package dependencies … OK
  • checking if this is a source package … OK
  • checking if there is a namespace … OK
  • checking for hidden files and directories … OK
  • checking for portable file names … OK
  • checking whether package ‘EcoEnsemble’ can be installed … ERROR
    Installation failed.
    See ‘d:/RCompile/CRANguest/R-release/EcoEnsemble.Rcheck/00install.out’ for details.
  • DONE
    Status: 1 ERROR, 1 NOTE

Which when checking 00install.out

  • installing source package ‘EcoEnsemble’ …
    ** using staged installation
    Error in system.file(“include”, “stan”, “math”, “prim”, package = “StanHeaders”, :
    no file found
    Calls: … paste → PKG_CPPFLAGS_env_fun → dir → system.file
    Execution halted
    ERROR: configuration failed for package ‘EcoEnsemble’
  • removing ‘d:/RCompile/CRANguest/R-release/lib/EcoEnsemble’

It appears the error is in the “” file on the line:
STANHEADERS_SRC = (shell "(R_HOME)/bin$(R_ARCH_BIN)/Rscript" -e “message()” -e “cat(system.file(‘include’, ‘src’, package = ‘StanHeaders’, mustWork = TRUE))” -e “message()” | grep “StanHeaders”)
but I’m not really sure what I’m looking at and this was automatically generated by rstantools (version 2.3.1)

Last week this seemed to work and I haven’t made many changes (only added a few tests and updated the documentation). I used Winbuilder with EcoEnsemble 1.0.3, which is currently on CRAN, and I get the same error as above:

The package is here

I tried this yesterday and today with the same result. Does anyone know of a solution to this problem?

Thanks a lot for your time.


Sorry for the delay in getting to this, are you still having an issue?

No worries. The issue seemed to sort itself out.

Thanks for getting back to me.