Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,13 @@ pub fn get_platform(args: &ArgMatches) -> Result<String, Box<dyn Error>> {
if os == "linux" {
let dist = detect_platform()?;
if let (Some(distro), Some(version)) = (dist.distro, dist.version) {
os = format!("linux-{}-{}", distro, version);
// Amazon Linux 2023 is RHEL 9-compatible; the r-hub API
// doesn't know about amzn so we resolve against rhel-9.
if distro == "amzn" && version == "2023" {
os = "linux-rhel-9".to_string();
} else {
os = format!("linux-{}-{}", distro, version);
}
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions src/data/repos.json
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@
"x86_64",
"aarch64"
]
},
{
"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.

"platforms": [
"*-linux-gnu-amzn-*"
],
"archs": [
"x86_64",
"aarch64"
],
"enabled": true
}
]
},
Expand Down
8 changes: 8 additions & 0 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,14 @@ fn select_linux_tools(platform: &OsVersion) -> Result<LinuxTools, Box<dyn Error>
is_installed: strvec!["rpm", "-q", "{}"],
delete: strvec!["zypper", "remove", "-y", "{}"],
})
} else if platform.distro.as_deref() == Some("amzn") {
Ok(LinuxTools {
package_name: "R-{}".to_string(),
install: vec![strvec!["dnf", "install", "-y", "{}"]],
get_package_name: strvec!["rpm", "-q", "--qf", "%{NAME}", "-p", "{}"],
is_installed: strvec!["rpm", "-q", "{}"],
delete: strvec!["dnf", "remove", "-y", "{}"],
})
} else if platform.distro.as_deref() == Some("fedora") {
Ok(LinuxTools {
package_name: "R-{}".to_string(),
Expand Down
Loading