thisisnic commented on code in PR #38115:
URL: https://github.com/apache/arrow/pull/38115#discussion_r1355163896
##########
r/tools/winlibs.R:
##########
@@ -17,55 +17,84 @@
args <- commandArgs(TRUE)
VERSION <- args[1]
-if (!file.exists(sprintf("windows/arrow-%s/include/arrow/api.h", VERSION))) {
- if (length(args) > 1) {
- # Arg 2 would be the path/to/lib.zip
- localfile <- args[2]
- cat(sprintf("*** Using RWINLIB_LOCAL %s\n", localfile))
- if (!file.exists(localfile)) {
- cat(sprintf("*** %s does not exist; build will fail\n", localfile))
- }
- file.copy(localfile, "lib.zip")
- } else {
- # Download static arrow from the apache artifactory
- quietly <- !identical(tolower(Sys.getenv("ARROW_R_DEV")), "true")
- get_file <- function(template, version) {
- try(
- suppressWarnings(
- download.file(sprintf(template, version), "lib.zip", quiet = quietly)
- ),
- silent = quietly
- )
- }
+dev_version <- package_version(VERSION)[1, 4]
+# Small dev versions are added for R-only changes during CRAN submission
+is_release <- is.na(dev_version) || dev_version < "100"
+env_is <- function(var, value) identical(tolower(Sys.getenv(var)), value)
+# We want to log the message in the style of the configure script
+# not as an R error. Use `return` to exit the script after logging.
+lg <- function(...) {
+ cat("*** ", sprintf(...), "\n")
+}
- # URL templates
- nightly <- paste0(
- getOption("arrow.dev_repo", "https://nightlies.apache.org/arrow/r"),
- "/libarrow/bin/windows/arrow-%s.zip"
- )
- # %1$s uses the first variable for both substitutions
- artifactory <- paste0(
- getOption("arrow.repo",
"https://apache.jfrog.io/artifactory/arrow/r/%1$s"),
- "/libarrow/bin/windows/arrow-%1$s.zip"
- )
- rwinlib <- "https://github.com/rwinlib/arrow/archive/v%s.zip"
+if (is_release) {
+ # This is a release version, so we need to use the major.minor.patch version
without
+ # the CRAN suffix/dev_version
+ VERSION <- package_version(VERSION)[1, 1:3]
+ # %1$s uses the first variable for both substitutions
+ url_template <- paste0(
+ getOption("arrow.repo",
"https://apache.jfrog.io/artifactory/arrow/r/%1$s"),
+ "/libarrow/bin/windows/arrow-%1$s.zip"
+ )
+} else {
+ url_template <- paste0(
Review Comment:
Oh wait, I thought we were only talking about MacOS in the email to CRAN,
but yeah, we're going to have to do Windows too, right?
--
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]