[Bioc-devel] lazy loading failure on macOS

Hervé Pagès hp@ge@@on@g|thub @end|ng |rom gm@||@com
Thu Apr 29 02:10:05 CEST 2021


Hi Waldir,

Like with this other post 
https://stat.ethz.ch/pipermail/bioc-devel/2021-April/018035.html this 
problem also seems to be related to an issue with the most recent 
versions of rgl.

Here is what I did:

- I went on machv2 (our Mac builder for the devel builds), which has the 
latest rgl (0.106.8) and ran:

   machv2:$ R CMD INSTALL cellmigRation
   * installing to library 
‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library’
   * installing *source* package ‘cellmigRation’ ...
   ** using staged installation
   ** R
   ** data
   ** inst
   ** byte-compile and prepare package for lazy loading
   ERROR: lazy loading failed for package ‘cellmigRation’
   * removing 
‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library/cellmigRation’

   This is what you see on the build report. Unfortunately 'R CMD 
INSTALL' doesn't display anything useful here.

- However, after downgrading rgl to version 0.105.22, I can do:

   machv2:$ R CMD INSTALL cellmigRation
   * installing to library 
‘/Library/Frameworks/R.framework/Versions/4.1/Resources/library’
   * installing *source* package ‘cellmigRation’ ...
   ** using staged installation
   ** R
   ** data
   ** inst
   ** byte-compile and prepare package for lazy loading
   Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
   ** help
   *** installing help indices
   ** building package indices
   ** installing vignettes
   ** testing if installed package can be loaded from temporary location
   Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
   ** testing if installed package can be loaded from final location
   Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
   ** testing if installed package keeps a record of temporary 
installation path
   * DONE (cellmigRation)

   Works without problem although there's a suspicious warning 
apparently coming from rgl.

Note that you only use rgl in your plot3DTracks() and plot3DAllTracks() 
functions so maybe it's not necessary to make rgl a "hard" dependency of 
your package. You could make it a "soft" dependency instead by moving it 
to the Suggests field. Then all you need to do is to edit the man pages 
for plot3DTracks() and plot3DAllTracks() to mention that these functions 
require rgl to work, and add something like

         if (!requireNamespace("rgl", quietly=TRUE))
             stop("Couldn't load the rgl package. Please install ",
                  "the rgl package in order to use plot3DTracks().")

at the beginning of the function's bodies.

That should at least solve the 'R CMD INSTALL cellmigRation' problem.

Then wait a couple of days and see what happens on the build report. If 
the plot3DTracks() and/or plot3DAllTracks() examples fail on machv2 
(during 'R CMD check'), then you'll need to disable them on Mac by 
wrapping them inside something like:

   if (Sys.info()[["sysname"]] != "Darwin") {
       ...
       ...
   }

Hope this helps,

H.


On 4/27/21 2:15 AM, Waldir Leoncio Netto wrote:
> Dear all,
> 
> Our recently-accepted package (cellmigRation) fails when installing and building on the machv2 (macOS) machine. Unfortunately, the report on http://bioconductor.org/checkResults/devel/bioc-LATEST/cellmigRation/machv2-install.html isn't much helpful to me, as it simply says "ERROR: lazy loading failed for package ‘cellmigRation’" and quits.
> 
> I don't have Apple devices around, so I don't think I could use the instructions on https://bioconductor.org/checkResults/3.13/bioc-LATEST/Renviron.bioc to reproduce the issue. If I dowgrade the R 4.1 dependency and use rhub to check the package on macos-highsierra-release (rhub doesn't seem to provide an R-devel macOS platform), it passes with a warning. I think this is where the problem lies, as Bioconductor checks tend to fail on warnings IIRC:
> 
> W checking whether package ‘cellmigRation’ can be installed (25.3s)
> Found the following significant warnings:
> Warning: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'.
> See ‘/Users/userh9mZWtKO/cellmigRation.Rcheck/00install.out’ for details.
> 
> Following the documentation here<https://www.rdocumentation.org/packages/rgl/versions/0.105.22/topics/rgl.init> and here<https://www.rdocumentation.org/packages/rgl/versions/0.100.54/topics/rgl.useNULL>, I see two solutions:
> 
> 1) Install XQuartz;
> 2) either set the R option rgl.useNULL or the environment variable RGL_USE_NULL to TRUE.
> 
> Looks like the second option is the most appropriate for this case, but I do not know how I could pass this on to the machv2 machine. If I understood correctly, this is only a problem on headless servers, so PCs running macOS would probably install the package fine.
> 
> Does anyone have experience solving this issue?
> 
> Best regards,
> Waldir
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> Bioc-devel using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
> 

-- 
Hervé Pagès

Bioconductor Core Team
hpages.on.github using gmail.com



More information about the Bioc-devel mailing list