rundel / parsermd

https://rundel.github.io/parsermd/
Other
76 stars 4 forks source link

{parsermd} cannot install on R3.6 in GitHub Actions #26

Open statnmap opened 2 years ago

statnmap commented 2 years ago

It seems that {parsermd} cannot be installed on Windows with R3.6.
I have this error message in GitHub Actions:

Running `R CMD build`...
* checking for file 'C:\Users\runneradmin\AppData\Local\Temp\RtmpMj8AFc\remotes1b641a6055a5\rundel-parsermd-7144846/DESCRIPTION' ... OK
* preparing 'parsermd':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* checking for LF line-endings in source and make files and shell scripts
* checking for empty or unneeded directories
* building 'parsermd_0.1.2.9000.tar.gz'
Installing package into 'D:/a/_temp/Library'
(as 'lib' is unspecified)
* installing *source* package 'parsermd' ...
** using staged installation
** libs

*** arch - i386
Error in .shlib_internal(args) : 
  C++14 standard requested but CXX14 is not defined

Maybe you could add this in your GitHub Actions, this may help detect potential problems with future CRAN submissions:

          - {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}

For information, I also use these ones:

          - {os: ubuntu-20.04,   r: '3.6',     rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
          - {os: ubuntu-20.04,   r: '3.5',     rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
rundel commented 2 years ago

The issue here is with the Rtools version (3.5) that comes with R 3.6 - the version of gcc provided is old enough that it does not support the cpp14 standard which is necessary for the underlying boost library that the package is using.

I had originally had an R version requirement of 4.0.0 but based on Hadley's suggestion (#7) I downgraded it to the current 3.5.0 and I believe cpp14 has been officially supported since 3.4.0.

In looking back though the closed issues this came up before in #1 and based on Jeroen's feedback I don't think there is a workaround. It might be possible to include more useful / actionable feedback via an autoconf type script that makes it explicit that rtools4 is required on windows.

I will add the older ubuntu R versions to the build tests - thanks for the suggestion.

statnmap commented 2 years ago

Jeroen suggests to include {boost} headers directly in your package to avoid dependency to {BH} ones. Maybe this could be a good workaround since there are still multiple users with R<4.0 on Windows. What do you think ?

I can see that there are users still even downloading old versions of R with Windows...

image
rundel commented 2 years ago

Unfortunately that wont make things better - the Spirit X3 library which is used for all the parsing depends on C++14. The library authors did report with the original release that GCC 4.9 should be sufficient but that does not appear to be the case. I've just tested with R 3.6 and Rtools 3.5 with a Makevars.win that includes -std=c++14 and there are a number of compiler errors from the library that are not resolveable.