Building CRAN binaries for rpkgs.com
- R 77.4%
- Shell 8.6%
- TypeScript 7%
- HCL 3.5%
- Just 1.8%
- Other 1.7%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| docker | ||
| R | ||
| .editorconfig | ||
| .gitignore | ||
| .markdownlint.yaml | ||
| .prettierrc.json | ||
| .Rbuildignore | ||
| 00-run.sh | ||
| 01-prepare.sh | ||
| 02-build-binaries.sh | ||
| 03-upload.sh | ||
| 04-create-archive-rds.sh | ||
| 05-get-updated-cran-pkgs.R | ||
| DESCRIPTION | ||
| exec.sh | ||
| Justfile | ||
| NAMESPACE | ||
| rBinaries.Rproj | ||
| README.md | ||
README
Workflow
- "Prepare"
- Install R interpreter
- Add required repos to resolve syslibs
- Install pak
- Install awscli for remote s3 sync
- "Build"
- For every package, do
- Clone from GitHub CRAN mirror
- Install all system dependencies via
pak::local_install_dev_deps() - Checkout each available tag
- Build binary package
- Create Archive/ directory
- Move all versions besides the most recent one to Archive/ (for source and binary)
- Create
PACKAGESmetadata file usingcranlikepackage - Store build metadata in sqlite DB
- For every package, do
- "Upload"
- Sync all binaries and sources to S3 bucket
-4-create-archive-rds.sh- Create
Meta/archive.rdsfile for each package so thatremotes::install_version()can install archived versions - Upload
Meta/archive.rdsto S3 bucket
- Create
Build metadata
The build metadata is stored in a sqlite database. The following tables are used:
metadatacontains the build metadata for each package:
| package_name | tag | platform | error_occurred | build_timestamp |
|---|
metadata_summarycontains aggregated build metadata for each package and platform:
| package_name | platform | successful_builds | unsuccessful_builds | total_builds | percentage_successful_builds | average_build_time_per_tag |
|---|
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.
Platforms
The following platforms are supported:
- RHEL9
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.