Building CRAN binaries for rpkgs.com
  • R 77.4%
  • Shell 8.6%
  • TypeScript 7%
  • HCL 3.5%
  • Just 1.8%
  • Other 1.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-05-29 21:10:00 +02:00
.editorconfig linters 2024-05-29 19:53:38 +02:00
.markdownlint.yaml linters 2024-05-29 19:53:38 +02:00
.prettierrc.json linters 2024-05-29 19:53:38 +02:00
00-run.sh save state 2024-05-29 19:52:07 +02:00
01-prepare.sh save state 2024-05-29 19:52:07 +02:00
02-build-binaries.sh cleanup packages with renaming failures 2024-05-29 20:18:30 +02:00
03-upload.sh don't upload sources 2024-05-29 21:09:53 +02:00
04-create-archive-rds.sh save state 2024-05-29 19:52:07 +02:00
README.md doc 2024-05-29 21:10:00 +02:00

README

Workflow

  1. 01-prepare.sh
    1. Install R interpreter
    2. Add required repos to resolve syslibs
    3. Install pak
    4. Install awscli for remote s3 sync
  2. 02-build-binaries.sh
    1. For every package, do
      1. Clone from GitHub CRAN mirror
      2. Install all system dependencies via pak::local_install_dev_deps()
      3. Checkout each available tag
      4. Build source package
      5. Build binary package
      6. Create Archive/ directory
      7. Move all versions besides the most recent one to Archive/ (for source and binary)
      8. Create PACKAGES metadata file using cranlike package
  3. 03-upload.sh
    1. Sync all binaries and sources to S3 bucket
  4. -4-create-archive-rds.sh
    1. Create Meta/archive.rds file for each package so that remotes::install_version() can install archived versions
    2. Upload Meta/archive.rds to S3 bucket

Support for archived versions

remotes::install_version()

remotes::install_version() is searching for a Meta/archive.rds file in the /src/contrib directory. This file must be a list of dataframes containing the information about the archived versions of the package.

Example:


con <- gzcon(url(sprintf("%s/src/contrib/Meta/archive.rds",
                           c("CRAN" = "https://cloud.r-project.org")), "rb"))
foo = readRDS(con)
foo[[1]]

pak::pak(package@version)

pak searches for Archive/<package> and is able to install all versions existing there. Ensure to use a clean cache if other repos have been used before, i.e. call pak::meta_clean(force = TRUE) if in doubt or when testing.

Lessons learned

  • Newer R versions have issues compiling C code from older package Versions. Using an older R version to build the binaries is recommended.
  • R 4.0.5 is used to build all binaries for R 4.x
  • Binaries which cannot be built using R 4.0.5 often also require older system library or compiler versions and are out of scope for this project.