Skip to content

feat: Add Amazon Linux 2023 support#322

Open
grantmcdermott wants to merge 2 commits into
r-lib:mainfrom
grantmcdermott:al2023
Open

feat: Add Amazon Linux 2023 support#322
grantmcdermott wants to merge 2 commits into
r-lib:mainfrom
grantmcdermott:al2023

Conversation

@grantmcdermott

@grantmcdermott grantmcdermott commented Apr 2, 2026

Copy link
Copy Markdown

Closes #311

Adds AL2023 as a supported distro. The RHEL 9 R builds from Posit are binary-compatible with AL2023, so this maps the platform for version resolution while keeping AL2023 as its own distro for install tooling and repo setup. As discussed in #311 (comment), this uses the P3M "manylinux" binary repo, rather than distro-specific RHEL 9 PPM binaries, to avoid the EPEL dependency problem.

Changes

  • src/common.rs: Map linux-amzn-2023 to linux-rhel-9 for the r-hub API version resolution
  • src/linux.rs: Add "amzn" branch in select_linux_tools() with simple dnf install, no EPEL
  • src/data/repos.json: Enable P3M-manylinux (manylinux_2_28) binaries for "amzn" on both x86_64 and aarch64

Testing

Tested on amazonlinux:2023 (aarch64) in Docker:

docker run -it --rm --privileged -v $(pwd):/work amazonlinux:2023 bash
dnf install -y /work/r-rig-0.8.00.1.2.rpm

After setup:

$ rig system detect-platform
Distribution: amzn
Version:      2023

$ rig resolve release
4.5.3 https://cdn.posit.co/r/rhel-9/pkgs/R-4.5.3-1-1.aarch64.rpm

$ rig add release
[INFO] Running "dnf install -y /tmp/rig/R-4.5.3-1-1.aarch64.rpm"
[INFO] Installing pak for R 4.5.3

Start R

R

P3M manylinux repo is configured automatically, and installing R packages correctly pulls in binaries, e.g.:

> getOption('repos')
P3M  https://packagemanager.posit.co/cran/__linux__/manylinux_2_28/latest

> install.packages('magick')
* installing *binary* package 'magick' ...
* DONE (magick)

> library(magick)
Linking to ImageMagick 6.9.13.25
Enabled features: cairo, fontconfig, freetype, ghostscript, lcms, pango, raw, rsvg, webp, x11

> install.packages('tidyverse')
# all deps install as *binary*

P.S. Some R packages with heavy system library dependencies (e.g. sf) don't have manylinux binaries (only on aarch64?) yet and will fall back to source compilation. But this is a PPM coverage gap, not a rig issue. (E.g., See amazonlinux/amazon-linux-2023#129 (comment))

Add AL2023 as a supported distro, resolving r-lib#311. Changes:

- Map amzn/2023 to rhel-9 for R version resolution (common.rs)
- Add amzn install tooling with simple dnf install (linux.rs)
- Enable P3M manylinux_2_28 binaries for amzn (repos.json)

Closes r-lib#311
@grantmcdermott

Copy link
Copy Markdown
Author

Some of the CI runs are failing, but AFAICT these are pre-existing issues (e.g. broken bats install on macOS, fedora-41 aarch64) unrelated to this PR.

@grantmcdermott

Copy link
Copy Markdown
Author

Rebased from main and the CI is (mostly) green.

@gaborcsardi am I correct that the six redhat/ubi failures are due to a missing secrets envvar passing for fork-based PRs? Either way, I would appreciate your thoughts if/when you get a chance, especially on the repos.json approach (option 4A from #311). No pressure, but thanks in advance!

Comment thread src/data/repos.json
},
{
"name": "P3M",
"url": "https://packagemanager.posit.co/cran/__linux__/manylinux_2_28/latest",

@gaborcsardi gaborcsardi May 15, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why manylinux, if there is a native rhel 9 repo?

Also, is this even needed if detect_platform() returns linux-rhel-9 for Amazon Linux 2023?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the P3M linux-rhel-9 target doesn't support (consistent) system binaries reconciliation for AL2023. At least, that's my understanding based on the manylinux announcement post.

Broad Linux support: Portable binary packages should be compatible with more Linux distributions than we currently support, such as Amazon Linux 2023.

Happy to revert if you think I'm confusing separate issues.

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.

Add AmazonLinux-2023 as alias for RHEL-9

2 participants