Closed iaindillingham closed 1 month ago
In the OpenSAFELY R image, libxml2
is installed as a system package. Testing inside that R image, if you apt remove libxml2
, you get a similar error inside that R image:
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/renv/lib/R-4.0/x86_64-pc-linux-gnu/xml2/libs/xml2.so':
libxml2.so.2: cannot open shared object file: No such file or directory
Additional dependencies for the R Docker image in:
https://github.com/opensafely-core/r-docker/blob/bb8e0325c84f7b606124bf7294d5e4a5fda2681c/build-dependencies.txt https://github.com/opensafely-core/r-docker/blob/bb8e0325c84f7b606124bf7294d5e4a5fda2681c/dependencies.txt
(Not directly relevant, but the Python image has additionally installed dependencies too.)
I'm not sure we need the build dependencies as we're not building any of these packages from source. The omission of the dependencies is definitely an error.
I suppose if we want to support user installation of R packages from source then we might need those build dependencies. However, there may be additional dependencies for packages we don't know about.
Importing all packages:
ip = unique(as.list(as.data.frame(installed.packages()[,c(1)])))
for (i in ip[[1]]){
eval(parse(text=paste("library(\"",i,"\")",sep="")))
}
shows other missing dependencies:
brms
- libnode64
magick
- libmagick++-6.q16-8
odbc
- unixodbc-dev
*rgdal
- libgdal-dev
* sf
- libudunits2-0
tcltk
- libtcl8.6
and libtcl8.6
**Which are in dependencies.txt or build-dependencies.txt (*). libtcl
and libtk
(**) are odd ones, not in either dependencies file, but feature in 20.04-library-changes.txt
AFAICT assessing only direct dependencies: brms isn't used magick is odbc is, but only for the high cost drugs dataset rgdal isn't used sf is used tcltk isn't used
Maybe in addition to libxml2
we should also install libmagick++
and libudunits
to support existing researcher code?
@alschaffer reports the following error when attempting to load the
tidyverse
package in RStudio:Andrea started a Codespace from opensafely/waiting-list. I was able to recreate the above error in a new Codespace started from opensafely/research-template.^1 I successfully loaded several other packages from
packages.csv
.