Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-44114: [R] Add Rocky and opensuse to the allowlist for libarrow binaries #44124

Merged
merged 5 commits into from
Oct 8, 2024
Merged
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
2 changes: 2 additions & 0 deletions r/tools/nixlibs-allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ ubuntu
centos
redhat
rhel
rocky
opensuse
4 changes: 2 additions & 2 deletions r/tools/nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,8 @@ check_allowlist <- function(os, allowed = "https://github.com/raw/apa
allowlist <- tryCatch(
# Try a remote allowlist so that we can add/remove without a release
suppressWarnings(readLines(allowed)),
# Fallback to default: allowed only on Ubuntu and CentOS/RHEL
error = function(e) c("ubuntu", "centos", "redhat", "rhel")
# Fallback to default allow list shipped with the package
error = function(e) readLines("tools/nixlibs-allowlist.txt")
)
# allowlist should contain valid regular expressions (plain strings ok too)
any(grepl(paste(allowlist, collapse = "|"), os))
Expand Down
7 changes: 7 additions & 0 deletions r/tools/test-nixlibs.R
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ test_that("select_binary() with test program", {
})

test_that("check_allowlist", {
# because we read from a file when we can't get the allow list from github,
# we need to make sure we are in the same directory as we would be when building
# (which is one level higher, so we can find `tools/nixlibs.R`)
# TODO: it's possible that we don't want to run this whole file in that directory
# like we do currently.
withr::local_dir("..")

tf <- tempfile()
cat("tu$\n^cent\n^dar\n", file = tf)
expect_true(check_allowlist("ubuntu", tf))
Expand Down
Loading