Closed evansd closed 10 months ago
This is currently blocked on re-compiling the ggh4x
package which fails with the error:
6738.6 Error: Error installing package 'ggh4x':
6738.6 =================================
6738.6
6738.6 * installing *source* package ‘ggh4x’ ...
6738.6 ** package ‘ggh4x’ successfully unpacked and MD5 sums checked
6738.6 ** using staged installation
6738.6 ** R
6738.6 ** inst
6738.6 ** byte-compile and prepare package for lazy loading
6738.6 Error in get(x, envir = ns, inherits = FALSE) :
6738.6 object 'continuous_range' not found
6738.6 Error: unable to load R code in package ‘ggh4x’
6738.6 Execution halted
6738.6 ERROR: lazy loading failed for package ‘ggh4x’
6738.6 * removing ‘/renv/renv/staging/1/ggh4x’
6738.6 install of package 'ggh4x' failed [error code 1]
6738.7 Traceback (most recent calls last):
6738.7 13: renv::restore()
6738.7 12: renv_restore_run_actions(project, diff, current, lockfile, rebuild)
6738.7 11: renv_install_impl(records)
6738.7 10: renv_install_staged(records)
6738.7 9: renv_install_default(records)
6738.7 8: handler(package, renv_install_package(record))
6738.7 7: renv_install_package(record)
6738.7 6: withCallingHandlers(renv_install_package_impl(record), error = function(e) writef("FAILED"))
6738.7 5: renv_install_package_impl(record)
6738.7 4: r_cmd_install(package, path)
6738.7 3: r_exec_error(package, output, "install", status)
6738.7 2: abort(all)
6738.7 1: stop(fallback)
6738.7 Execution halted
------
Dockerfile:45
--------------------
43 | # use renv to install packages
44 | COPY renv.lock /renv/renv.lock
45 | >>> RUN --mount=type=cache,target=/cache,id=/cache-2004 R -e 'renv::restore()'
46 |
47 | # renv uses symlinks to the the build cache to populate the lib directory. As
--------------------
ERROR: failed to solve: process "/bin/sh -c R -e 'renv::restore()'" did not complete successfully: exit code: 1
ERROR: Service 'r' failed to build : Build failed
error: Recipe `build` failed with exit code 1
If I remove the package from renv.lock
then the image builds successfully:
https://github.com/opensafely-core/r-docker/blob/30fc019c90ccd2934484688e93f333fb6fdbebba/renv.lock#L2048-L2061
As background to the above, I first tried replacing the r-base-core
package in dependencies.txt
with r-base-dev
on the assumption that the latter pulled in the former.
When I then tried to rebuild the image I got an error building the Matrix
package:
dgeMatrix.h:43:15: error: conflicting types for ‘dgesdd_’
I thought maybe this was some problem with the BuildKit cache and so I wiped that using:
docker builder prune --filter type=exec.cachemount
And then waited the 45 years necessary to recompile everything from scratch, but that still gave the same error.
After changing dependencies.txt
to include both r-base-dev
and r-base-core
the Matrix
package compiled successfully, but then I hit the issue with ggh4x
. After removing that, the image built successfully.
This allows users to optimise hot loops by rewriting them in C++ and using the well-known
Rcpp
package.For some reason this required upgrading
ggh4x
from v0.2.1 to v0.2.6 as the previous version failed to compile.This increases the total on-disk size of the image from 2549M to 2990M.
Closes #149