Skip to content

Commit

Permalink
document config.json (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle authored Feb 14, 2025
1 parent 17e8b5d commit 4757abc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion publish/troubleshoot-build.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 4757abc

Please sign in to comment.