Skip to content

feat(r-packages)!: install system requirements in two phases by default - #286

Merged
eitsupi merged 2 commits into
mainfrom
r-packages-v2
Oct 22, 2026
Merged

eitsupi merged 2 commits into
mainfrom
r-packages-v2

Conversation

@eitsupi

@eitsupi eitsupi commented Oct 22, 2026

Copy link
Copy Markdown
Member

Follow-up of #284. Applies the same system requirements installation as r-rig v2 to the r-packages Feature (v2.0.0, breaking change).

Changes

  • installSystemRequirements now defaults to true.
  • System requirements are installed in two phases, so that it does not depend on sudo being available at build time:
    1. The user runs pak::pkg_sysreqs() (after pak::repo_add()) and writes the install commands into a user-owned temporary directory.
      The build fails if this step fails.
    2. Root copies the commands to a root-owned file and runs them.
      The commands are generated by pak for the platform, so non-apt platforms supported by pak keep working.
    3. The user installs the R packages with PKG_SYSREQS=false, then runs pak::cache_clean() and pak::meta_clean(force = TRUE).
  • The R code is run from script files, and the environment variables (NOT_CRAN, PKG_CRAN_MIRROR, etc.) are set explicitly in the su command.
    additionalRepositories is passed to R via a root-owned file to avoid quoting problems.
  • Temporary directories are created with mktemp -d and removed on exit.
  • NOTES.md is updated, including a migration guide from v1.
  • New test scenarios for the default (sysreqs on) with a non-root user and for installSystemRequirements: false.

- `installSystemRequirements` now defaults to `true`
- System requirements are installed by root with the commands generated by
  `pak::pkg_sysreqs()` run as the user, so that it does not depend on `sudo` at build time
- R packages are installed by the user with `PKG_SYSREQS=false`
- Use randomly named temporary directories and remove them on exit
pak no longer works on CentOS 7 (glibc 2.17).
@eitsupi
eitsupi marked this pull request as ready for review October 22, 2026 04:23
@eitsupi
eitsupi merged commit 6b8fe09 into main Oct 22, 2026
19 of 25 checks passed
@eitsupi
eitsupi deleted the r-packages-v2 branch October 22, 2026 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant