Skip to content

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

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

MINOR: [R] Unset MAKEFLAGS for nested libarrow CMake build#50317
rok wants to merge 6 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.

@github-actions github-actions Bot removed the awaiting committer review Awaiting committer review label Jul 2, 2026
@rok rok force-pushed the wasm_parallel_build_flag branch from d53e514 to d7a63bc Compare July 2, 2026 18:05
@rok

rok commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Revision: d7a63bc

Submitted crossbow builds: ursacomputing/crossbow @ actions-5c1be3e405

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 2 out of 2 changed files in this pull request and generated no new comments.

@rok rok force-pushed the wasm_parallel_build_flag branch from d7a63bc to 3e4ff27 Compare July 2, 2026 18:18
Copilot AI review requested due to automatic review settings July 2, 2026 18:20
@rok rok force-pushed the wasm_parallel_build_flag branch from 3e4ff27 to f217bd2 Compare July 2, 2026 18:20
@rok

rok commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Revision: f217bd2

Submitted crossbow builds: ursacomputing/crossbow @ actions-9c6ebe2932

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/tools/nixlibs.R
Comment on lines +538 to +549
# 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)
@rok

rok commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Revision: f217bd2

Submitted crossbow builds: ursacomputing/crossbow @ actions-f3c262033f

Task Status
test-r-wasm GitHub Actions

@rok

rok commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Revision: 7999054

Submitted crossbow builds: ursacomputing/crossbow @ actions-40d2949078

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 2, 2026
Copilot AI review requested due to automatic review settings July 2, 2026 22:14
@rok

rok commented Jul 2, 2026

Copy link
Copy Markdown
Member Author

@github-actions crossbow submit test-r-wasm

@github-actions github-actions Bot added awaiting change review Awaiting change review awaiting changes Awaiting changes and removed awaiting changes Awaiting changes awaiting change review Awaiting change review labels Jul 2, 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

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

Comment thread r/tools/nixlibs.R
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)
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

Revision: a623cf5

Submitted crossbow builds: ursacomputing/crossbow @ actions-05773104a1

Task Status
test-r-wasm GitHub Actions

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.

3 participants