From 70753ebaedaee450bde7d79d773bb2ac8cf84748 Mon Sep 17 00:00:00 2001 From: pat-s Date: Wed, 29 May 2024 19:48:39 +0200 Subject: [PATCH] add README --- README.md | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..f12f3e9 --- /dev/null +++ b/README.md @@ -0,0 +1,50 @@ +# 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: + +```r + +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/` 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.