Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependency error, platform mismatch and other errors when renv.config.pak.enabled = TRUE #2051

Open
mihem opened this issue Dec 4, 2024 · 19 comments

Comments

@mihem
Copy link

mihem commented Dec 4, 2024

I have a large project with many packages. When I want to build a Docker image as explained here https://rstudio.github.io/renv/articles/docker.html this is painfully slow. Only downloading takes over an hour, which is not due to a slow internet connection, the r docker image that this image is build on is probably larger than all packages combined and is downloaded in a minute or so.
I`ve read that pak considerably speeds up this process and pak is available for renv since some time.

However, I get lots of errors when I set renv.config.pak.enabled = TRUE.

110.5 * [email protected]: Can't install dependency timechange (>= 0.1.1)
110.5 * timechange: Conflicts with [email protected]
110.5 * [email protected]: Platform mismatch
110.5 * [email protected]: Platform mismatch
110.5 * [email protected]: Can't install dependency Rcpp (>= 0.11.0)
110.5 * [email protected]:
110.5   * Can't install dependency cli (>= 3.6.1) (>= 1.1.1)
110.5   * Can't install dependency rlang (>= 1.1.1)

I tried this with a minimal reproducible example, where I only used ggplot2.
When using ggplot2 and dependencies with my currently installed version this fails:

renv.lock
{
  "R": {
    "Version": "4.4.2",
    "Repositories": [
      {
        "Name": "CRAN",
        "URL": "https://packagemanager.posit.co/cran/latest"
      }
    ]
  },
  "Packages": {
    "MASS": {
      "Package": "MASS",
      "Version": "7.3-61",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics",
        "methods",
        "stats",
        "utils"
      ],
      "Hash": "0cafd6f0500e5deba33be22c46bf6055"
    },
    "Matrix": {
      "Package": "Matrix",
      "Version": "1.7-1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics",
        "grid",
        "lattice",
        "methods",
        "stats",
        "utils"
      ],
      "Hash": "5122bb14d8736372411f955e1b16bc8a"
    },
    "R6": {
      "Package": "R6",
      "Version": "2.5.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R"
      ],
      "Hash": "470851b6d5d0ac559e9d01bb352b4021"
    },
    "RColorBrewer": {
      "Package": "RColorBrewer",
      "Version": "1.1-3",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R"
      ],
      "Hash": "45f0398006e83a5b10b72a90663d8d8c"
    },
    "cli": {
      "Package": "cli",
      "Version": "3.6.3",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "b21916dd77a27642b447374a5d30ecf3"
    },
    "colorspace": {
      "Package": "colorspace",
      "Version": "2.1-1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "grDevices",
        "graphics",
        "methods",
        "stats"
      ],
      "Hash": "d954cb1c57e8d8b756165d7ba18aa55a"
    },
    "fansi": {
      "Package": "fansi",
      "Version": "1.0.6",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "grDevices",
        "utils"
      ],
      "Hash": "962174cf2aeb5b9eea581522286a911f"
    },
    "farver": {
      "Package": "farver",
      "Version": "2.1.2",
      "Source": "Repository",
      "Repository": "RSPM",
      "Hash": "680887028577f3fa2a81e410ed0d6e42"
    },
    "ggplot2": {
      "Package": "ggplot2",
      "Version": "3.5.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "MASS",
        "R",
        "cli",
        "glue",
        "grDevices",
        "grid",
        "gtable",
        "isoband",
        "lifecycle",
        "mgcv",
        "rlang",
        "scales",
        "stats",
        "tibble",
        "vctrs",
        "withr"
      ],
      "Hash": "44c6a2f8202d5b7e878ea274b1092426"
    },
    "glue": {
      "Package": "glue",
      "Version": "1.7.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "methods"
      ],
      "Hash": "e0b3a53876554bd45879e596cdb10a52"
    },
    "gtable": {
      "Package": "gtable",
      "Version": "0.3.5",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "grid",
        "lifecycle",
        "rlang"
      ],
      "Hash": "e18861963cbc65a27736e02b3cd3c4a0"
    },
    "isoband": {
      "Package": "isoband",
      "Version": "0.2.7",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "grid",
        "utils"
      ],
      "Hash": "0080607b4a1a7b28979aecef976d8bc2"
    },
    "labeling": {
      "Package": "labeling",
      "Version": "0.4.3",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "graphics",
        "stats"
      ],
      "Hash": "b64ec208ac5bc1852b285f665d6368b3"
    },
    "lattice": {
      "Package": "lattice",
      "Version": "0.22-6",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "grDevices",
        "graphics",
        "grid",
        "stats",
        "utils"
      ],
      "Hash": "cc5ac1ba4c238c7ca9fa6a87ca11a7e2"
    },
    "lifecycle": {
      "Package": "lifecycle",
      "Version": "1.0.4",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "rlang"
      ],
      "Hash": "b8552d117e1b808b09a832f589b79035"
    },
    "magrittr": {
      "Package": "magrittr",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R"
      ],
      "Hash": "7ce2733a9826b3aeb1775d56fd305472"
    },
    "mgcv": {
      "Package": "mgcv",
      "Version": "1.9-1",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "Matrix",
        "R",
        "graphics",
        "methods",
        "nlme",
        "splines",
        "stats",
        "utils"
      ],
      "Hash": "110ee9d83b496279960e162ac97764ce"
    },
    "munsell": {
      "Package": "munsell",
      "Version": "0.5.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "colorspace",
        "methods"
      ],
      "Hash": "4fd8900853b746af55b81fda99da7695"
    },
    "nlme": {
      "Package": "nlme",
      "Version": "3.1-166",
      "Source": "Repository",
      "Repository": "CRAN",
      "Requirements": [
        "R",
        "graphics",
        "lattice",
        "stats",
        "utils"
      ],
      "Hash": "ccbb8846be320b627e6aa2b4616a2ded"
    },
    "pillar": {
      "Package": "pillar",
      "Version": "1.9.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "cli",
        "fansi",
        "glue",
        "lifecycle",
        "rlang",
        "utf8",
        "utils",
        "vctrs"
      ],
      "Hash": "15da5a8412f317beeee6175fbc76f4bb"
    },
    "pkgconfig": {
      "Package": "pkgconfig",
      "Version": "2.0.3",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "utils"
      ],
      "Hash": "01f28d4278f15c76cddbea05899c5d6f"
    },
    "rlang": {
      "Package": "rlang",
      "Version": "1.1.4",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "utils"
      ],
      "Hash": "3eec01f8b1dee337674b2e34ab1f9bc1"
    },
    "scales": {
      "Package": "scales",
      "Version": "1.3.0",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "R6",
        "RColorBrewer",
        "cli",
        "farver",
        "glue",
        "labeling",
        "lifecycle",
        "munsell",
        "rlang",
        "viridisLite"
      ],
      "Hash": "c19df082ba346b0ffa6f833e92de34d1"
    },
    "tibble": {
      "Package": "tibble",
      "Version": "3.2.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "fansi",
        "lifecycle",
        "magrittr",
        "methods",
        "pillar",
        "pkgconfig",
        "rlang",
        "utils",
        "vctrs"
      ],
      "Hash": "a84e2cc86d07289b3b6f5069df7a004c"
    },
    "utf8": {
      "Package": "utf8",
      "Version": "1.2.4",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R"
      ],
      "Hash": "62b65c52671e6665f803ff02954446e9"
    },
    "vctrs": {
      "Package": "vctrs",
      "Version": "0.6.5",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "cli",
        "glue",
        "lifecycle",
        "rlang"
      ],
      "Hash": "c03fa420630029418f7e6da3667aac4a"
    },
    "viridisLite": {
      "Package": "viridisLite",
      "Version": "0.4.2",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R"
      ],
      "Hash": "c826c7c4241b6fc89ff55aaea3fa7491"
    },
    "withr": {
      "Package": "withr",
      "Version": "3.0.1",
      "Source": "Repository",
      "Repository": "RSPM",
      "Requirements": [
        "R",
        "grDevices",
        "graphics"
      ],
      "Hash": "07909200e8bbe90426fbfeb73e1e27aa"
    }
  }
}
Dockerfile
# get tidyverse docker from rocker
FROM rocker/r-ver:4.4.2

# system libraries
# Try to only install system libraries you actually need
# Package Manager is a good resource to help discover system deps
RUN apt-get update --yes \
 && apt-get upgrade --yes 

# install R packages required 
RUN R -e 'install.packages("https://packagemanager.posit.co/cran/latest/src/contrib/Archive/renv/renv_1.0.10.tar.gz")'
RUN echo "options(Ncpus = 6, renv.config.pak.enabled = TRUE)" | tee /usr/local/lib/R/etc/Rprofile.site

# Copy renv files 
WORKDIR /testproject
COPY renv.lock renv.lock

RUN mkdir -p renv
COPY .Rprofile .Rprofile
COPY renv/activate.R renv/activate.R
COPY renv/settings.json renv/settings.json

# Restore the R environment
RUN R -e "renv::restore()"

log
30.30 Error: 
30.30 ! error in pak subprocess
30.30 Caused by error: 
30.30 ! Could not solve package dependencies:
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: Platform mismatch
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: Can't install dependency glue
30.30 * glue: Conflicts with [email protected]
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 * [email protected]:
30.30   * Can't install dependency lifecycle (>= 1.0.0) (>= 1.8.1) (>= 0.4.2)
30.30   * Can't install dependency pillar (>= 1.8.1) (>= 0.4.2)
30.30   * Can't install dependency vctrs (>= 0.4.2)
30.30 * lifecycle: Can't install dependency glue
30.30 * pillar: Can't install dependency glue
30.30 * [email protected]: dependency conflict
30.30 * [email protected]: dependency conflict
30.30 ---
30.30 Backtrace:
30.30 1. renv::restore()
30.30 2. renv:::renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclu…
30.30 3. pak$pkg_install(pkg = remotes, ask = prompt, )
30.30 4. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...)…
30.30 5. err$throw(res$error)

I can solve this problem by disabiling pak, but I would like to use pak because it's supposed to be much faster.
I can also solve this problem by updating all packages in my local environment by pak::pak("ggplot2") and renv::snapshot which does the following

# RSPM -----------------------------------------------------------------------
- glue     [1.7.0 -> 1.8.0]
- gtable   [0.3.5 -> 0.3.6]
- withr    [3.0.1 -> 3.0.2]

This is no problem in this toy example. But in my real project, I have a historical scientific project. I would like to build a docker images for this exact enviroment, so using the exact same versions recorded in renv, to ensure reproducibility.

@kevinushey could you maybe help me here? I've found similar issues, especially here #1829. But i didn't find an answer to that problem.

Thanks!

@mihem mihem changed the title dependency error,platform mismatch and conflicts with and can't install dependency errors when renv.config.pak.enabled = TRUE dependency error, platform mismatch and other errors when renv.config.pak.enabled = TRUE Dec 4, 2024
@kevinushey
Copy link
Collaborator

Here's the code renv is trying to run:

remotes <- c(MASS = "[email protected]", Matrix = "[email protected]", R6 = "[email protected]",
RColorBrewer = "[email protected]", cli = "[email protected]", colorspace = "[email protected]",
fansi = "[email protected]", farver = "[email protected]", ggplot2 = "[email protected]",
glue = "[email protected]", gtable = "[email protected]", isoband = "[email protected]",
labeling = "[email protected]", lattice = "[email protected]", lifecycle = "[email protected]",
magrittr = "[email protected]", mgcv = "[email protected]", munsell = "[email protected]",
nlme = "[email protected]", pillar = "[email protected]", pkgconfig = "[email protected]",
rlang = "[email protected]", scales = "[email protected]", tibble = "[email protected]",
utf8 = "[email protected]", vctrs = "[email protected]", viridisLite = "[email protected]",
withr = "[email protected]")
pak::pkg_install(remotes)

For what it's worth, I wasn't able to reproduce locally on macOS:

> options(renv.config.pak.enabled = TRUE); renv::restore(lockfile = "renv.lock", library = tempdir())
The following package(s) will be installed:
- pak [0.7.2]
These packages will be installed into "/private/var/folders/9n/3nxsgkrj0rlfx196kzdttpww0000gn/T/Rtmp9VmNNJ".

Do you want to proceed? [Y/n]: y
# Installing packages --------------------------------------------------------
- Installing pak ...                            OK [copied from cache in 0.36s]
Successfully installed 1 package in 0.37 seconds.Loading metadata database ... doneWill install 23 packages.Will update 1 package.Will download 1 CRAN package (6.17 MB), cached: 20 (21.42 MB).Will download 3 packages with unknown size.
+ cli                  3.6.3 🔧
+ colorspace           2.1-1 🔧
+ fansi                1.0.6 🔧
+ farver               2.1.2 🔧
+ ggplot2              3.5.1
+ glue                 1.7.0 👷🏾‍♀️🔧 ⬇
+ gtable               0.3.5 👷🏾‍♀️ ⬇
+ isoband              0.2.7 🔧
+ labeling             0.4.3
+ lifecycle            1.0.4
+ magrittr             2.0.3 🔧
+ Matrix       1.7-01.7-1 🔧 ⬇ (6.17 MB)
+ munsell              0.5.1
+ pillar               1.9.0
+ pkgconfig            2.0.3
+ R6                   2.5.1
+ RColorBrewer         1.1-3
+ rlang                1.1.4 🔧
+ scales               1.3.0 🔧
+ tibble               3.2.1 🔧
+ utf8                 1.2.4 🔧
+ vctrs                0.6.5 🔧
+ viridisLite          0.4.2
+ withr                3.0.1 👷🏻 ⬇

@mihem
Copy link
Author

mihem commented Dec 4, 2024

@kevinushey Thanks for the fast response.
On my local Linux (Ubuntu-noble) the code you posted fails with the same error as shown in the log, which I posted in my first message.

What about reproducing using the above Dockerfile in combination with the renv.lock? Then you have a fresh ubuntu environment and we don't have any problems reproducing issues across machines? And at the end the rocker/r-ver images or many rstudio/r-base are based on ubuntu, so this is probably a good environment for testing?

Thanks!!

@kevinushey
Copy link
Collaborator

Sorry, but I'm still not able to reproduce. I tried using a modified version of your Dockerfile:

# get tidyverse docker from rocker
FROM rocker/r-ver:4.4.2

# system libraries
# Try to only install system libraries you actually need
# Package Manager is a good resource to help discover system deps
RUN apt-get update --yes \
 && apt-get upgrade --yes 

# install R packages required 
RUN R -e 'install.packages("https://packagemanager.posit.co/cran/latest/src/contrib/Archive/renv/renv_1.0.10.tar.gz")'
RUN echo "options(Ncpus = 6, renv.config.pak.enabled = TRUE)" | tee /usr/local/lib/R/etc/Rprofile.site

# Copy renv files 
WORKDIR /testproject
COPY renv.lock renv.lock

# Restore the R environment
RUN R -e "renv::restore(lockfile = 'renv.lock')"

and it all built successfully.

@mihem
Copy link
Author

mihem commented Dec 6, 2024

@kevinushey thank you for trying to reproduce this issue with my dockerfile.

Wow, I always thought that docker solves the "this does not work on my machine" problem. I used your Dockerfile and still get the same error.

Do you have any idea how I can make this more reproducible for you?

docker_renv_debug-2024-12-06_21.38.37.mp4

@kevinushey
Copy link
Collaborator

That is incredibly odd! Just to rule it out, are we definitely using the same lockfile? I have:

$ sha256sum renv.lock 
e6ca187d53bba5073976f9695c26d6752d0677ee53f851ed6f6dc5eda2de8706  renv.lock

For what it's worth, here's the session info in the container; I assume it must be the same in your case... this is captured using docker build --progress=plain ..

#11 [7/8] RUN R -s -e 'sessionInfo()'
#11 0.163 R version 4.4.2 (2024-10-31)
#11 0.163 Platform: aarch64-unknown-linux-gnu
#11 0.163 Running under: Ubuntu 24.04.1 LTS
#11 0.163 
#11 0.163 Matrix products: default
#11 0.163 BLAS:   /usr/lib/aarch64-linux-gnu/openblas-pthread/libblas.so.3 
#11 0.163 LAPACK: /usr/lib/aarch64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
#11 0.163 
#11 0.163 locale:
#11 0.163  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#11 0.163  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#11 0.163  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#11 0.163  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#11 0.163  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#11 0.163 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#11 0.163 
#11 0.163 time zone: Etc/UTC
#11 0.163 tzcode source: system (glibc)
#11 0.163 
#11 0.163 attached base packages:
#11 0.163 [1] stats     graphics  grDevices utils     datasets  methods   base     
#11 0.163 
#11 0.163 loaded via a namespace (and not attached):
#11 0.163 [1] compiler_4.4.2
#11 DONE 0.2s

And this is the full output I see when invoking renv::restore():

#12 [8/8] RUN R -e "renv::restore(lockfile = 'renv.lock')"
#12 0.131 
#12 0.131 R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
#12 0.131 Copyright (C) 2024 The R Foundation for Statistical Computing
#12 0.131 Platform: aarch64-unknown-linux-gnu
#12 0.131 
#12 0.131 R is free software and comes with ABSOLUTELY NO WARRANTY.
#12 0.131 You are welcome to redistribute it under certain conditions.
#12 0.131 Type 'license()' or 'licence()' for distribution details.
#12 0.131 
#12 0.131   Natural language support but running in an English locale
#12 0.131 
#12 0.131 R is a collaborative project with many contributors.
#12 0.131 Type 'contributors()' for more information and
#12 0.131 'citation()' on how to cite R or R packages in publications.
#12 0.131 
#12 0.131 Type 'demo()' for some demos, 'help()' for on-line help, or
#12 0.131 'help.start()' for an HTML browser interface to help.
#12 0.131 Type 'q()' to quit R.
#12 0.131 
#12 0.179 > renv::restore(lockfile = 'renv.lock')
#12 0.803 # Downloading packages -------------------------------------------------------
#12 0.804 - Downloading pak from r-lib ...                OK [8.4 Mb in 1.2s]
#12 2.240 Successfully downloaded 1 package in 1.6 seconds.
#12 2.240 
#12 2.241 The following package(s) will be installed:
#12 2.241 - pak [0.8.0]
#12 2.241 These packages will be installed into "/usr/local/lib/R/site-library".
#12 2.241 
#12 2.265 # Installing packages --------------------------------------------------------
#12 2.476 - Installing pak ...                            OK [installed binary and cached in 0.35s]
#12 2.741 Successfully installed 1 package in 0.5 seconds.
#12 4.227 
#12 5.458 ✔ Updated metadata database: 2.54 MB in 8 files.
#12 5.459 
#12 5.459 ℹ Updating metadata database
#12 7.769 ✔ Updating metadata database ... done
#12 7.770 
#12 9.217  
#12 9.220 → Will install 23 packages.
#12 9.228 → Will download 6 CRAN packages (5.03 MB).
#12 9.230 → Will download 17 packages with unknown size.
#12 9.233 + cli            3.6.3 [bld][cmp][dl]
#12 9.233 + colorspace     2.1-1 [bld][cmp][dl]
#12 9.233 + fansi          1.0.6 [bld][cmp][dl] (482.48 kB)
#12 9.233 + farver         2.1.2 [bld][cmp][dl] (1.28 MB)
#12 9.233 + ggplot2        3.5.1 [bld][dl]
#12 9.233 + glue           1.7.0 [bld][cmp][dl]
#12 9.233 + gtable         0.3.5 [bld][dl]
#12 9.233 + isoband        0.2.7 [bld][cmp][dl]
#12 9.233 + labeling       0.4.3 [bld][dl]
#12 9.233 + lifecycle      1.0.4 [bld][dl]
#12 9.233 + magrittr       2.0.3 [bld][cmp][dl] (267.07 kB)
#12 9.233 + munsell        0.5.1 [bld][dl]
#12 9.233 + pillar         1.9.0 [bld][dl]
#12 9.233 + pkgconfig      2.0.3 [bld][dl]
#12 9.233 + R6             2.5.1 [bld][dl]
#12 9.233 + RColorBrewer   1.1-3 [bld][dl]
#12 9.233 + rlang          1.1.4 [bld][cmp][dl] (767.04 kB)
#12 9.233 + scales         1.3.0 [bld][cmp][dl]
#12 9.233 + tibble         3.2.1 [bld][cmp][dl]
#12 9.233 + utf8           1.2.4 [bld][cmp][dl]
#12 9.233 + vctrs          0.6.5 [bld][cmp][dl] (969.07 kB)
#12 9.233 + viridisLite    0.4.2 [bld][dl] (1.27 MB)
#12 9.233 + withr          3.0.1 [bld][dl]
#12 9.234   
#12 9.387 ℹ Getting 6 pkgs (5.03 MB) and 17 pkgs with unknown sizes
#12 9.979 ✔ Got R6 2.5.1 (source) (64.11 kB)
#12 10.01 ✔ Got RColorBrewer 1.1-3 (source) (11.70 kB)
#12 10.02 ✔ Got lifecycle 1.0.4 (source) (108.36 kB)
#12 10.07 ✔ Got munsell 0.5.1 (source) (182.94 kB)
#12 10.11 ✔ Got scales 1.3.0 (source) (302.21 kB)
#12 10.16 ✔ Got utf8 1.2.4 (source) (239.71 kB)
#12 10.21 ✔ Got tibble 3.2.1 (source) (565.72 kB)
#12 10.22 ✔ Got fansi 1.0.6 (source) (482.60 kB)
#12 10.33 ✔ Got magrittr 2.0.3 (source) (267.20 kB)
#12 10.34 ✔ Got cli 3.6.3 (source) (566.74 kB)
#12 10.37 ✔ Got rlang 1.1.4 (source) (764.52 kB)
#12 10.38 ✔ Got labeling 0.4.3 (source) (10.26 kB)
#12 10.43 ✔ Got glue 1.7.0 (source) (105.90 kB)
#12 10.44 ✔ Got pillar 1.9.0 (source) (441.98 kB)
#12 10.45 ✔ Got pkgconfig 2.0.3 (source) (6.10 kB)
#12 10.53 ✔ Got vctrs 0.6.5 (source) (967.95 kB)
#12 10.54 ✔ Got withr 3.0.1 (source) (102.51 kB)
#12 10.59 ✔ Got gtable 0.3.5 (source) (132.15 kB)
#12 10.78 ✔ Got farver 2.1.2 (source) (1.27 MB)
#12 10.83 ✔ Got viridisLite 0.4.2 (source) (1.27 MB)
#12 10.99 ✔ Got isoband 0.2.7 (source) (1.59 MB)
#12 11.17 ✔ Got colorspace 2.1-1 (source) (2.14 MB)
#12 11.24 ✔ Got ggplot2 3.5.1 (source) (3.58 MB)
#12 11.27 ℹ Building RColorBrewer 1.1-3
#12 11.40 ℹ Building R6 2.5.1
#12 11.43 ℹ Building labeling 0.4.3
#12 11.52 ℹ Building pkgconfig 2.0.3
#12 11.56 ℹ Building isoband 0.2.7
#12 11.63 ℹ Building colorspace 2.1-1
#12 12.53 ✔ Built pkgconfig 2.0.3 (967ms)
#12 12.56 ℹ Building withr 3.0.1
#12 12.65 ✔ Built R6 2.5.1 (1.2s)
#12 12.66 ✔ Built labeling 0.4.3 (1.2s)
#12 12.67 ℹ Building cli 3.6.3
#12 12.95 ✔ Built RColorBrewer 1.1-3 (1.5s)
#12 12.96 ℹ Building utf8 1.2.4
#12 13.11 ℹ Building rlang 1.1.4
#12 13.69 ✔ Built withr 3.0.1 (1.1s)
#12 13.70 ℹ Building farver 2.1.2
#12 16.07 ✔ Built utf8 1.2.4 (3s)
#12 16.09 ℹ Building viridisLite 0.4.2
#12 16.47 ✔ Built colorspace 2.1-1 (4.6s)
#12 16.48 ℹ Building fansi 1.0.6
#12 16.56 ✔ Built isoband 0.2.7 (4.9s)
#12 16.59 ℹ Building magrittr 2.0.3
#12 17.00 ✔ Built viridisLite 0.4.2 (870ms)
#12 17.01 ℹ Building glue 1.7.0
#12 17.72 ✔ Built magrittr 2.0.3 (1.1s)
#12 17.77 ✔ Installed RColorBrewer 1.1-3  (13ms)
#12 17.80 ✔ Installed R6 2.5.1  (14ms)
#12 18.83 ✔ Installed labeling 0.4.3  (1s)
#12 18.85 ✔ Built glue 1.7.0 (1.8s)
#12 18.88 ✔ Installed pkgconfig 2.0.3  (34ms)
#12 18.90 ✔ Installed isoband 0.2.7  (40ms)
#12 18.95 ✔ Installed colorspace 2.1-1  (45ms)
#12 18.96 ℹ Building munsell 0.5.1
#12 19.05 ✔ Installed withr 3.0.1  (95ms)
#12 19.11 ✔ Installed utf8 1.2.4  (29ms)
#12 19.18 ✔ Installed viridisLite 0.4.2  (26ms)
#12 19.26 ✔ Installed magrittr 2.0.3  (45ms)
#12 19.31 ✔ Installed glue 1.7.0  (17ms)
#12 20.02 ✔ Built munsell 0.5.1 (1s)
#12 20.05 ✔ Installed munsell 0.5.1  (15ms)
#12 20.06 ✔ Built fansi 1.0.6 (3.5s)
#12 20.10 ✔ Installed fansi 1.0.6  (17ms)
#12 20.17 ✔ Built cli 3.6.3 (7.2s)
#12 20.22 ✔ Installed cli 3.6.3  (27ms)
#12 23.09 ✔ Built rlang 1.1.4 (9.8s)
#12 23.14 ✔ Installed rlang 1.1.4  (31ms)
#12 23.14 ℹ Building lifecycle 1.0.4
#12 24.09 ✔ Built lifecycle 1.0.4 (891ms)
#12 24.12 ✔ Installed lifecycle 1.0.4  (15ms)
#12 24.13 ℹ Building gtable 0.3.5
#12 24.26 ℹ Building vctrs 0.6.5
#12 25.32 ✔ Built gtable 0.3.5 (1.2s)
#12 25.35 ✔ Installed gtable 0.3.5  (14ms)
#12 32.00 ✔ Built farver 2.1.2 (18.2s)
#12 32.06 ✔ Installed farver 2.1.2  (44ms)
#12 32.07 ℹ Building scales 1.3.0
#12 34.31 ✔ Built scales 1.3.0 (2.2s)
#12 34.35 ✔ Installed scales 1.3.0  (18ms)
#12 37.11 ✔ Built vctrs 0.6.5 (12.7s)
#12 37.16 ✔ Installed vctrs 0.6.5  (38ms)
#12 37.17 ℹ Building pillar 1.9.0
#12 38.96 ✔ Built pillar 1.9.0 (1.7s)
#12 39.00 ✔ Installed pillar 1.9.0  (20ms)
#12 39.00 ℹ Building tibble 3.2.1
#12 40.73 ✔ Built tibble 3.2.1 (1.6s)
#12 40.77 ✔ Installed tibble 3.2.1  (28ms)
#12 40.78 ℹ Building ggplot2 3.5.1
#12 48.03 ✔ Built ggplot2 3.5.1 (7s)
#12 48.11 ✔ Installed ggplot2 3.5.1  (55ms)
#12 48.12 ✔ 22 pkgs + 6 deps: kept 5, added 23, dld 23 (15.18 MB) [45.4s]
#12 48.12 > 
#12 48.12 > 
#12 DONE 48.2s

#13 exporting to image
#13 exporting layers
#13 exporting layers 0.9s done
#13 writing image sha256:94c2a9e78dff8aa054c803cd814de1674daf07c6d53e0382b3118f20b594c1c4 done
#13 DONE 0.9s

@kevinushey
Copy link
Collaborator

Also, renv::diagnostics() from the container:

#11 [7/7] RUN R -s -e 'renv::diagnostics()'
#11 0.221 Diagnostics Report [renv 1.0.10]
#11 0.221 ================================
#11 0.221 
#11 0.222 # /etc/lsb-release -----------------------------------------------------------
#11 0.222 DISTRIB_ID=Ubuntu
#11 0.222 DISTRIB_RELEASE=24.04
#11 0.222 DISTRIB_CODENAME=noble
#11 0.222 DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
#11 0.222 
#11 0.222 # /etc/os-release ------------------------------------------------------------
#11 0.222 PRETTY_NAME="Ubuntu 24.04.1 LTS"
#11 0.222 NAME="Ubuntu"
#11 0.222 VERSION_ID="24.04"
#11 0.222 VERSION="24.04.1 LTS (Noble Numbat)"
#11 0.222 VERSION_CODENAME=noble
#11 0.222 ID=ubuntu
#11 0.222 ID_LIKE=debian
#11 0.222 HOME_URL="https://www.ubuntu.com/"
#11 0.222 SUPPORT_URL="https://help.ubuntu.com/"
#11 0.222 BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
#11 0.222 PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
#11 0.222 UBUNTU_CODENAME=noble
#11 0.222 LOGO=ubuntu-logo
#11 0.222 
#11 0.222 
#11 0.222 # Session Info ---------------------------------------------------------------
#11 0.224 R version 4.4.2 (2024-10-31)
#11 0.224 Platform: aarch64-unknown-linux-gnu
#11 0.224 Running under: Ubuntu 24.04.1 LTS
#11 0.224 
#11 0.224 Matrix products: default
#11 0.224 BLAS:   /usr/lib/aarch64-linux-gnu/openblas-pthread/libblas.so.3 
#11 0.224 LAPACK: /usr/lib/aarch64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
#11 0.224 
#11 0.224 locale:
#11 0.224  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#11 0.224  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#11 0.224  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#11 0.224  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#11 0.224  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#11 0.224 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#11 0.224 
#11 0.224 time zone: Etc/UTC
#11 0.224 tzcode source: system (glibc)
#11 0.224 
#11 0.224 attached base packages:
#11 0.224 [1] stats     graphics  grDevices utils     datasets  methods   base     
#11 0.224 
#11 0.224 loaded via a namespace (and not attached):
#11 0.224 [1] compiler_4.4.2 tools_4.4.2    renv_1.0.10   
#11 0.224 
#11 0.224 # Project --------------------------------------------------------------------
#11 0.224 Project path: "/testproject"
#11 0.224 
#11 0.224 # Status ---------------------------------------------------------------------
#11 0.226 There are no packages installed in the project library.
#11 0.226 Use `renv::restore()` to install the packages defined in lockfile.
#11 0.226 
#11 0.226 # Packages -------------------------------------------------------------------
#11 0.229 The project library "/testproject/renv/library/linux-ubuntu-noble/R-4.4/aarch64-unknown-linux-gnu" does not exist.
#11 0.292              Library Source Lockfile Source Path Dependency
#11 0.292 KernSmooth   2.23-24   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 MASS          7.3-61   CRAN   7.3-61   CRAN  [2]       <NA>
#11 0.292 Matrix         1.7-1   CRAN    1.7-1   CRAN  [2]       <NA>
#11 0.292 R6              <NA>   <NA>    2.5.1   RSPM <NA>       <NA>
#11 0.292 RColorBrewer    <NA>   <NA>    1.1-3   RSPM <NA>       <NA>
#11 0.292 boot          1.3-31   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 class         7.3-22   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 cli             <NA>   <NA>    3.6.3   RSPM <NA>       <NA>
#11 0.292 cluster        2.1.6   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 codetools     0.2-20   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 colorspace      <NA>   <NA>    2.1-1   RSPM <NA>       <NA>
#11 0.292 docopt         0.7.1   RSPM     <NA>   <NA>  [1]       <NA>
#11 0.292 fansi           <NA>   <NA>    1.0.6   RSPM <NA>       <NA>
#11 0.292 farver          <NA>   <NA>    2.1.2   RSPM <NA>       <NA>
#11 0.292 foreign       0.8-87   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 ggplot2         <NA>   <NA>    3.5.1   RSPM <NA>       <NA>
#11 0.292 glue            <NA>   <NA>    1.7.0   RSPM <NA>       <NA>
#11 0.292 gtable          <NA>   <NA>    0.3.5   RSPM <NA>       <NA>
#11 0.292 isoband         <NA>   <NA>    0.2.7   RSPM <NA>       <NA>
#11 0.292 labeling        <NA>   <NA>    0.4.3   RSPM <NA>       <NA>
#11 0.292 lattice       0.22-6   CRAN   0.22-6   CRAN  [2]       <NA>
#11 0.292 lifecycle       <NA>   <NA>    1.0.4   RSPM <NA>       <NA>
#11 0.292 littler       0.3.20   RSPM     <NA>   <NA>  [1]       <NA>
#11 0.292 magrittr        <NA>   <NA>    2.0.3   RSPM <NA>       <NA>
#11 0.292 mgcv           1.9-1   CRAN    1.9-1   CRAN  [2]       <NA>
#11 0.292 munsell         <NA>   <NA>    0.5.1   RSPM <NA>       <NA>
#11 0.292 nlme         3.1-166   CRAN  3.1-166   CRAN  [2]       <NA>
#11 0.292 nnet          7.3-19   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.292 pillar          <NA>   <NA>    1.9.0   RSPM <NA>       <NA>
#11 0.293 pkgconfig       <NA>   <NA>    2.0.3   RSPM <NA>       <NA>
#11 0.293 renv          1.0.10   RSPM     <NA>   <NA>  [1]     direct
#11 0.293 rlang           <NA>   <NA>    1.1.4   RSPM <NA>       <NA>
#11 0.293 rpart         4.1.23   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.293 scales          <NA>   <NA>    1.3.0   RSPM <NA>       <NA>
#11 0.293 spatial       7.3-17   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.293 survival       3.7-0   CRAN     <NA>   <NA>  [2]       <NA>
#11 0.293 tibble          <NA>   <NA>    3.2.1   RSPM <NA>       <NA>
#11 0.293 utf8            <NA>   <NA>    1.2.4   RSPM <NA>       <NA>
#11 0.293 utils           <NA>   <NA>     <NA>   <NA>  [2]   indirect
#11 0.293 vctrs           <NA>   <NA>    0.6.5   RSPM <NA>       <NA>
#11 0.293 viridisLite     <NA>   <NA>    0.4.2   RSPM <NA>       <NA>
#11 0.293 withr           <NA>   <NA>    3.0.1   RSPM <NA>       <NA>
#11 0.293 
#11 0.293 [1]: /usr/local/lib/R/site-library
#11 0.293 [2]: /usr/local/lib/R/library     
#11 0.293 
#11 0.293 # ABI ------------------------------------------------------------------------
#11 0.415 - No ABI problems were detected in the set of installed packages.
#11 0.415 
#11 0.415 # User Profile ---------------------------------------------------------------
#11 0.415 [no user profile detected]
#11 0.415 
#11 0.415 # Settings -------------------------------------------------------------------
#11 0.416 List of 13
#11 0.416  $ bioconductor.version     : NULL
#11 0.417  $ external.libraries       : chr(0) 
#11 0.417  $ ignored.packages         : chr(0) 
#11 0.417  $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
#11 0.417  $ ppm.enabled              : NULL
#11 0.417  $ ppm.ignored.urls         : NULL
#11 0.418  $ r.version                : NULL
#11 0.418  $ snapshot.type            : chr "implicit"
#11 0.418  $ use.cache                : logi TRUE
#11 0.418  $ vcs.ignore.cellar        : logi TRUE
#11 0.418  $ vcs.ignore.library       : logi TRUE
#11 0.419  $ vcs.ignore.local         : logi TRUE
#11 0.419  $ vcs.manage.ignores       : logi TRUE
#11 0.419 
#11 0.419 # Options --------------------------------------------------------------------
#11 0.420 List of 8
#11 0.420  $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
#11 0.420  $ download.file.method                : NULL
#11 0.420  $ download.file.extra                 : NULL
#11 0.420  $ install.packages.compile.from.source: NULL
#11 0.420  $ pkgType                             : chr "source"
#11 0.421  $ repos                               : Named chr "@CRAN@"
#11 0.421   ..- attr(*, "names")= chr "CRAN"
#11 0.421  $ renv.config.pak.enabled             : logi TRUE
#11 0.421  $ renv.verbose                        : logi TRUE
#11 0.422 
#11 0.422 # Environment Variables ------------------------------------------------------
#11 0.422 HOME        = /root
#11 0.422 LANG        = en_US.UTF-8
#11 0.422 MAKE        = make
#11 0.422 R_LIBS      = /usr/local/lib/R/site-library:/usr/local/lib/R/library
#11 0.422 R_LIBS_SITE = /usr/local/lib/R/site-library
#11 0.422 R_LIBS_USER = /root/R/aarch64-unknown-linux-gnu-library/4.4
#11 0.422 
#11 0.422 # PATH -----------------------------------------------------------------------
#11 0.422 - /usr/local/sbin
#11 0.422 - /usr/local/bin
#11 0.422 - /usr/sbin
#11 0.422 - /usr/bin
#11 0.422 - /sbin
#11 0.422 - /bin
#11 0.422 
#11 0.422 # Cache ----------------------------------------------------------------------
#11 0.423 There are a total of 0 packages installed in the renv cache.
#11 0.424 Cache path: "~/.cache/R/renv/cache/v5/linux-ubuntu-noble/R-4.4/aarch64-unknown-linux-gnu"
#11 0.424 
#11 DONE 0.4s

@mihem
Copy link
Author

mihem commented Dec 7, 2024

@kevinushey . Thanks for digging into this.

Agree, very strange.

Yes, renv.lock has the same sha5sum.

e6ca187d53bba5073976f9695c26d6752d0677ee53f851ed6f6dc5eda2de8706 renv.lock

To be on the safe side, I tried to avoid all caching when running your dockerfile

docker builder prune --all  
docker build . --no-cache --pull -t test --progress=plain
docker log
#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 728B done
#1 DONE 0.0s

#2 [internal] load metadata for docker.io/rocker/r-ver:4.4.2
#2 ...

#3 [auth] rocker/r-ver:pull token for registry-1.docker.io
#3 DONE 0.0s

#2 [internal] load metadata for docker.io/rocker/r-ver:4.4.2
#2 DONE 1.7s

#4 [internal] load .dockerignore
#4 transferring context: 2B done
#4 DONE 0.0s

#5 [1/7] FROM docker.io/rocker/r-ver:4.4.2@sha256:772738e2bee18cdc77464e4636b685dfec8e0c446b1cb9e28417be2ed5a288f8
#5 resolve docker.io/rocker/r-ver:4.4.2@sha256:772738e2bee18cdc77464e4636b685dfec8e0c446b1cb9e28417be2ed5a288f8 0.0s done
#5 ...

#6 [internal] load build context
#6 transferring context: 8.33kB done
#6 DONE 0.1s

#5 [1/7] FROM docker.io/rocker/r-ver:4.4.2@sha256:772738e2bee18cdc77464e4636b685dfec8e0c446b1cb9e28417be2ed5a288f8
#5 sha256:772738e2bee18cdc77464e4636b685dfec8e0c446b1cb9e28417be2ed5a288f8 1.61kB / 1.61kB done
#5 sha256:cc1b89efb544030cfdc197f970f527050f1d3e29070817c1dc4f039ef8aad86c 1.63kB / 1.63kB done
#5 sha256:c2909963ee34211e36b410f7ed10bcc2e2a761139318cd3406a54d71808d3199 6.44kB / 6.44kB done
#5 DONE 0.3s

#7 [2/7] RUN apt-get update --yes  && apt-get upgrade --yes
#7 0.404 Get:1 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
#7 0.414 Get:2 http://archive.ubuntu.com/ubuntu noble InRelease [256 kB]
#7 0.671 Get:3 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages [726 kB]
#7 0.672 Get:4 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
#7 0.720 Get:5 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
#7 0.776 Get:6 http://archive.ubuntu.com/ubuntu noble/restricted amd64 Packages [117 kB]
#7 0.798 Get:7 http://archive.ubuntu.com/ubuntu noble/universe amd64 Packages [19.3 MB]
#7 0.843 Get:8 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Packages [15.3 kB]
#7 0.845 Get:9 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages [627 kB]
#7 0.934 Get:10 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Packages [607 kB]
#7 2.563 Get:11 http://archive.ubuntu.com/ubuntu noble/multiverse amd64 Packages [331 kB]
#7 2.588 Get:12 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages [1,808 kB]
#7 2.720 Get:13 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Packages [19.7 kB]
#7 2.720 Get:14 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Packages [938 kB]
#7 2.790 Get:15 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Packages [628 kB]
#7 2.836 Get:16 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages [858 kB]
#7 2.899 Get:17 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Packages [11.9 kB]
#7 3.470 Fetched 26.6 MB in 3s (8,166 kB/s)
#7 3.470 Reading package lists...
#7 4.284 Reading package lists...
#7 4.971 Building dependency tree...
#7 5.119 Reading state information...
#7 5.182 Calculating upgrade...
#7 5.483 The following packages will be upgraded:
#7 5.483   libacl1 libaudit-common libaudit1 libcurl4t64 libglib2.0-0t64
#7 5.483   libglib2.0-data libgssapi-krb5-2 libk5crypto3 libkrb5-3 libkrb5support0
#7 5.484   libldap2 linux-libc-dev zip
#7 5.665 13 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
#7 5.665 Need to get 4,698 kB of archives.
#7 5.665 After this operation, 0 B of additional disk space will be used.
#7 5.665 Get:1 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libacl1 amd64 2.3.2-1build1.1 [16.8 kB]
#7 5.736 Get:2 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libaudit-common all 1:3.1.2-2.1build1.1 [5,824 B]
#7 5.740 Get:3 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libaudit1 amd64 1:3.1.2-2.1build1.1 [47.0 kB]
#7 5.782 Get:4 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libglib2.0-0t64 amd64 2.80.0-6ubuntu3.2 [1,546 kB]
#7 5.967 Get:5 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libglib2.0-data all 2.80.0-6ubuntu3.2 [48.5 kB]
#7 5.972 Get:6 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libgssapi-krb5-2 amd64 1.20.1-6ubuntu2.2 [143 kB]
#7 5.982 Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libkrb5-3 amd64 1.20.1-6ubuntu2.2 [347 kB]
#7 6.007 Get:8 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libkrb5support0 amd64 1.20.1-6ubuntu2.2 [33.7 kB]
#7 6.009 Get:9 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libk5crypto3 amd64 1.20.1-6ubuntu2.2 [81.8 kB]
#7 6.014 Get:10 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libldap2 amd64 2.6.7+dfsg-1~exp1ubuntu8.1 [195 kB]
#7 6.029 Get:11 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 libcurl4t64 amd64 8.5.0-2ubuntu10.5 [341 kB]
#7 6.054 Get:12 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 linux-libc-dev amd64 6.8.0-49.49 [1,716 kB]
#7 6.179 Get:13 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 zip amd64 3.0-13ubuntu0.1 [176 kB]
#7 6.337 debconf: delaying package configuration, since apt-utils is not installed
#7 6.379 Fetched 4,698 kB in 1s (6,723 kB/s)
(Reading database ... 12362 files and directories currently installed.)
#7 6.438 Preparing to unpack .../libacl1_2.3.2-1build1.1_amd64.deb ...
#7 6.483 Unpacking libacl1:amd64 (2.3.2-1build1.1) over (2.3.2-1build1) ...
#7 6.592 Setting up libacl1:amd64 (2.3.2-1build1.1) ...
(Reading database ... 12362 files and directories currently installed.)
#7 6.685 Preparing to unpack .../libaudit-common_1%3a3.1.2-2.1build1.1_all.deb ...
#7 6.719 Unpacking libaudit-common (1:3.1.2-2.1build1.1) over (1:3.1.2-2.1build1) ...
#7 6.809 Setting up libaudit-common (1:3.1.2-2.1build1.1) ...
(Reading database ... 12362 files and directories currently installed.)
#7 6.925 Preparing to unpack .../libaudit1_1%3a3.1.2-2.1build1.1_amd64.deb ...
#7 6.958 Unpacking libaudit1:amd64 (1:3.1.2-2.1build1.1) over (1:3.1.2-2.1build1) ...
#7 7.055 Setting up libaudit1:amd64 (1:3.1.2-2.1build1.1) ...
(Reading database ... 12362 files and directories currently installed.)
#7 7.178 Preparing to unpack .../0-libglib2.0-0t64_2.80.0-6ubuntu3.2_amd64.deb ...
#7 7.214 Unpacking libglib2.0-0t64:amd64 (2.80.0-6ubuntu3.2) over (2.80.0-6ubuntu3.1) ...
#7 7.380 Preparing to unpack .../1-libglib2.0-data_2.80.0-6ubuntu3.2_all.deb ...
#7 7.413 Unpacking libglib2.0-data (2.80.0-6ubuntu3.2) over (2.80.0-6ubuntu3.1) ...
#7 7.531 Preparing to unpack .../2-libgssapi-krb5-2_1.20.1-6ubuntu2.2_amd64.deb ...
#7 7.571 Unpacking libgssapi-krb5-2:amd64 (1.20.1-6ubuntu2.2) over (1.20.1-6ubuntu2.1) ...
#7 7.710 Preparing to unpack .../3-libkrb5-3_1.20.1-6ubuntu2.2_amd64.deb ...
#7 7.753 Unpacking libkrb5-3:amd64 (1.20.1-6ubuntu2.2) over (1.20.1-6ubuntu2.1) ...
#7 7.899 Preparing to unpack .../4-libkrb5support0_1.20.1-6ubuntu2.2_amd64.deb ...
#7 7.940 Unpacking libkrb5support0:amd64 (1.20.1-6ubuntu2.2) over (1.20.1-6ubuntu2.1) ...
#7 8.072 Preparing to unpack .../5-libk5crypto3_1.20.1-6ubuntu2.2_amd64.deb ...
#7 8.112 Unpacking libk5crypto3:amd64 (1.20.1-6ubuntu2.2) over (1.20.1-6ubuntu2.1) ...
#7 8.235 Preparing to unpack .../6-libldap2_2.6.7+dfsg-1~exp1ubuntu8.1_amd64.deb ...
#7 8.277 Unpacking libldap2:amd64 (2.6.7+dfsg-1~exp1ubuntu8.1) over (2.6.7+dfsg-1~exp1ubuntu8) ...
#7 8.413 Preparing to unpack .../7-libcurl4t64_8.5.0-2ubuntu10.5_amd64.deb ...
#7 8.455 Unpacking libcurl4t64:amd64 (8.5.0-2ubuntu10.5) over (8.5.0-2ubuntu10.4) ...
#7 8.580 Preparing to unpack .../8-linux-libc-dev_6.8.0-49.49_amd64.deb ...
#7 8.619 Unpacking linux-libc-dev:amd64 (6.8.0-49.49) over (6.8.0-48.48) ...
#7 15.08 Preparing to unpack .../9-zip_3.0-13ubuntu0.1_amd64.deb ...
#7 15.12 Unpacking zip (3.0-13ubuntu0.1) over (3.0-13build1) ...
#7 15.23 Setting up linux-libc-dev:amd64 (6.8.0-49.49) ...
#7 15.27 Setting up libkrb5support0:amd64 (1.20.1-6ubuntu2.2) ...
#7 15.30 Setting up zip (3.0-13ubuntu0.1) ...
#7 15.33 Setting up libglib2.0-0t64:amd64 (2.80.0-6ubuntu3.2) ...
#7 15.36 No schema files found: doing nothing.
#7 15.37 Setting up libglib2.0-data (2.80.0-6ubuntu3.2) ...
#7 15.40 Setting up libk5crypto3:amd64 (1.20.1-6ubuntu2.2) ...
#7 15.44 Setting up libkrb5-3:amd64 (1.20.1-6ubuntu2.2) ...
#7 15.47 Setting up libldap2:amd64 (2.6.7+dfsg-1~exp1ubuntu8.1) ...
#7 15.50 Setting up libgssapi-krb5-2:amd64 (1.20.1-6ubuntu2.2) ...
#7 15.53 Setting up libcurl4t64:amd64 (8.5.0-2ubuntu10.5) ...
#7 15.57 Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
#7 DONE 15.7s

#8 [3/7] RUN R -e 'install.packages("https://packagemanager.posit.co/cran/latest/src/contrib/Archive/renv/renv_1.0.10.tar.gz")'
#8 0.288 
#8 0.288 R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
#8 0.288 Copyright (C) 2024 The R Foundation for Statistical Computing
#8 0.288 Platform: x86_64-pc-linux-gnu
#8 0.288 
#8 0.288 R is free software and comes with ABSOLUTELY NO WARRANTY.
#8 0.288 You are welcome to redistribute it under certain conditions.
#8 0.288 Type 'license()' or 'licence()' for distribution details.
#8 0.288 
#8 0.288   Natural language support but running in an English locale
#8 0.288 
#8 0.288 R is a collaborative project with many contributors.
#8 0.288 Type 'contributors()' for more information and
#8 0.288 'citation()' on how to cite R or R packages in publications.
#8 0.288 
#8 0.288 Type 'demo()' for some demos, 'help()' for on-line help, or
#8 0.288 'help.start()' for an HTML browser interface to help.
#8 0.288 Type 'q()' to quit R.
#8 0.288 
#8 0.363 > install.packages("https://packagemanager.posit.co/cran/latest/src/contrib/Archive/renv/renv_1.0.10.tar.gz")
#8 0.366 Installing package into ‘/usr/local/lib/R/site-library’
#8 0.366 (as ‘lib’ is unspecified)
#8 0.366 inferring 'repos = NULL' from 'pkgs'
#8 0.372 trying URL 'https://packagemanager.posit.co/cran/latest/src/contrib/Archive/renv/renv_1.0.10.tar.gz'
#8 1.216 Content type 'binary/octet-stream' length 1200698 bytes (1.1 MB)
#8 1.225 ==================================================
#8 1.430 downloaded 1.1 MB
#8 1.430 
#8 1.892 * installing *source* package ‘renv’ ...
#8 1.907 ** package ‘renv’ successfully unpacked and MD5 sums checked
#8 1.907 ** using staged installation
#8 1.919 ** R
#8 2.005 ** inst
#8 2.012 ** byte-compile and prepare package for lazy loading
#8 9.373 ** libs
#8 9.373 make: Nothing to be done for 'all'.
#8 9.373 ** help
#8 9.487 *** installing help indices
#8 9.578 *** copying figures
#8 9.578 ** building package indices
#8 9.835 ** installing vignettes
#8 9.841 ** testing if installed package can be loaded from temporary location
#8 10.12 ** testing if installed package can be loaded from final location
#8 10.57 ** testing if installed package keeps a record of temporary installation path
#8 10.58 * DONE (renv)
#8 10.60 > 
#8 10.60 > 
#8 DONE 10.6s

#9 [4/7] RUN echo "options(Ncpus = 6, renv.config.pak.enabled = TRUE)" | tee /usr/local/lib/R/etc/Rprofile.site
#9 0.208 options(Ncpus = 6, renv.config.pak.enabled = TRUE)
#9 DONE 0.2s

#10 [5/7] WORKDIR /testproject
#10 DONE 0.1s

#11 [6/7] COPY renv.lock renv.lock
#11 DONE 0.1s

#12 [7/7] RUN R -e "renv::restore(lockfile = 'renv.lock')"
#12 0.299 
#12 0.300 R version 4.4.2 (2024-10-31) -- "Pile of Leaves"
#12 0.300 Copyright (C) 2024 The R Foundation for Statistical Computing
#12 0.300 Platform: x86_64-pc-linux-gnu
#12 0.300 
#12 0.300 R is free software and comes with ABSOLUTELY NO WARRANTY.
#12 0.300 You are welcome to redistribute it under certain conditions.
#12 0.300 Type 'license()' or 'licence()' for distribution details.
#12 0.300 
#12 0.300   Natural language support but running in an English locale
#12 0.300 
#12 0.300 R is a collaborative project with many contributors.
#12 0.300 Type 'contributors()' for more information and
#12 0.300 'citation()' on how to cite R or R packages in publications.
#12 0.300 
#12 0.300 Type 'demo()' for some demos, 'help()' for on-line help, or
#12 0.300 'help.start()' for an HTML browser interface to help.
#12 0.300 Type 'q()' to quit R.
#12 0.300 
#12 0.378 > renv::restore(lockfile = 'renv.lock')
#12 1.258 # Downloading packages -------------------------------------------------------
#12 1.261 - Downloading pak from r-lib ...                OK [7.8 Mb in 1.3s]
#12 2.805 Successfully downloaded 1 package in 1.8 seconds.
#12 2.805 
#12 2.805 The following package(s) will be installed:
#12 2.805 - pak [0.8.0]
#12 2.805 These packages will be installed into "/usr/local/lib/R/site-library".
#12 2.805 
#12 2.806 # Installing packages --------------------------------------------------------
#12 2.997 - Installing pak ...                            OK [installed binary and cached in 0.42s]
#12 3.386 Successfully installed 1 package in 0.58 seconds.
#12 6.133 
#12 8.261 ✔ Updated metadata database: 3.91 MB in 9 files.
#12 8.261 
#12 8.262 ℹ Updating metadata database
#12 12.15 ✔ Updating metadata database ... done
#12 12.15 
#12 17.02 Error: 
#12 17.02 ! error in pak subprocess
#12 17.02 Caused by error: 
#12 17.02 ! Could not solve package dependencies:
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]:
#12 17.02   * Can't install dependency lifecycle (>= 1.0.0) (>= 1.8.1) (>= 0.4.2)
#12 17.02   * Can't install dependency pillar (>= 1.8.1) (>= 0.4.2)
#12 17.02   * Can't install dependency vctrs (>= 0.4.2)
#12 17.02 * lifecycle: Can't install dependency glue
#12 17.02 * glue: Conflicts with [email protected]
#12 17.02 * pillar: Can't install dependency glue
#12 17.02 * vctrs: Can't install dependency glue
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: Platform mismatch
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 * [email protected]: dependency conflict
#12 17.02 ---
#12 17.02 Backtrace:
#12 17.02 1. renv::restore(lockfile = "renv.lock")
#12 17.02 2. renv:::renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclu…
#12 17.02 3. pak$pkg_install(pkg = remotes, ask = prompt, )
#12 17.02 4. pak:::remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...)…
#12 17.02 5. err$throw(res$error)
#12 17.02 ---
#12 17.02 Subprocess backtrace:
#12 17.02 1. base::withCallingHandlers(cli_message = function(msg) { …
#12 17.02 2. get("pkg_install_make_plan", asNamespace("pak"))(...)
#12 17.02 3. prop$stop_for_solution_error()
#12 17.02 4. private$plan$stop_for_solve_error()
#12 17.02 5. pkgdepends:::pkgplan_stop_for_solve_error(self, private)
#12 17.02 6. base::throw(new_error("Could not solve package dependencies:\n", msg, …
#12 17.02 7. | base::signalCondition(cond)
#12 17.02 8. global (function (e) …
#12 17.02 Traceback (most recent calls last):
#12 17.02 6: renv::restore(lockfile = "renv.lock")
#12 17.02 5: renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclude, 
#12 17.02        prompt = prompt, project = project)
#12 17.02 4: pak$pkg_install(pkg = remotes, ask = prompt, )
#12 17.02 3: remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), 
#12 17.02        list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask, 
#12 17.02            start = start, dependencies = dependencies, loaded = loaded_packages(lib)))
#12 17.02 2: err$throw(res$error)
#12 17.02 1: base::stop(cond)
#12 17.02 Execution halted
#12 ERROR: process "/bin/sh -c R -e \"renv::restore(lockfile = 'renv.lock')\"" did not complete successfully: exit code: 1
------
 > [7/7] RUN R -e "renv::restore(lockfile = 'renv.lock')":
17.02 6: renv::restore(lockfile = "renv.lock")
17.02 5: renv_pak_restore(lockfile = lockfile, packages = packages, exclude = exclude, 
17.02        prompt = prompt, project = project)
17.02 4: pak$pkg_install(pkg = remotes, ask = prompt, )
17.02 3: remote(function(...) get("pkg_install_make_plan", asNamespace("pak"))(...), 
17.02        list(pkg = pkg, lib = lib, upgrade = upgrade, ask = ask, 
17.02            start = start, dependencies = dependencies, loaded = loaded_packages(lib)))
17.02 2: err$throw(res$error)
17.02 1: base::stop(cond)
17.02 Execution halted
------
Dockerfile:20
--------------------
  18 |     # Restore the R environment
  19 |     # RUN R -s -e 'renv::diagnostics()'
  20 | >>> RUN R -e "renv::restore(lockfile = 'renv.lock')"
--------------------
ERROR: failed to solve: process "/bin/sh -c R -e \"renv::restore(lockfile = 'renv.lock')\"" did not complete successfully: exit code: 1

View build details: docker-desktop://dashboard/build/default/default/vwapukawlrm312lvhgyvj0wp8

So the same error as before.

and adding RUN R -s -e 'renv::diagnostics()' before RUN R -e "renv::restore(lockfile = 'renv.lock')"

renv diagnostics
#12 [7/8] RUN R -s -e 'renv::diagnostics()'
#12 0.454 Diagnostics Report [renv 1.0.10]
#12 0.454 ================================
#12 0.454 
#12 0.455 # /etc/lsb-release -----------------------------------------------------------
#12 0.463 DISTRIB_ID=Ubuntu
#12 0.463 DISTRIB_RELEASE=24.04
#12 0.463 DISTRIB_CODENAME=noble
#12 0.463 DISTRIB_DESCRIPTION="Ubuntu 24.04.1 LTS"
#12 0.463 
#12 0.463 # /etc/os-release ------------------------------------------------------------
#12 0.463 PRETTY_NAME="Ubuntu 24.04.1 LTS"
#12 0.463 NAME="Ubuntu"
#12 0.463 VERSION_ID="24.04"
#12 0.463 VERSION="24.04.1 LTS (Noble Numbat)"
#12 0.463 VERSION_CODENAME=noble
#12 0.463 ID=ubuntu
#12 0.463 ID_LIKE=debian
#12 0.463 HOME_URL="https://www.ubuntu.com/"
#12 0.463 SUPPORT_URL="https://help.ubuntu.com/"
#12 0.463 BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
#12 0.463 PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
#12 0.463 UBUNTU_CODENAME=noble
#12 0.463 LOGO=ubuntu-logo
#12 0.463 
#12 0.463 
#12 0.463 # Session Info ---------------------------------------------------------------
#12 0.467 R version 4.4.2 (2024-10-31)
#12 0.467 Platform: x86_64-pc-linux-gnu
#12 0.467 Running under: Ubuntu 24.04.1 LTS
#12 0.467 
#12 0.467 Matrix products: default
#12 0.467 BLAS:   /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3 
#12 0.467 LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so;  LAPACK version 3.12.0
#12 0.467 
#12 0.467 locale:
#12 0.467  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
#12 0.467  [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
#12 0.467  [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
#12 0.467  [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
#12 0.467  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#12 0.467 [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       
#12 0.467 
#12 0.467 time zone: Etc/UTC
#12 0.467 tzcode source: system (glibc)
#12 0.467 
#12 0.467 attached base packages:
#12 0.467 [1] stats     graphics  grDevices utils     datasets  methods   base     
#12 0.467 
#12 0.467 loaded via a namespace (and not attached):
#12 0.467 [1] compiler_4.4.2 tools_4.4.2    renv_1.0.10   
#12 0.467 
#12 0.468 # Project --------------------------------------------------------------------
#12 0.468 Project path: "/testproject"
#12 0.468 
#12 0.468 # Status ---------------------------------------------------------------------
#12 0.470 There are no packages installed in the project library.
#12 0.470 Use `renv::restore()` to install the packages defined in lockfile.
#12 0.470 
#12 0.470 # Packages -------------------------------------------------------------------
#12 0.475 The project library "/testproject/renv/library/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu" does not exist.
#12 0.604              Library Source Lockfile Source Path Dependency
#12 0.604 KernSmooth   2.23-24   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 MASS          7.3-61   CRAN   7.3-61   CRAN  [2]       <NA>
#12 0.604 Matrix         1.7-1   CRAN    1.7-1   CRAN  [2]       <NA>
#12 0.604 R6              <NA>   <NA>    2.5.1   RSPM <NA>       <NA>
#12 0.604 RColorBrewer    <NA>   <NA>    1.1-3   RSPM <NA>       <NA>
#12 0.604 boot          1.3-31   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 class         7.3-22   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 cli             <NA>   <NA>    3.6.3   RSPM <NA>       <NA>
#12 0.604 cluster        2.1.6   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 codetools     0.2-20   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 colorspace      <NA>   <NA>    2.1-1   RSPM <NA>       <NA>
#12 0.604 docopt         0.7.1   RSPM     <NA>   <NA>  [1]       <NA>
#12 0.604 fansi           <NA>   <NA>    1.0.6   RSPM <NA>       <NA>
#12 0.604 farver          <NA>   <NA>    2.1.2   RSPM <NA>       <NA>
#12 0.604 foreign       0.8-87   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 ggplot2         <NA>   <NA>    3.5.1   RSPM <NA>       <NA>
#12 0.604 glue            <NA>   <NA>    1.7.0   RSPM <NA>       <NA>
#12 0.604 gtable          <NA>   <NA>    0.3.5   RSPM <NA>       <NA>
#12 0.604 isoband         <NA>   <NA>    0.2.7   RSPM <NA>       <NA>
#12 0.604 labeling        <NA>   <NA>    0.4.3   RSPM <NA>       <NA>
#12 0.604 lattice       0.22-6   CRAN   0.22-6   CRAN  [2]       <NA>
#12 0.604 lifecycle       <NA>   <NA>    1.0.4   RSPM <NA>       <NA>
#12 0.604 littler       0.3.20   RSPM     <NA>   <NA>  [1]       <NA>
#12 0.604 magrittr        <NA>   <NA>    2.0.3   RSPM <NA>       <NA>
#12 0.604 mgcv           1.9-1   CRAN    1.9-1   CRAN  [2]       <NA>
#12 0.604 munsell         <NA>   <NA>    0.5.1   RSPM <NA>       <NA>
#12 0.604 nlme         3.1-166   CRAN  3.1-166   CRAN  [2]       <NA>
#12 0.604 nnet          7.3-19   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 pillar          <NA>   <NA>    1.9.0   RSPM <NA>       <NA>
#12 0.604 pkgconfig       <NA>   <NA>    2.0.3   RSPM <NA>       <NA>
#12 0.604 renv          1.0.10   RSPM     <NA>   <NA>  [1]     direct
#12 0.604 rlang           <NA>   <NA>    1.1.4   RSPM <NA>       <NA>
#12 0.604 rpart         4.1.23   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 scales          <NA>   <NA>    1.3.0   RSPM <NA>       <NA>
#12 0.604 spatial       7.3-17   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 survival       3.7-0   CRAN     <NA>   <NA>  [2]       <NA>
#12 0.604 tibble          <NA>   <NA>    3.2.1   RSPM <NA>       <NA>
#12 0.604 utf8            <NA>   <NA>    1.2.4   RSPM <NA>       <NA>
#12 0.604 utils           <NA>   <NA>     <NA>   <NA>  [2]   indirect
#12 0.604 vctrs           <NA>   <NA>    0.6.5   RSPM <NA>       <NA>
#12 0.604 viridisLite     <NA>   <NA>    0.4.2   RSPM <NA>       <NA>
#12 0.604 withr           <NA>   <NA>    3.0.1   RSPM <NA>       <NA>
#12 0.604 
#12 0.605 [1]: /usr/local/lib/R/site-library
#12 0.605 [2]: /usr/local/lib/R/library     
#12 0.605 
#12 0.605 # ABI ------------------------------------------------------------------------
#12 0.836 - No ABI problems were detected in the set of installed packages.
#12 0.836 
#12 0.836 # User Profile ---------------------------------------------------------------
#12 0.836 [no user profile detected]
#12 0.836 
#12 0.836 # Settings -------------------------------------------------------------------
#12 0.839 List of 13
#12 0.839  $ bioconductor.version     : NULL
#12 0.839  $ external.libraries       : chr(0) 
#12 0.840  $ ignored.packages         : chr(0) 
#12 0.840  $ package.dependency.fields: chr [1:3] "Imports" "Depends" "LinkingTo"
#12 0.841  $ ppm.enabled              : NULL
#12 0.841  $ ppm.ignored.urls         : NULL
#12 0.842  $ r.version                : NULL
#12 0.842  $ snapshot.type            : chr "implicit"
#12 0.842  $ use.cache                : logi TRUE
#12 0.843  $ vcs.ignore.cellar        : logi TRUE
#12 0.844  $ vcs.ignore.library       : logi TRUE
#12 0.845  $ vcs.ignore.local         : logi TRUE
#12 0.845  $ vcs.manage.ignores       : logi TRUE
#12 0.846 
#12 0.846 # Options --------------------------------------------------------------------
#12 0.846 List of 8
#12 0.846  $ defaultPackages                     : chr [1:6] "datasets" "utils" "grDevices" "graphics" ...
#12 0.847  $ download.file.method                : NULL
#12 0.847  $ download.file.extra                 : NULL
#12 0.848  $ install.packages.compile.from.source: NULL
#12 0.848  $ pkgType                             : chr "source"
#12 0.849  $ repos                               : Named chr "@CRAN@"
#12 0.849   ..- attr(*, "names")= chr "CRAN"
#12 0.850  $ renv.config.pak.enabled             : logi TRUE
#12 0.850  $ renv.verbose                        : logi TRUE
#12 0.851 
#12 0.851 # Environment Variables ------------------------------------------------------
#12 0.851 HOME        = /root
#12 0.851 LANG        = en_US.UTF-8
#12 0.851 MAKE        = make
#12 0.851 R_LIBS      = /usr/local/lib/R/site-library:/usr/local/lib/R/library
#12 0.851 R_LIBS_SITE = /usr/local/lib/R/site-library
#12 0.851 R_LIBS_USER = /root/R/x86_64-pc-linux-gnu-library/4.4
#12 0.851 
#12 0.851 # PATH -----------------------------------------------------------------------
#12 0.851 - /usr/local/sbin
#12 0.851 - /usr/local/bin
#12 0.851 - /usr/sbin
#12 0.851 - /usr/bin
#12 0.851 - /sbin
#12 0.851 - /bin
#12 0.851 
#12 0.851 # Cache ----------------------------------------------------------------------
#12 0.853 There are a total of 0 packages installed in the renv cache.
#12 0.854 Cache path: "~/.cache/R/renv/cache/v5/linux-ubuntu-noble/R-4.4/x86_64-pc-linux-gnu"
#12 0.854 
#12 DONE 0.9s

I think this is the same as your diagnostics so really do not understand where the bug is.

@mihem
Copy link
Author

mihem commented Dec 7, 2024

@kevinushey To further debug this, i created a github repo: https://github.com/mihem/docker_renv_pak_debug

To make it more reproducible, I created a github workflow to build the docker image via GitHub Actions.
This failed with the same error that I reported: https://github.com/mihem/docker_renv_pak_debug/actions/runs/12213657191/job/34073511323

I am happy that I can reproduce this not only on my local machine. I tried to add mac-os to ubuntu-latest, but there seems to be a licensing problem with mac os and docker. So I cannot reproduce your successful building. But I hope this helps you to further debug this issue.

@kevinushey
Copy link
Collaborator

kevinushey commented Dec 7, 2024

One possibility is that it works on my machine because I'm using an aarch64 machine, not an x86_64 one... I'll see if I can reproduce later on an x86_64 machine next. (That could also affect what packages PPM would report as being available, I suspect?)

@mihem
Copy link
Author

mihem commented Dec 8, 2024

Ah, I missed that details in rev diagnostics, so yes maybe you are right, it's because of arm64.
I thought that I could also test it using GitHub Actions. I saw that pak is using both an x86_64 and an arm64 runner. https://github.com/r-lib/pak/blob/main/.github/workflows/linux-builder-containers.yaml

However, this did not work. It's only available to Team or Enterprise users. But since x86_64 is still the default, I think this should not be too hard to find some machine to debug this? Excited what you'll find out. Also happy to help with debuggin on my machine.

@remlapmot
Copy link
Contributor

You can run most x86_64 images on Apple Silicon Macs by explicitly requesting that architecture with the --platform linux/amd64 flag to docker build (the rocker images have been multi-platform for a while, which is why you're getting the arm version of those by default on Apple Silicon Macs). In Docker Desktop settings it's more reliable to use the Apple Virtualization Framework (and enable using Rosetta as that's much faster. There are some rare edge cases which I have seen fail under this emulation like building an old version of arrow from source - but most things seem to work now).

Image

docker build . --platform linux/amd64 --no-cache --pull -t test --progress=plain

@kevinushey
Copy link
Collaborator

Thanks -- I was able to reproduce the issue on my x86_64 machine. I suspect the issue here arises because renv is trying to use package manager binaries. Here's what I see active when pak::pkg_install() is invoked:

Browse[1]> getOption("repos")
                                                         CRAN
"https://packagemanager.posit.co/cran/__linux__/noble/latest"

And indeed, I can reproduce the same error with:

options(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/noble/latest"))

remotes <- c(
  MASS         = "[email protected]",
  Matrix       = "[email protected]",
  R6           = "[email protected]",
  RColorBrewer = "[email protected]",
  cli          = "[email protected]",
  colorspace   = "[email protected]",
  fansi        = "[email protected]",
  farver       = "[email protected]",
  ggplot2      = "[email protected]",
  glue         = "[email protected]",
  gtable       = "[email protected]",
  isoband      = "[email protected]",
  labeling     = "[email protected]",
  lattice      = "[email protected]",
  lifecycle    = "[email protected]",
  magrittr     = "[email protected]",
  mgcv         = "[email protected]",
  munsell      = "[email protected]",
  nlme         = "[email protected]",
  pillar       = "[email protected]",
  pkgconfig    = "[email protected]",
  rlang        = "[email protected]",
  scales       = "[email protected]",
  tibble       = "[email protected]",
  utf8         = "[email protected]",
  vctrs        = "[email protected]",
  viridisLite  = "[email protected]",
  withr        = "[email protected]"
)

pak::pkg_install(remotes)

As a workaround, you can request that renv not use PPM's binary repository with:

options(renv.config.ppm.enabled = FALSE)

In this scenario, pak is able to successfully resolve dependencies and no issue occurs.

@mihem
Copy link
Author

mihem commented Dec 9, 2024

@kevinushey great that you could reproduce the problem. I agree this workaround sucessfully resolves the dependencies. However, my use case is that i have a project with lots of packages in renv.lock which take ~60min to download and ~90min to builld (using PPM). I would like to reduce that time as much as possible. One idea that you recommended to speed up renv::restore was to use pak. If I don't use PPM then building time will be much longer, outweighing the time that I hopefully win using pak.
So if this could be further debugged in a way that renv and PPM work together, this would be great.

@remlapmot Thanks, did not know that. But does that also mean that I can just use platform ---linux/arm64?
I tried running

docker build . --no-cache --pull -t test --progress=plain --platform linux/arm64

on my x86 machine using this dockerfile https://github.com/mihem/docker_renv_pak_debug .

But this failed with

> [2/8] RUN apt-get update --yes  && apt-get upgrade --yes:
0.189 exec /bin/sh: exec format error
------
Dockerfile:7
--------------------
   6 |     # Package Manager is a good resource to help discover system deps
   7 | >>> RUN apt-get update --yes \
   8 | >>>  && apt-get upgrade --yes 
   9 |     
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update --yes  && apt-get upgrade --yes" did not complete successfully: exit code: 255

If that would work, this could be a better workaround that not using binaries, I think.

@remlapmot
Copy link
Contributor

I don't really see what building an arm64 image would benefit you (unless your target machine is actually arm).

I believe that you can build arm64 images under x86_64 Docker. However I guess there are lots of edge cases where that emulation fails and it will be probably be very slow. It's most reliably done through a call to docker buildx ..., e.g.

docker buildx build --pull --platform linux/arm64,linux/amd64 .

But RSPM/PPPM doesn't have Linux ARM binary packages, so all the packages would be built from source in the ARM image.

If you want the fastest Linux build possible I'd stick to amd64 and use a combination of package versions that you know that pak can resolve. In my experience the easiest way to choose such a version combination is to take all packages from a specific date on CRAN by setting pak to use a PPPM snapshot date. See https://pak.r-lib.org/reference/get-started.html?q=pak::repo_add#time-travel-using-rspm, so e.g., call pak::repo_add(CRAN = "RSPM@2024-12-10") before calling renv::install(), and then I think it likely pak will find binary packages on RSPM from that date.

@mihem
Copy link
Author

mihem commented Dec 11, 2024

@remlapmot Thanks! Well since kevin reported that this worked with arm64, while i did not work with x86, I had hoped that i could just specify the platform and build it on my x86 machine. Same error when using docker buildx build.
But I agree, same problem as before, I definitely want to avoid building from source.

Yes, I want the fasted Linux build possible. But I want to restore my historic academic project with the exact versions that are given in renv. Otherwise I am worried that this is not compatible with my script or even lead to different results. And since the results are already published, I would like to keep everything as it is. Just freeze it (as renv does), but including system libraries.
I think if you specify a date with a specifc PPM snapshot, then this would not get all the exact versions from renv.lock, right?
Also

pak::repo_add(CRAN = "RSPM@2024-12-10")

fails with

Error: 
! error in pak subprocess
Caused by error in `repo_sugar_ppm(x, nm)`:
! Cannot find matching PPM snapshot for 2024-12-10

This only works with dates till January 2024 or so.

@mihem
Copy link
Author

mihem commented Dec 11, 2024

Okay sorry, I was wrong about the last problem, I could resolve this. So pak::repo_add(CRAN = "RSPM@2024-12-10") works fine, but it still leds to the dependency conflicts as before, because I call renv::restore and this probably has higher priority then? But yeah, the main problem is that I want the exact versions from renv.lock anyway.

@kevinushey
Copy link
Collaborator

For what it's worth, I only mentioned arm64 because I was working on my M1 macOS machine, with an aarch64 Linux virtual machine therein. It seems like pak has some kind of difference in how it resolves dependencies when using binary packages from Posit Package Manager, which seems to lead to this issue. (I could be wrong, though.)

Ultimately, this is either an issue in pak, or in how renv is invoking pak. @gaborcsardi, do you have any advice?

@gaborcsardi
Copy link

Isn't this r-lib/pak#724?

@kevinushey
Copy link
Collaborator

It is, but I wasn't sure if renv was doing something wrong here or if it might be a real issue in pak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants