public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/, sys-apps/portage/files/
Date: Sun, 20 Nov 2022 02:46:54 +0000 (UTC)	[thread overview]
Message-ID: <1668912402.00c689f4303e4dc12531af849a39d34ac7c2f6b8.sam@gentoo> (raw)

commit:     00c689f4303e4dc12531af849a39d34ac7c2f6b8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 20 02:45:55 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Nov 20 02:46:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00c689f4

sys-apps/portage: backport xz 32-bit fixes

Fixes issues on 32-bit systems with -Tn.

Note that we exclude the binpkg compression probe bits as the
parallel parts there aren't in 3.0.38.1.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../portage/files/portage-3.0.38.1-xz-32-bit.patch | 90 ++++++++++++++++++++++
 ...0.38.1-r2.ebuild => portage-3.0.38.1-r3.ebuild} |  1 +
 2 files changed, 91 insertions(+)

diff --git a/sys-apps/portage/files/portage-3.0.38.1-xz-32-bit.patch b/sys-apps/portage/files/portage-3.0.38.1-xz-32-bit.patch
new file mode 100644
index 000000000000..fa50fbab01fc
--- /dev/null
+++ b/sys-apps/portage/files/portage-3.0.38.1-xz-32-bit.patch
@@ -0,0 +1,90 @@
+https://github.com/gentoo/portage/commit/6a47cc7bcf49b7c17fdca31969b6d6aeff84332c
+https://github.com/gentoo/portage/commit/041da67db3a61d19fa5b287db4da9c51794af115
+https://github.com/gentoo/portage/commit/6834e464803b5ac98f8ab1bbca5379970b5bc6d9
+
+From 6a47cc7bcf49b7c17fdca31969b6d6aeff84332c Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 17 Oct 2022 19:37:03 +0100
+Subject: [PATCH] xz: add workaround for < xz 5.3.3_alpha 32-bit issue
+
+With older versions of xz, xz -T0 will on 32-bit systems
+try to allocate too much memory and bail out.
+
+After discussing with upstream, we set --memlimit-compress=50% as a
+way to make things work with both older & newer versions. This limiting
+is essentially already present with >= 5.3.3_alpha as -T0 includes it.
+
+Note that we don't need to do this for decompression as it's automatic
+there for newer versions and older versions -Tn a no-op.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/bin/ecompress
++++ b/bin/ecompress
+@@ -128,7 +128,7 @@ if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
+ 		# See: https://bugs.gentoo.org/672916
+ 		# Setting '--rm' will remove the source files after a successful compression.
+ 		lz4)  PORTAGE_COMPRESS_FLAGS="-m --rm";;
+-		xz)   PORTAGE_COMPRESS_FLAGS="-9 -T$(___makeopts_jobs)";;
++		xz)   PORTAGE_COMPRESS_FLAGS="-9 -T$(___makeopts_jobs) --memlimit-compress=50%";;
+ 		zstd) PORTAGE_COMPRESS_FLAGS="-q --rm -T$(___makeopts_jobs)";;
+ 	esac
+ fi
+
+From 041da67db3a61d19fa5b287db4da9c51794af115 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Mon, 17 Oct 2022 23:07:58 +0100
+Subject: [PATCH] xz: pass -q to xz
+
+Avoids noise from memlimit-compress.
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/bin/ecompress
++++ b/bin/ecompress
+@@ -128,7 +128,7 @@ if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
+ 		# See: https://bugs.gentoo.org/672916
+ 		# Setting '--rm' will remove the source files after a successful compression.
+ 		lz4)  PORTAGE_COMPRESS_FLAGS="-m --rm";;
+-		xz)   PORTAGE_COMPRESS_FLAGS="-9 -T$(___makeopts_jobs) --memlimit-compress=50%";;
++		xz)   PORTAGE_COMPRESS_FLAGS="-9 -T$(___makeopts_jobs) --memlimit-compress=50% -q";;
+ 		zstd) PORTAGE_COMPRESS_FLAGS="-q --rm -T$(___makeopts_jobs)";;
+ 	esac
+ fi
+
+From 6834e464803b5ac98f8ab1bbca5379970b5bc6d9 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 21 Oct 2022 02:32:17 +0100
+Subject: [PATCH] ecompress: don't set -9 for xz
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From xz(1):
+"""
+The differences between the presets are more significant than with gzip(1) and bzip2(1).  The selected compression settings determine the memory requirements of the decompressor, thus  us‐
+ing  a too high preset level might make it painful to decompress the file on an old system with little RAM.  Specifically, it's not a good idea to blindly use -9 for everything like it of‐
+ten is with gzip(1) and bzip2(1).
+[...]
+-7 ... -9
+     These are like -6 but with higher compressor and decompressor memory requirements.  These are useful only when compressing files bigger than 8 MiB, 16 MiB, and 32 MiB, respectively.
+[...]
+•  DictSize  is  the  LZMA2 dictionary size.  It is waste of memory to use a dictionary bigger than the size of the uncompressed file.  This is why it is good to avoid using the presets -7
+... -9 when there's no real need for them.  At -6 and lower, the amount of memory wasted is usually low enough to not matter.
+"""
+
+Most things that ecompress touches are tiny (<32MB certainly). I made the
+mistake the man page warngs about -- don't assume it's a good idea just
+because of gzip & bzip2, and that's exactly what I did!
+
+Signed-off-by: Sam James <sam@gentoo.org>
+--- a/bin/ecompress
++++ b/bin/ecompress
+@@ -128,7 +128,7 @@ if [[ ${PORTAGE_COMPRESS_FLAGS+set} != "set" ]] ; then
+ 		# See: https://bugs.gentoo.org/672916
+ 		# Setting '--rm' will remove the source files after a successful compression.
+ 		lz4)  PORTAGE_COMPRESS_FLAGS="-m --rm";;
+-		xz)   PORTAGE_COMPRESS_FLAGS="-9 -T$(___makeopts_jobs) --memlimit-compress=50% -q";;
++		xz)   PORTAGE_COMPRESS_FLAGS="-q -T$(___makeopts_jobs) --memlimit-compress=50%";;
+ 		zstd) PORTAGE_COMPRESS_FLAGS="-q --rm -T$(___makeopts_jobs)";;
+ 	esac
+ fi
+

diff --git a/sys-apps/portage/portage-3.0.38.1-r2.ebuild b/sys-apps/portage/portage-3.0.38.1-r3.ebuild
similarity index 99%
rename from sys-apps/portage/portage-3.0.38.1-r2.ebuild
rename to sys-apps/portage/portage-3.0.38.1-r3.ebuild
index f7e3c208d20d..0ba541e800e8 100644
--- a/sys-apps/portage/portage-3.0.38.1-r2.ebuild
+++ b/sys-apps/portage/portage-3.0.38.1-r3.ebuild
@@ -85,6 +85,7 @@ pkg_pretend() {
 
 python_prepare_all() {
 	local PATCHES=(
+		"${FILESDIR}"/${P}-xz-32-bit.patch
 	)
 
 	distutils-r1_python_prepare_all


             reply	other threads:[~2022-11-20  2:46 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-20  2:46 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-17 13:05 [gentoo-commits] repo/gentoo:master commit in: sys-apps/portage/, sys-apps/portage/files/ Sam James
2024-05-10 18:26 Sam James
2023-12-03  8:02 Sam James
2023-10-26 15:53 Mike Gilbert
2023-07-30 13:10 Sam James
2023-07-15  3:45 Sam James
2023-02-28  3:14 Sam James
2023-01-13  3:50 Sam James
2022-11-30  7:07 Sam James
2022-11-20 23:37 Sam James
2022-10-26  0:23 Mike Gilbert
2022-10-20 15:49 Mike Gilbert
2022-04-24 16:45 WANG Xuerui
2022-04-15  8:37 Sam James
2018-01-02  2:49 Mike Gilbert
2016-09-19 14:00 Mike Gilbert
2016-05-16 16:20 Brian Dolbec

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=1668912402.00c689f4303e4dc12531af849a39d34ac7c2f6b8.sam@gentoo \
    --to=sam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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