jonkeane commented on code in PR #13464:
URL: https://github.com/apache/arrow/pull/13464#discussion_r910434559
##########
r/tools/nixlibs.R:
##########
@@ -60,53 +56,110 @@ download_ok <- !env_is("TEST_OFFLINE_BUILD", "true") &&
try_download("https://gi
thirdparty_dependency_dir <- Sys.getenv("ARROW_THIRDPARTY_DEPENDENCY_DIR",
"tools/thirdparty_dependencies")
-download_binary <- function(os = identify_os()) {
+download_binary <- function(lib) {
libfile <- tempfile()
- if (!is.null(os)) {
- # See if we can map this os-version to one we have binaries for
- os <- find_available_binary(os)
- binary_url <- paste0(arrow_repo, "bin/", os, "/arrow-", VERSION, ".zip")
- if (try_download(binary_url, libfile)) {
- cat(sprintf("*** Successfully retrieved C++ binaries for %s\n", os))
- if (!identical(os, "centos-7")) {
- # centos-7 uses gcc 4.8 so the binary doesn't have ARROW_S3=ON
- # or ARROW_GCS=ON but the others do
- # TODO: actually check for system requirements?
- cat("**** Binary package requires libcurl and openssl\n")
- cat("**** If installation fails, retry after installing those system
requirements\n")
- }
- } else {
- cat(sprintf("*** No libarrow binary found for version %s on %s\n",
VERSION, os))
- libfile <- NULL
- }
+ binary_url <- paste0(arrow_repo, "bin/", lib, "/arrow-", VERSION, ".zip")
+ if (try_download(binary_url, libfile)) {
+ cat(sprintf("*** Successfully retrieved C++ binaries for %s\n", lib))
} else {
+ cat(sprintf("*** No libarrow binary found for version %s on %s\n",
VERSION, lib))
libfile <- NULL
}
libfile
}
# Function to figure out which flavor of binary we should download, if at all.
-# By default (unset or "FALSE"), it will not download a precompiled library,
-# but you can override this by setting the env var LIBARROW_BINARY to:
-# * `TRUE` (not case-sensitive), to try to discover your current OS, or
-# * some other string, presumably a related "distro-version" that has binaries
-# built that work for your OS
-identify_os <- function(os = Sys.getenv("LIBARROW_BINARY")) {
- if (tolower(os) %in% c("", "false")) {
- # Env var says not to download a binary
- return(NULL)
- } else if (!identical(tolower(os), "true")) {
- # Env var provided an os-version to use--maybe you're on Ubuntu 18.10 but
- # we only build for 18.04 and that's fine--so use what the user set
- return(os)
+# LIBARROW_BINARY controls the behavior. If unset, it will determine a course
+# of action based on the current system. Other values you can set it to:
+# * "FALSE" (not case-sensitive), to
+# * "TRUE" (not case-sensitive), to try to discover your current OS, or
+# * some other string: a "distro-version" that corresponds to a binary that is
+# available, to override what this function may determine by default.
+# Possible values (also the potential return values of this function,
+# along with `NULL`) are:
+# * "centos-7" (gcc 4.8, no AWS/GCS support)
+# * "ubuntu-18.04" (gcc 8, openssl 1)
+# * "ubuntu-22.04" (openssl 3)
Review Comment:
🙏 For this added clarity + examples
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]