From e566e7884d217540f2e8871534e4bd2cdbb3080e Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 3 Nov 2023 09:29:15 -0500 Subject: [PATCH 1/3] Stop on warnings --- ci/scripts/r_test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/scripts/r_test.sh b/ci/scripts/r_test.sh index e0c2ce9efed..22ec551edb9 100755 --- a/ci/scripts/r_test.sh +++ b/ci/scripts/r_test.sh @@ -27,7 +27,7 @@ pushd ${source_dir} printenv # Run the nixlibs.R test suite, which is not included in the installed package -${R_BIN} -e 'setwd("tools"); testthat::test_dir(".")' +${R_BIN} -e 'setwd("tools"); testthat::test_dir(".", stop_on_warning = TRUE)' # Before release, we always copy the relevant parts of the cpp source into the # package. In some CI checks, we will use this version of the source: From b4bd90ca96b278a36dd3f41c1b4037614769d255 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 3 Nov 2023 09:58:39 -0500 Subject: [PATCH 2/3] Prevent NULL in ifelse from warning --- r/tools/nixlibs.R | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R index 96f2b858cf1..63c185ce545 100644 --- a/r/tools/nixlibs.R +++ b/r/tools/nixlibs.R @@ -198,7 +198,11 @@ select_binary <- function(os = tolower(Sys.info()[["sysname"]]), errs <- compile_test_program(test_program) openssl_version <- determine_binary_from_stderr(errs) arch <- ifelse(identical(os, "darwin"), paste0("-", arch, "-"), "-") - ifelse(is.null(openssl_version), NULL, paste0(os, arch, openssl_version)) + if (is.null(openssl_version)) { + NULL + } else { + paste0(os, arch, openssl_version) + } }, error = function(e) { lg("Unable to find libcurl and openssl") @@ -210,7 +214,7 @@ select_binary <- function(os = tolower(Sys.info()[["sysname"]]), lg("Building on %s %s", os, arch) binary <- NULL } - return(binary) + binary } # This tests that curl and OpenSSL are present (bc we can include their headers) @@ -268,7 +272,7 @@ get_macos_openssl_dir <- function() { openssl_root_dir <- "/usr/local" } } - return(openssl_root_dir) + openssl_root_dir } # (built with newer devtoolset but older glibc (2.17) for broader compatibility,# like manylinux2014) @@ -828,10 +832,10 @@ quietly <- !env_is("ARROW_R_DEV", "true") not_cran <- env_is("NOT_CRAN", "true") -if (is_release) { +if (is_release & !test_mode) { VERSION <- VERSION[1, 1:3] arrow_repo <- paste0(getOption("arrow.repo", sprintf("https://apache.jfrog.io/artifactory/arrow/r/%s", VERSION)), "/libarrow/") -} else { +} else if(!test_mode) { not_cran <- TRUE arrow_repo <- paste0(getOption("arrow.dev_repo", "https://nightlies.apache.org/arrow/r"), "/libarrow/") VERSION <- find_latest_nightly(VERSION) From 2141d13e1ebfebeb34f22f779e22af8624967fc3 Mon Sep 17 00:00:00 2001 From: Jonathan Keane Date: Fri, 3 Nov 2023 11:25:51 -0500 Subject: [PATCH 3/3] Pacakge versions should be characters --- r/tools/check-versions.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r/tools/check-versions.R b/r/tools/check-versions.R index 45fbd0b61a4..3d8cbf02a14 100644 --- a/r/tools/check-versions.R +++ b/r/tools/check-versions.R @@ -23,8 +23,8 @@ test_mode <- exists("TESTING") check_versions <- function(r_version, cpp_version) { r_parsed <- package_version(r_version) r_dev_version <- r_parsed[1, 4] - r_is_dev <- !is.na(r_dev_version) && r_dev_version > 100 - r_is_patch <- !is.na(r_dev_version) && r_dev_version <= 100 + r_is_dev <- !is.na(r_dev_version) && r_dev_version > "100" + r_is_patch <- !is.na(r_dev_version) && r_dev_version <= "100" cpp_is_dev <- grepl("SNAPSHOT$", cpp_version) cpp_parsed <- package_version(sub("-SNAPSHOT$", "", cpp_version))