jonkeane commented on code in PR #48341:
URL: https://github.com/apache/arrow/pull/48341#discussion_r2590558435


##########
r/tools/nixlibs.R:
##########
@@ -540,6 +540,12 @@ build_libarrow <- function(src_dir, dst_dir) {
   if (makeflags == "") {
     makeflags <- sprintf("-j%s", ncores)
     Sys.setenv(MAKEFLAGS = makeflags)
+  } else {
+    # Extract -j value from existing MAKEFLAGS if present
+    j_match <- regmatches(makeflags, regexpr("-j\\s*([0-9]+)", makeflags, perl 
= TRUE))
+    if (length(j_match) > 0) {
+      ncores <- as.integer(sub("-j\\s*", "", j_match, perl = TRUE))
+    }

Review Comment:
   Alternatively, we could probably pass our `MAKEFLAGS` all the way down to 
https://github.com/apache/arrow/blob/2360a0c82c89581bbc9bc669544b24c0c57ea886/r/inst/build_arrow_static.sh#L112
 and then paste them there instead of the `N_JOBS` bit.
   
   Though this is more regexful, it is slightly less passing of large(r) things 
around so I went this route.



-- 
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]

Reply via email to