[R-pkg-devel] Testing package on R-devel in a docker container

Ott Toomet otoomet @end|ng |rom gm@||@com
Mon Aug 11 06:38:17 CEST 2025


Hey everyone who is more familiar with R-devel and docker.

I am trying to test the new version of my package (maxLik) on R-devel,
using the docker container.  I am using rocker/r-devel as the base.  Note
that R-devel is called "RD" in the image.  I am copying in my package
sources and a few scripts, and run "RD CMD build" and "RD CMD check".
However, the latter fails with complaints about missing packages that are
installed and accessible when I run RD from command line.

Here are a few results:

* After a successful build inside the container, I run check:
root using f4024e015396:/# RD CMD check --as-cran maxLik_1.6-3.tar.gz
* using log directory ‘//maxLik.Rcheck’
* using R Under development (unstable) (2025-08-11 r88561)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
    gcc (Debian 14.2.0-19) 14.2.0
    GNU Fortran (Debian 14.2.0-19) 14.2.0
* running under: Debian GNU/Linux trixie/sid
* using session charset: UTF-8
* using option ‘--as-cran’
* checking for file ‘maxLik/DESCRIPTION’ ... OK
* this is package ‘maxLik’ version ‘1.6-3’
* checking CRAN incoming feasibility ... [6s/35s] OK
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for executable files ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking serialization versions ... OK
* checking whether package ‘maxLik’ can be installed ... ERROR
Installation failed.
See ‘//maxLik.Rcheck/00install.out’ for details.
* DONE

Status: 1 ERROR
See
  ‘//maxLik.Rcheck/00check.log’
for details.

* Take a look at the log:

root using f4024e015396:/# cat maxLik.Rcheck/00install.out
* installing *source* package ‘maxLik’ ...
** this is package ‘maxLik’ version ‘1.6-3’
** using staged installation
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]])
:
  there is no package called ‘lattice’
Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart ->
doWithOneRestart
Execution halted
ERROR: lazy loading failed for package ‘maxLik’
* removing ‘/maxLik.Rcheck/maxLik’

Apparently 'lattice' is missing???

* But it is there and I can load it with no errors:

root using f4024e015396:/# RDscript -e "packageVersion('lattice')"
[1] ‘0.22.7’
root using f4024e015396:/# RDscript -e "library(lattice)"

Formerly I got similar missing package messages for other packages, I have
also tried to manually overwrote the R_LIB_USR environment variable (that
resulted in another error a bit further down in the line), and to install
my own package into different locations.  So far everything seems to lead
to the same problem.

Note that it works if I run it inside the container using the stable R ("R"
instead of "RD").  Currently it is based on r88561 (2025-08-11) version of
R-devel as you can see above.

For reference, here is the Dockerfile:

# -*- dockerfile-mode -*-
FROM rocker/r-devel
RUN apt-get install -y texlive-science
ENV INSIDE_DOCKER=true
COPY packages.R .  # install script for necessary packages
RUN RDscript packages.R  # install dependencies/suggestions etc
COPY pkg ./pkg  # copy the maxlik package source
COPY build-check .  # building/checking script
CMD ["bash"]


Any ideas?

Ott

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list