Github messages for voidlinux
 help / color / mirror / Atom feed
From: classabbyamp <classabbyamp@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] xbps-src: default XBPS_MAKEJOBS to `nproc`
Date: Sat, 05 Nov 2022 08:10:22 +0100	[thread overview]
Message-ID: <20221105071022.6FbZ-VFxrE4UR6Sk2hwpPj4iba5mNyJ9sewpYqUAer0@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40331@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 660 bytes --]

There is an updated pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages xbps-src/j-auto
https://github.com/void-linux/void-packages/pull/40331

xbps-src: default XBPS_MAKEJOBS to `nproc`
previously this defaulted to 1. In some rare cases, nproc is not desirable, but that can be easily overriden in the standard ways, etc/conf or -jN.

For compatibility with other distros, it defaults to 1 when nproc is not available.

#### Testing the changes
- I tested the changes in this PR: **YES**



A patch file from https://github.com/void-linux/void-packages/pull/40331.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-src/j-auto-40331.patch --]
[-- Type: text/x-diff, Size: 2567 bytes --]

From 85947fb4e3c09bda4aedd2d3071f94b99943efc0 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 5 Nov 2022 02:27:50 -0400
Subject: [PATCH 1/2] xbps-src: default XBPS_MAKEJOBS to `nproc`

previously this defaulted to 1. In some rare cases, nproc is not
desirable, but that can be easily overriden in the standard ways,
etc/conf or -jN.

For compatibility with other distros, it defaults to 1 when nproc
is not available.
---
 common/xbps-src/shutils/common.sh | 1 -
 xbps-src                          | 7 +++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index a640528f4d6a..d523b97d1e29 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -482,7 +482,6 @@ setup_pkg() {
     DESTDIR=$XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/${sourcepkg}-${version}
     PKGDESTDIR=$XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/${pkg}-${version}
 
-    : ${XBPS_MAKEJOBS:=1}
     export XBPS_ORIG_MAKEJOBS=${XBPS_ORIG_MAKEJOBS:=$XBPS_MAKEJOBS}
     if [ -n "$disable_parallel_build" ]; then
         XBPS_MAKEJOBS=1
diff --git a/xbps-src b/xbps-src
index 47681826196b..a3831d8e4876 100755
--- a/xbps-src
+++ b/xbps-src
@@ -489,6 +489,13 @@ fi
 [ -n "$XBPS_ARG_CHECK_PKGS" ] && XBPS_CHECK_PKGS="$XBPS_ARG_CHECK_PKGS"
 [ -n "$XBPS_ARG_MAKEJOBS" ] && XBPS_MAKEJOBS="$XBPS_ARG_MAKEJOBS"
 
+# Default to nproc for XBPS_MAKEJOBS if not set and nproc is available
+if command -v nproc >/dev/null ; then
+    : ${XBPS_MAKEJOBS:=$(nproc)}
+else
+    : ${XBPS_MAKEJOBS:=1}
+fi
+
 export XBPS_BUILD_ONLY_ONE_PKG XBPS_SKIP_REMOTEREPOS XBPS_BUILD_FORCEMODE \
        XBPS_INFORMATIVE_RUN XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \
        XBPS_USE_GIT_REVS XBPS_CHECK_PKGS XBPS_DEBUG_PKGS XBPS_SKIP_DEPS \

From 5855e89d801f7177bf4887e83384607496e1f8a2 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Sat, 5 Nov 2022 02:34:02 -0400
Subject: [PATCH 2/2] etc/defaults.conf: document nproc XBPS_MAKEJOBS default

---
 etc/defaults.conf | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/etc/defaults.conf b/etc/defaults.conf
index d69b4a454087..f70e4ea3d006 100644
--- a/etc/defaults.conf
+++ b/etc/defaults.conf
@@ -64,7 +64,8 @@ XBPS_SUCMD="sudo /bin/sh -c"
 
 # [OPTIONAL]
 # Number of parallel jobs to execute when building packages that
-# use make(1) or alike commands.
+# use make(1) or alike commands. Defaults to the result of nproc(1).
+# If nproc(1) is not available, defaults to 1.
 #
 #XBPS_MAKEJOBS=4
 

  parent reply	other threads:[~2022-11-05  7:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-05  6:36 [PR PATCH] " classabbyamp
2022-11-05  7:03 ` [PR PATCH] [Updated] " classabbyamp
2022-11-05  7:09 ` abenson
2022-11-05  7:10 ` classabbyamp [this message]
2022-11-05  9:33 ` dataCobra
2022-11-05 11:16 ` jcgruenhage
2022-11-06  1:39 ` [RFC] " ahesford
2022-11-16 13:52 ` dataCobra
2022-11-16 14:55 ` ahesford
2022-12-22 20:02 ` vincele
2022-12-23  2:15 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221105071022.6FbZ-VFxrE4UR6Sk2hwpPj4iba5mNyJ9sewpYqUAer0@z \
    --to=classabbyamp@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).