Skip to content
Prev 6995 / 12125 Next

[R-pkg-devel] GitHub Action failed re-building 'sos.Rnw'

Okay, I just worked out the chain:  The fda package depends on fds.  fds 
depends on rainbow. rainbow imports ks. ks imports plot3D. plot3D 
imports misc3d.  misc3d imports tcltk.  tcltk on macOS needs XQuartz.

I saw this item online: 
https://github.com/actions/virtual-environments/issues/771 .  It's a 
suggestion to add this to the default macOS VM, but apparently they 
didn't act on it.  You could try adding it to yours:

  if: runner.os == 'macOS'
         run: |
           wget https://dl.bintray.com/xquartz/downloads/XQuartz-2.7.11.dmg
           sudo hdiutil attach XQuartz-2.7.11.dmg
           sudo installer -package /Volumes/XQuartz-2.7.11/XQuartz.pkg 
-target /


(Though the current XQuartz version is 2.8.1, and the URL above doesn't 
work for me, so you'll probably have to spend some time finding one that 
does.)

What should you do?  I can suggest a couple of things other than 
installing XQuartz:

1.  Drop the fda dependency, and work around the lack of fda::CRAN.  It 
seems you're pulling in an awful lot of stuff for that one function. 
The on_cran function in testthat has this definition:

function ()
!identical(Sys.getenv("NOT_CRAN"), "true")

so I'd copy that to your package and then define environment variable 
NOT_CRAN=true on your Github machine (in the "env:" section).  But this 
might be inconvenient working on your own machine, where you'll also 
need to define NOT_CRAN=true.

2.  Leave in the fda dependency, but make the test conditional, i.e. change

  if (fda::CRAN())

to

  if (requireNamespace("fda") && fda::CRAN())


I'd do number 1, or just assume everything is being run on CRAN.

Duncan Murdoch
On 23/05/2021 6:49 p.m., Spencer Graves wrote: