assignUser commented on code in PR #39587:
URL: https://github.com/apache/arrow/pull/39587#discussion_r1451795898


##########
r/tools/nixlibs.R:
##########
@@ -116,33 +105,56 @@ download_binary <- function(lib) {
   # validate binary checksum for CRAN release only
   if (!skip_checksum && dir.exists(checksum_path) && is_release ||
     enforce_checksum) {
+    # Munge the path to the correct sha file which we include during the
+    # release process
     checksum_file <- sub(".+/bin/(.+\\.zip)", "\\1\\.sha512", binary_url)
     checksum_file <- file.path(checksum_path, checksum_file)
-    checksum_cmd <- "shasum"
-    checksum_args <- c("--status", "-a", "512", "-c", checksum_file)
-
-    # shasum is not available on all linux versions
-    status_shasum <- try(
-      suppressWarnings(
-        system2("shasum", args = c("--help"), stdout = FALSE, stderr = FALSE)
-      ),
-      silent = TRUE
-    )
 
-    if (inherits(status_shasum, "try-error") || is.integer(status_shasum) && 
status_shasum != 0) {
+    # Check for `shasum`, and try `sha512sum` if not found
+    if (nzchar(Sys.which("shasum"))) {
+      checksum_cmd <- "shasum"
+      checksum_args <- c("--status", "-a", "512", "-c", checksum_file)
+    } else {

Review Comment:
   I think this is the reason for the windows fail. It seems to run in the git 
bash not rtools bash so finds shasum in the gitbash path but that then[ fails 
to 
work](https://github.com/ursacomputing/crossbow/actions/runs/7520694560/job/20470863023#step:18:62).
 The previous version tries to run that and falls back on sha256sum (which 
comes with rtools).
   



-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to