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

Spencer Graves @pencer@gr@ve@ @end|ng |rom e||ect|vede|en@e@org
Mon May 24 16:17:47 CEST 2021


Hi, Duncan:


	  Thanks again.


	  I found XQuartz-2.8.1.dmg and added the 5 lines you suggested 
(modified to 2.8.1) to "R-CMD-check.yaml".  However, the "GitHub Action" 
status symbols disappeared, so I deleted them.


	  I copied the "CRAN" function from fda to sos and deleted the 
reference to fda from sos.


	  Now I'm getting, 'could not find function "CRAN"' in "processing 
vignette 'sos.Rnw'", even though CRAN is in the NAMESPACE for sos.


	  Suggestions?


	  Thanks,
	  Spencer


p.s.  To use Sys.getenv("NOT_CRAN"), I'd have to set the environment 
variable "NOT_CRAN" on all the test platforms other than CRAN, and 
that's a level of complexity I'd rather not get into.


On 5/23/21 7:03 PM, Duncan Murdoch wrote:
> 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:
>> Hi, Duncan et al.:
>>
>>
>>       Thanks again.  I removed fda from "suggests" and added it to
>> "imports" in DESCRIPTION.  I also added "importFrom('fda', 'CRAN')" to
>> NAMESPACE.  Sadly, the result was the same:  It passed "R CMD check" on
>> Windows, ubuntu, and my local Mac but not macOS on GitHub Action.
>>
>>
>>       How do you suggest I proceed from here?
>>
>>
>>       You may recall that I started using "if(fda::CRAN())" as a way to
>> keep checks for routine testing that take too much time on CRAN.  I've
>> looked at Wickham's "skip_on_cran" but concluded, perhaps incorrectly,
>> that it was not self contained and required more work to use than
>> "if(fda::CRAN())".  If I'm incorrect in that assessment, I will happily
>> accept instructions on how to convert "if(fda::CRAN())" to use
>> "skip_on_cran".
>>
>>
>>       Again, I really appreciate the help.
>>       Spencer
>>
>>
>> On 5/23/21 4:44 PM, Duncan Murdoch wrote:
>>> I don't see where the connection is, but it's almost certainly coming in
>>> through your unconditional use of "fda::CRAN()".  Since "fda" is not a
>>> hard requirement, this should be conditional on having it installed.
>>>
>>> Duncan Murdoch
>>>
>>> On 23/05/2021 5:25 p.m., Spencer Graves wrote:
>>>> Hi, Duncan et al.:
>>>>
>>>>
>>>>        I inserted "the lines from the rgl workflow to work around the
>>>> XQuartz issues" that Duncan provided after "env" in TWO places in
>>>> R-CMD-check.yaml with the same result:  GitHub Action worked fine on
>>>> Windows and ubuntu (both release and devel) but failed on macOS
>>>> complaining, "there is no package called 'ks'".
>>>>
>>>>
>>>>        HOWEVER, I can NOT see how I even ask for ks.  The error message
>>>> says:
>>>>
>>>>
>>>> processing the following file failed: 'sos.Rnw'
>>>> Error: Error: Vignette re-building failed.
>>>> Execution halted
>>>> Error: Error in proc$get_built_file() : Build process failed
>>>> Calls: <Anonymous> ... build_package -> with_envvar -> force ->
>>>> <Anonymous>
>>>> Execution halted
>>>> Error: Process completed with exit code 1.
>>>>
>>>>
>>>>        I can NOT find it with "grep 'ks' sos.Rnw".  It's NOT in
>>>> DESCRIPTION
>>>> nor NAMESPACE.
>>>>
>>>>
>>>>        I do NOT see how I am even asking for it.
>>>>
>>>>
>>>>        PROPOSED NEXT STEP:  Do as outlined in
>>>> "https://github.com/ThinkR-open/prepare-for-cran" and submit to CRAN
>>>> with a note on this problem in cran-comments.md if the package passes
>>>> all other tests.
>>>>
>>>>
>>>>        Other suggestions?
>>>>        Thanks again, Duncan.
>>>>        Spencer
>>>>
>>>>
>>>> On 5/23/21 2:36 PM, Duncan Murdoch wrote:
>>>>> For ks, if you look here:
>>>>> https://github.com/sbgraves237/sos/runs/2650960959?check_suite_focus=true 
>>>>>
>>>>>
>>>>>
>>>>> in the "Install Dependencies" section, you'll see these errors:
>>>>>
>>>>> trying URL 'https://cloud.r-project.org/src/contrib/ks_1.13.0.tar.gz'
>>>>> Content type 'application/x-gzip' length 1076044 bytes (1.0 MB)
>>>>> ==================================================
>>>>> downloaded 1.0 MB
>>>>>
>>>>> * installing *source* package ‘plot3D’ ...
>>>>> ** package ‘plot3D’ successfully unpacked and MD5 sums checked
>>>>> ** using staged installation
>>>>> ** R
>>>>> ** data
>>>>> *** moving datasets to lazyload DB
>>>>> ** inst
>>>>> ** byte-compile and prepare package for lazy loading
>>>>> Error: Error: .onLoad failed in loadNamespace() for 'tcltk', details:
>>>>> ERROR: lazy loading failed for package ‘plot3D’
>>>>>      call: fun(libname, pkgname)
>>>>> * removing ‘/Users/runner/work/_temp/Library/plot3D’
>>>>>      error: X11 library is missing: install XQuartz from 
>>>>> www.xquartz.org
>>>>> Execution halted
>>>>> ERROR: dependency ‘plot3D’ is not available for package ‘ks’
>>>>> * removing ‘/Users/runner/work/_temp/Library/ks’
>>>>>
>>>>> so the problem is really with plot3D, and indirectly with rgl and 
>>>>> tcltk.
>>>>> I'm familiar with problems like that!  Here are the lines from the rgl
>>>>> workflow to work around the XQuartz issues:
>>>>>
>>>>>        env:
>>>>>          R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
>>>>>          _R_CHECK_FORCE_SUGGESTS_: false
>>>>>          RSPM: ${{ matrix.config.rspm }}
>>>>>          GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
>>>>>          RGL_USE_NULL: true
>>>>>
>>>>> The last line might be enough for you, but I think the 2nd line
>>>>>
>>>>> _R_CHECK_FORCE_SUGGESTS_: false
>>>>>
>>>>> may be more important:  you use ks, it imports plot3D, plot3D imports
>>>>> misc3d, but it only suggests rgl and tkrplot:  so that would let ks 
>>>>> load
>>>>> without XQuartz support.
>>>>>
>>>>> Duncan Murdoch
>>>>>
>>>>> On 23/05/2021 3:09 p.m., Spencer Graves wrote:
>>>>>> Hi, Duncan et al.:
>>>>>>
>>>>>>
>>>>>>         Thanks again to Duncan.  Your suggestions worked for the 
>>>>>> LaTeX
>>>>>> problem, though it required multiple iterations, adding a total of 7
>>>>>> different "tinytex::parse_install" clauses to overcome other LaTeX 
>>>>>> and
>>>>>> pdfTeX errors.
>>>>>>
>>>>>>
>>>>>>         However, macOS still says, "there is no package called 'ks'",
>>>>>> even
>>>>>> though I added 'install.packages("ks")' as you suggested -- to three
>>>>>> different places, all without solving the problem.  I posted this
>>>>>> question to
>>>>>> "https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions", 
>>>>>>
>>>>>>
>>>>>>
>>>>>> as suggested in line 2 of "~/.github/workflows/R-CMD-check.yaml".  
>>>>>> See:
>>>>>>
>>>>>>
>>>>>>         Spencer
>>>>>>
>>>>>>
>>>>>> On 5/23/21 11:03 AM, Duncan Murdoch wrote:
>>>>>>> This page
>>>>>>>
>>>>>>> https://bookdown.org/yihui/rmarkdown-cookbook/install-latex-pkgs.html 
>>>>>>>
>>>>>>>
>>>>>>> suggests that executing this in R should fix the tikz issue:
>>>>>>>
>>>>>>> tinytex::parse_install(
>>>>>>>       text = "! LaTeX Error: File `tikz.sty' not found."
>>>>>>> )
>>>>>>>
>>>>>>> The "ks" message looks like a missing R package rather than a 
>>>>>>> missing
>>>>>>> LaTeX package, so running install.packages("ks") would fix it.
>>>>>>>
>>>>>>> So the only question is how to do these things in a Github 
>>>>>>> action.  I
>>>>>>> don't know if there's a pre-made recipe for this, but this one
>>>>>>> should do
>>>>>>> it:
>>>>>>>
>>>>>>>           - name: Install tikz.tex and ks
>>>>>>>             run: |
>>>>>>>               install.packages(c('tinytex', 'ks')) # Maybe 
>>>>>>> tinytex is
>>>>>>> already there?
>>>>>>>               tinytex::parse_install(
>>>>>>>                  text = "! LaTeX Error: File `tikz.sty' not found."
>>>>>>>               )
>>>>>>>             shell: Rscript {0}
>>>>>>>
>>>>>>> Duncan Murdoch
>>>>>>>
>>>>>>> On 23/05/2021 11:28 a.m., Spencer Graves wrote:
>>>>>>>> Hi, Duncan et al.:
>>>>>>>>
>>>>>>>>
>>>>>>>>          Thanks very much to Duncan for his suggestion.  I did
>>>>>>>> added the
>>>>>>>> line
>>>>>>>> Duncan suggested in three slightly different places.  That fixed 
>>>>>>>> the
>>>>>>>> problems with missing tex and pdflatex, but exposed two new 
>>>>>>>> problems:
>>>>>>>>
>>>>>>>>
>>>>>>>>          On Windows and ubuntu (both release and devel) I now get:
>>>>>>>>
>>>>>>>>
>>>>>>>> LaTeX Error: File `tikz.sty' not found.
>>>>>>>>
>>>>>>>>
>>>>>>>>          On macOS, I got a different error:
>>>>>>>>
>>>>>>>>
>>>>>>>> there is no package called 'ks'
>>>>>>>>
>>>>>>>>
>>>>>>>>          I added "ks" to "suggests" in DESCRIPTON but still got "no
>>>>>>>> package
>>>>>>>> called 'ks'.  And I studied README in
>>>>>>>> https://github.com/r-lib/actions,
>>>>>>>> and I did some other searches without figuring out how to fix
>>>>>>>> "`tikz.sty' not found."
>>>>>>>>
>>>>>>>>
>>>>>>>>          For more details, see:
>>>>>>>>
>>>>>>>>
>>>>>>>> https://github.com/sbgraves237/sos
>>>>>>>>
>>>>>>>>
>>>>>>>>          Suggestions?
>>>>>>>>          Thanks,
>>>>>>>>          Spencer
>>>>>>>>
>>>>>>>>
>>>>>>>> On 5/23/21 4:43 AM, Duncan Murdoch wrote:
>>>>>>>>> On 22/05/2021 10:05 p.m., Spencer Graves wrote:
>>>>>>>>>> Hello:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>           What do you suggest I do to enable GitHub Action to
>>>>>>>>>> process
>>>>>>>>>> "sos.Rnw"
>>>>>>>>>> properly?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>           The development version of my "sos" package passes 
>>>>>>>>>> "R CMD
>>>>>>>>>> check" on
>>>>>>>>>> my Mac but fails in all four platforms under GitHub Action on
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> https://github.com/sbgraves237/sos
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>           The error messages on macOS and Ubuntu release and
>>>>>>>>>> devel all
>>>>>>>>>> seems
>>>>>>>>>> the same:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                 * Error: processing vignette 'sos.Rnw' failed 
>>>>>>>>>> with
>>>>>>>>>> diagnostics:
>>>>>>>>>> Running 'texi2dvi' on 'sos.tex' failed.  Messages: You don't 
>>>>>>>>>> have a
>>>>>>>>>> working TeX binary (tex) installed anywhere in your PATH, and
>>>>>>>>>> texi2dvi
>>>>>>>>>> cannot proceed without one.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>           The error message under Windows seemed crudely 
>>>>>>>>>> similar but
>>>>>>>>>> different:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>                 * Error: processing vignette 'sos.Rnw' failed 
>>>>>>>>>> with
>>>>>>>>>> diagnostics:
>>>>>>>>>> pdflatex is not available
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>           What do you suggest?
>>>>>>>>>
>>>>>>>>> The virtual machines that run Github actions have lots of tools
>>>>>>>>> installed, but apparently not LaTeX.  So you need to figure out 
>>>>>>>>> the
>>>>>>>>> "step" to install it.  I'm not currently using Rnw with Github
>>>>>>>>> actions,
>>>>>>>>> but by looking at the README for
>>>>>>>>> https://github.com/r-lib/actions, I'm
>>>>>>>>> pretty sure all you need is to add
>>>>>>>>>
>>>>>>>>>        - uses: r-lib/actions/setup-tinytex using v1
>>>>>>>>>
>>>>>>>>> somewhere after
>>>>>>>>>
>>>>>>>>>        - uses: actions/checkout using master
>>>>>>>
>>>>>
>>>
>



More information about the R-package-devel mailing list