MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake#50317
MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake#50317rok wants to merge 13 commits into
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.
There was a problem hiding this comment.
Could you show env | sort to consider whether we can unset MAKEFLAGS MFLAGS or not?
There was a problem hiding this comment.
The issue was MAKEFLAGS=%s\n' -jNA, which was due to ncores <- parallel::detectCores() returning NA in r/tools/nixlibs.R. This should be resolved now.
|
Revision: 5a5ea93 Submitted crossbow builds: ursacomputing/crossbow @ actions-80e6f4beca
|
|
@github-actions crossbow submit test-r-wasm |
|
Revision: 8f4ba35 Submitted crossbow builds: ursacomputing/crossbow @ actions-dd5e1d7710
|
kou
left a comment
There was a problem hiding this comment.
+1
Could you update the PR title and description?
|
Thanks @kou, done! If it's ok I'll merge. |
|
Ah, could you add a comment like @amoeba did https://github.com/apache/arrow/pull/49996/changes#diff-935746c34b16289a07b0d9bf7642dbd268b18059b6187f7cdec7c464be47a3deR530 ? |
|
@kou done. Will merge if CI is green. |
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.