Skip to content

MINOR: [R] Unset MAKEFLAGS for nested libarrow CMake build#50317

Open
rok wants to merge 12 commits into
apache:mainfrom
rok:wasm_parallel_build_flag
Open

MINOR: [R] Unset MAKEFLAGS for nested libarrow CMake build#50317
rok wants to merge 12 commits into
apache:mainfrom
rok:wasm_parallel_build_flag

Conversation

@rok

@rok rok commented Jul 1, 2026

Copy link
Copy Markdown
Member

Rationale for this change

See failure here.

What changes are included in this PR?

Bash command used is adjusted to prevent this error.

/usr/bin/cmake --build . --target install -- -j 2
gmake: the '-j' option requires a positive integer argument

Are these changes tested?

By CI.

Are there any user-facing changes?

No.

Copilot AI review requested due to automatic review settings July 1, 2026 12:46
@rok rok requested review from jonkeane and thisisnic as code owners July 1, 2026 12:46
@github-actions github-actions Bot added the awaiting committer review Awaiting committer review label Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 --build invocation to use -j${N_JOBS} instead of -j $N_JOBS.

@rok

rok commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Revision: 6d4a25b

Submitted crossbow builds: ursacomputing/crossbow @ actions-a4227cb8da

Task Status
test-r-wasm GitHub Actions

@rok rok force-pushed the wasm_parallel_build_flag branch from 6d4a25b to 1d835a6 Compare July 1, 2026 13:15
@rok

rok commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Revision: 1d835a6

Submitted crossbow builds: ursacomputing/crossbow @ actions-c381cbcd47

Task Status
test-r-wasm GitHub Actions

@rok rok force-pushed the wasm_parallel_build_flag branch from 1d835a6 to ef59f03 Compare July 1, 2026 13:35
Copilot AI review requested due to automatic review settings July 1, 2026 13:35
@rok

rok commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Revision: ef59f03

Submitted crossbow builds: ursacomputing/crossbow @ actions-52b31fc83d

Task Status
test-r-wasm GitHub Actions

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread r/inst/build_arrow_static.sh Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 1, 2026 13:59
@rok

rok commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Revision: 4f135a1

Submitted crossbow builds: ursacomputing/crossbow @ actions-ea2f0ed863

Task Status
test-r-wasm GitHub Actions

@rok rok changed the title MINOR: [R] Use CMake -j${N_JOBS} instead of -j $N_JOBS MINOR: [R] Unset MAKEFLAGS for nested libarrow CMake build Jul 1, 2026
@rok

rok commented Jul 1, 2026

Copy link
Copy Markdown
Member Author

@thisisnic this change might solve the other r-wasm issue.

Comment thread r/inst/build_arrow_static.sh Outdated
${SOURCE_DIR}

${CMAKE} --build . --target install -- -j $N_JOBS
(unset MAKEFLAGS MFLAGS; ${CMAKE} --build . --target install --parallel "${N_JOBS}")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if change that I get:

+ /usr/bin/cmake --build . --target install --parallel 2
gmake: the '-j' option requires a positive integer argument

and this error on crossbow test-r-wasm. Will try other combinations.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry...

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no worries. Do you think we shouldn't use unset MAKEFLAGS MFLAGS;? I'm trying things but didn't find anything useful yet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you show env | sort to consider whether we can unset MAKEFLAGS MFLAGS or not?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot removed the awaiting committer review Awaiting committer review label Jul 2, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Revision: ca8919f

Submitted crossbow builds: ursacomputing/crossbow @ actions-c97534ddb8

Task Status
test-r-wasm GitHub Actions

Copilot AI review requested due to automatic review settings July 3, 2026 12:47
@rok

rok commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Revision: 4c7c074

Submitted crossbow builds: ursacomputing/crossbow @ actions-e09624349a

Task Status
test-r-wasm GitHub Actions

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread r/inst/build_arrow_static.sh Outdated
Comment thread r/inst/build_arrow_static.sh Outdated
@rok

rok commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Revision: 4c7c074

Submitted crossbow builds: ursacomputing/crossbow @ actions-c84a75e285

Task Status
test-r-wasm GitHub Actions

@rok

rok commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Revision: 6aa0fe6

Submitted crossbow builds: ursacomputing/crossbow @ actions-2aad1c3029

Task Status
test-r-wasm GitHub Actions

Copilot AI review requested due to automatic review settings July 3, 2026 13:46
@rok

rok commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread r/inst/build_arrow_static.sh Outdated
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Revision: 5a5ea93

Submitted crossbow builds: ursacomputing/crossbow @ actions-80e6f4beca

Task Status
test-r-wasm GitHub Actions

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jul 3, 2026
@github-actions github-actions Bot added awaiting change review Awaiting change review and removed awaiting changes Awaiting changes labels Jul 3, 2026
@rok

rok commented Jul 3, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Revision: 8f4ba35

Submitted crossbow builds: ursacomputing/crossbow @ actions-dd5e1d7710

Task Status
test-r-wasm GitHub Actions

@rok rok requested a review from kou July 3, 2026 15:17
Comment thread r/tools/nixlibs.R
# CRAN policy says not to use more than 2 cores during checks
# If you have more and want to use more, set MAKEFLAGS or NOT_CRAN
ncores <- parallel::detectCores()
ncores <- max(1, parallel::detectCores(), na.rm = TRUE)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a typo; should it be min()?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case parallel::detectCores() returns 2 we'd have max(1, 2, na.rm = TRUE) which would return 2 which would be preferable over min(1, 2, na.rm = TRUE) which would return 1. Or am I misunderstanding something?

@github-actions github-actions Bot added awaiting changes Awaiting changes and removed awaiting change review Awaiting change review labels Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants