MINOR: [R] Unset MAKEFLAGS for nested libarrow CMake build#50317
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the R static Arrow build script to pass the Make/Ninja parallelism flag in a single token (-jN) to avoid cases where the underlying build tool interprets -j as missing its integer argument.
Changes:
- Adjusted the
cmake --buildinvocation to use-j${N_JOBS}instead of-j $N_JOBS.
|
@github-actions crossbow submit test-r-wasm |
|
Revision: 6d4a25b Submitted crossbow builds: ursacomputing/crossbow @ actions-a4227cb8da
|
6d4a25b to
1d835a6
Compare
|
@github-actions crossbow submit test-r-wasm |
|
Revision: 1d835a6 Submitted crossbow builds: ursacomputing/crossbow @ actions-c381cbcd47
|
1d835a6 to
ef59f03
Compare
|
@github-actions crossbow submit test-r-wasm |
|
Revision: ef59f03 Submitted crossbow builds: ursacomputing/crossbow @ actions-52b31fc83d
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
@github-actions crossbow submit test-r-wasm |
|
Revision: 4f135a1 Submitted crossbow builds: ursacomputing/crossbow @ actions-ea2f0ed863
|
|
@thisisnic this change might solve the other r-wasm issue. |
| ${SOURCE_DIR} | ||
|
|
||
| ${CMAKE} --build . --target install -- -j $N_JOBS | ||
| (unset MAKEFLAGS MFLAGS; ${CMAKE} --build . --target install --parallel "${N_JOBS}") |
There was a problem hiding this comment.
It seems that this
diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh
index 349531b75f..02bc4a24c7 100755
--- a/r/inst/build_arrow_static.sh
+++ b/r/inst/build_arrow_static.sh
@@ -114,7 +114,7 @@ ${CMAKE_WRAPPER} ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
-G "${CMAKE_GENERATOR:-Unix Makefiles}" \
${SOURCE_DIR}
-${CMAKE} --build . --target install -- -j $N_JOBS
+${CMAKE} --build . --target install -- -j$N_JOBS
if command -v sccache &> /dev/null; then
echo "=== sccache stats after the build ==="or
diff --git a/r/inst/build_arrow_static.sh b/r/inst/build_arrow_static.sh
index 349531b75f..0df5240888 100755
--- a/r/inst/build_arrow_static.sh
+++ b/r/inst/build_arrow_static.sh
@@ -114,7 +114,7 @@ ${CMAKE_WRAPPER} ${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
-G "${CMAKE_GENERATOR:-Unix Makefiles}" \
${SOURCE_DIR}
-${CMAKE} --build . --target install -- -j $N_JOBS
+${CMAKE} --build . --target install --parallel $N_JOBS
if command -v sccache &> /dev/null; then
echo "=== sccache stats after the build ==="is enough.
There was a problem hiding this comment.
So if change that I get:
+ /usr/bin/cmake --build . --target install --parallel 2
gmake: the '-j' option requires a positive integer argumentand this error on crossbow test-r-wasm. Will try other combinations.
There was a problem hiding this comment.
Oh no worries. Do you think we shouldn't use unset MAKEFLAGS MFLAGS;? I'm trying things but didn't find anything useful yet.
d53e514 to
d7a63bc
Compare
|
@github-actions crossbow submit test-r-wasm |
|
Revision: d7a63bc Submitted crossbow builds: ursacomputing/crossbow @ actions-5c1be3e405
|
d7a63bc to
3e4ff27
Compare
3e4ff27 to
f217bd2
Compare
|
@github-actions crossbow submit test-r-wasm |
|
Revision: f217bd2 Submitted crossbow builds: ursacomputing/crossbow @ actions-9c6ebe2932
|
| # Extract -j/--jobs value from existing MAKEFLAGS if present | ||
| j_match <- regmatches(makeflags, regexpr("(^|\\s)(-j\\s*|--jobs(=|\\s)+)([0-9]+)(?=\\s|$)", makeflags, perl = TRUE)) | ||
| if (length(j_match) > 0) { | ||
| ncores <- as.integer(sub("-j\\s*", "", j_match, perl = TRUE)) | ||
| ncores <- as.integer(sub(".*?([0-9]+)$", "\\1", j_match, perl = TRUE)) | ||
| } | ||
| # Keep GNU make's optional -j/--jobs argument in one token for nested gmake | ||
| makeflags <- gsub("(^|\\s)-j\\s+([0-9]+)(?=\\s|$)", "\\1-j\\2", makeflags, perl = TRUE) | ||
| makeflags <- gsub("(^|\\s)--jobs\\s+([0-9]+)(?=\\s|$)", "\\1--jobs=\\2", makeflags, perl = TRUE) | ||
| # Give any remaining bare `-j`/`--jobs` an explicit count | ||
| makeflags <- gsub("(^|\\s)-j(?=\\s|$)", sprintf("\\1-j%s", ncores), makeflags, perl = TRUE) | ||
| makeflags <- gsub("(^|\\s)--jobs(?=\\s|$)", sprintf("\\1--jobs=%s", ncores), makeflags, perl = TRUE) | ||
| Sys.setenv(MAKEFLAGS = makeflags) |
|
@github-actions crossbow submit test-r-wasm |
|
Revision: f217bd2 Submitted crossbow builds: ursacomputing/crossbow @ actions-f3c262033f
|
|
@github-actions crossbow submit test-r-wasm |
|
Revision: 7999054 Submitted crossbow builds: ursacomputing/crossbow @ actions-40d2949078
|
|
@github-actions crossbow submit test-r-wasm |
| makeflags <- gsub("(^|\\s)--jobserver-[^[:space:]]+", " ", makeflags, perl = TRUE) | ||
| makeflags <- gsub("(^|\\s)--jobs(=|\\s+)?[0-9]*(?=\\s|$)", " ", makeflags, perl = TRUE) | ||
| makeflags <- gsub("(^|\\s)-j\\s*[0-9]*(?=\\s|$)", " ", makeflags, perl = TRUE) | ||
| makeflags <- gsub("(^|\\s)([[:alpha:]]*)j[0-9]*([[:alpha:]]*)(?=\\s|$)", "\\1\\2\\3", makeflags, perl = TRUE) |
|
Revision: a623cf5 Submitted crossbow builds: ursacomputing/crossbow @ actions-05773104a1
|
Rationale for this change
See failure here.
What changes are included in this PR?
Bash command used is adjusted to prevent this error.
Are these changes tested?
By CI.
Are there any user-facing changes?
No.