From 4757abc006269036143ff20a7a7eac6f5a2fdfd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABlle=20Salmon?= Date: Fri, 14 Feb 2025 15:23:50 +0100 Subject: [PATCH] document `config.json` (#88) --- publish/troubleshoot-build.qmd | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/publish/troubleshoot-build.qmd b/publish/troubleshoot-build.qmd index f5ade18..fff0979 100644 --- a/publish/troubleshoot-build.qmd +++ b/publish/troubleshoot-build.qmd @@ -11,12 +11,26 @@ title: "Trouble shoot package builds" ## Can the package build process be customized with custom options/tools/variables? -No, customization is not possible, except for addressing third-party system requirements (covered in the next section). +No, customization is overall not possible, except for addressing third-party system requirements (covered in the next two sections). Think of R-universe as your own mini-CRAN. The build environment is very similar to CRAN's, so if a package builds successfully on CRAN, it is likely to work on R-universe. This restriction ensures that packages deployed on R-universe are reproducible, work seamlessly on user machines, and do not rely on custom settings or tools. +## Configure some options with `config.json` + +You can create a `config.json` file alongside your `packages.json` file to set some global options. + +Currently the only option is `cran_version` which has to be a `yyyy-mm-dd` string and will use dependencies from a certain p3m snapshot date, for example: https://github.com/r-multiverse/staging/blob/main/config.json + +```json +{ + "cran_version": "2025-01-15" +} +``` + +This will set `options(repos = c(CRAN = "https://p3m.dev/cran/2025-01-15"))` + ## What if the Git repository is not a ready-to-build source package? For repositories requiring additional preparation before building, you can add a [script](https://github.com/r-universe-org/build-source/blob/5830b8aa92d5524b3af6d1b617e605d1a2558543/entrypoint.sh#L50-L57) at the root of the package: