You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ro...@apache.org on 2026/07/06 09:37:52 UTC
(arrow) branch main updated: MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake (#50317)
This is an automated email from the ASF dual-hosted git repository.
rok pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git
The following commit(s) were added to refs/heads/main by this push:
new 5bf8934eb3 MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake (#50317)
5bf8934eb3 is described below
commit 5bf8934eb3cfbb82433a95e13ba4cf1355da0b1b
Author: Rok Mihevc <ro...@mihevc.org>
AuthorDate: Mon Jul 6 11:37:46 2026 +0200
MINOR: [R] Adjust parallel::detectCores if NA to not break --parallel input in CMake (#50317)
### Rationale for this change
See [failure here](https://github.com/ursacomputing/crossbow/actions/runs/28486933942/job/84435321636#step:6:719).
### What changes are included in this PR?
Bash command used is adjusted to prevent this error.
```bash
/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.
Lead-authored-by: Rok Mihevc <ro...@mihevc.org>
Co-authored-by: Copilot Autofix powered by AI <17...@users.noreply.github.com>
Signed-off-by: Rok Mihevc <ro...@mihevc.org>
---
r/tools/nixlibs.R | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/r/tools/nixlibs.R b/r/tools/nixlibs.R
index ba705e03ad..dd230c3764 100644
--- a/r/tools/nixlibs.R
+++ b/r/tools/nixlibs.R
@@ -526,7 +526,8 @@ build_libarrow <- function(src_dir, dst_dir) {
# Set up make for parallel building
# 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()
+ # detectCores() returns NA if number of cores is unknown. Set ncores to 1 if NA.
+ ncores <- max(1, parallel::detectCores(), na.rm = TRUE)
if (!not_cran) {
ncores <- min(ncores, 2)
}