This is an automated email from the ASF dual-hosted git repository.

kou 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 84e334123a MINOR: [Release] Make post-11-bump-versions.sh work on 
macOS (#47158)
84e334123a is described below

commit 84e334123abc6a58c5ccfe8e92944e1cfc656f7a
Author: Bryce Mecum <[email protected]>
AuthorDate: Mon Jul 21 14:39:15 2025 -0700

    MINOR: [Release] Make post-11-bump-versions.sh work on macOS (#47158)
    
    ### Rationale for this change
    
    The script doesn't run out of the box on macOS. since `nproc` is not 
available.
    
    ### What changes are included in this PR?
    
    Makes the determination of the number of jobs dynamic and platform-specific.
    
    ### Are these changes tested?
    
    On macOS, yes.
    
    ### Are there any user-facing changes?
    
    No.
    
    Authored-by: Bryce Mecum <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 dev/release/post-11-bump-versions.sh | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/dev/release/post-11-bump-versions.sh 
b/dev/release/post-11-bump-versions.sh
index bf40f4ce5c..d14a4c005d 100755
--- a/dev/release/post-11-bump-versions.sh
+++ b/dev/release/post-11-bump-versions.sh
@@ -53,7 +53,19 @@ esac
 
 if [ ${BUMP_UPDATE_LOCAL_DEFAULT_BRANCH} -gt 0 ]; then
   echo "Updating local default branch"
-  git fetch --all --prune --tags --force -j$(nproc)
+  case "$(uname)" in
+    Linux)
+      n_jobs=$(nproc)
+      ;;
+    Darwin)
+      n_jobs=$(sysctl -n hw.ncpu)
+      ;;
+    *)
+      n_jobs=${NPROC:-0} # see git-config, 0 means "reasonable default"
+      ;;
+  esac
+
+  git fetch --all --prune --tags --force -j"$n_jobs"
   git checkout ${DEFAULT_BRANCH}
   git rebase apache/${DEFAULT_BRANCH}
 fi

Reply via email to