diff options
author | Jonas Jelten <jj@sft.lol> | 2022-11-22 20:11:50 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-11-23 07:53:42 +0100 |
commit | 3b7ae26f65794fed2d6b90b85d6a81a96b326702 (patch) | |
tree | 48904012f834888adf7d561827aa100fbcd65a67 /dev-lang | |
parent | app-arch/advancecomp: Bump to 2.4 (diff) | |
download | gentoo-3b7ae26f65794fed2d6b90b85d6a81a96b326702.tar.gz gentoo-3b7ae26f65794fed2d6b90b85d6a81a96b326702.tar.bz2 gentoo-3b7ae26f65794fed2d6b90b85d6a81a96b326702.zip |
dev-lang/python: add valgrind support
When the valgrind useflag is enabled, Python performs a runtime check if
it is run in the Valgrind VM, and adjusts its memory allocator to not
use pymalloc. Valgrind then does a much better job in tracking the
memory reachability.
Closes: https://bugs.gentoo.org/610816
Signed-off-by: Jonas Jelten <jj@sft.lol>
Closes: https://github.com/gentoo/gentoo/pull/11012
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/metadata.xml | 5 | ||||
-rw-r--r-- | dev-lang/python/python-2.7.18_p16.ebuild | 6 | ||||
-rw-r--r-- | dev-lang/python/python-3.10.8_p3.ebuild | 4 | ||||
-rw-r--r-- | dev-lang/python/python-3.11.0_p2.ebuild | 4 | ||||
-rw-r--r-- | dev-lang/python/python-3.12.0_alpha2.ebuild | 4 | ||||
-rw-r--r-- | dev-lang/python/python-3.8.15_p3.ebuild | 5 | ||||
-rw-r--r-- | dev-lang/python/python-3.9.15_p3.ebuild | 4 |
7 files changed, 26 insertions, 6 deletions
diff --git a/dev-lang/python/metadata.xml b/dev-lang/python/metadata.xml index c123a9ef4e61..648562ff2106 100644 --- a/dev-lang/python/metadata.xml +++ b/dev-lang/python/metadata.xml @@ -24,6 +24,11 @@ <flag name="lto"> Optimize the build using Link Time Optimization (LTO) </flag> + <flag name="valgrind"> + Disable pymalloc when running under + <pkg>dev-util/valgrind</pkg> is detected (may incur minor + performance penalty even when valgrind is not used) + </flag> <flag name="wininst"> Install Windows executables required to create an executable installer for MS Windows diff --git a/dev-lang/python/python-2.7.18_p16.ebuild b/dev-lang/python/python-2.7.18_p16.ebuild index 051f660f8f9b..ee49cd0dfcda 100644 --- a/dev-lang/python/python-2.7.18_p16.ebuild +++ b/dev-lang/python/python-2.7.18_p16.ebuild @@ -30,8 +30,9 @@ SLOT="${PYVER}" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" IUSE=" berkdb bluetooth build examples gdbm hardened +ncurses +readline - +sqlite +ssl tk wininst +xml + +sqlite +ssl tk valgrind wininst +xml " +RESTRICT="test" # Do not add a dependency on dev-lang/python to this ebuild. # If you need to apply a patch which requires python for bootstrapping, please @@ -65,6 +66,7 @@ RDEPEND=" DEPEND=" ${RDEPEND} bluetooth? ( net-wireless/bluez ) + valgrind? ( dev-util/valgrind ) " BDEPEND=" virtual/awk @@ -196,6 +198,8 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + + $(use_with valgrind) ) # disable implicit optimization/debugging flags diff --git a/dev-lang/python/python-3.10.8_p3.ebuild b/dev-lang/python/python-3.10.8_p3.ebuild index f7df03edfe54..ca2055bc531c 100644 --- a/dev-lang/python/python-3.10.8_p3.ebuild +++ b/dev-lang/python/python-3.10.8_p3.ebuild @@ -31,7 +31,7 @@ SLOT="${PYVER}" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" IUSE=" bluetooth build +ensurepip examples gdbm hardened libedit lto - +ncurses pgo +readline +sqlite +ssl test tk +xml + +ncurses pgo +readline +sqlite +ssl test tk valgrind +xml " RESTRICT="!test? ( test )" @@ -71,6 +71,7 @@ RDEPEND=" DEPEND=" ${RDEPEND} bluetooth? ( net-wireless/bluez ) + valgrind? ( dev-util/valgrind ) test? ( app-arch/xz-utils[extra-filters(+)] ) " # autoconf-archive needed to eautoreconf @@ -222,6 +223,7 @@ src_configure() { $(use_with lto) $(use_enable pgo optimizations) $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) ) # disable implicit optimization/debugging flags diff --git a/dev-lang/python/python-3.11.0_p2.ebuild b/dev-lang/python/python-3.11.0_p2.ebuild index 34cae611b846..eedf9c768a85 100644 --- a/dev-lang/python/python-3.11.0_p2.ebuild +++ b/dev-lang/python/python-3.11.0_p2.ebuild @@ -31,7 +31,7 @@ SLOT="${PYVER}" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" IUSE=" bluetooth build +ensurepip examples gdbm hardened libedit lto - +ncurses pgo +readline +sqlite +ssl test tk + +ncurses pgo +readline +sqlite +ssl test tk valgrind " RESTRICT="!test? ( test )" @@ -72,6 +72,7 @@ DEPEND=" ${RDEPEND} bluetooth? ( net-wireless/bluez ) test? ( app-arch/xz-utils[extra-filters(+)] ) + valgrind? ( dev-util/valgrind ) " # autoconf-archive needed to eautoreconf BDEPEND=" @@ -211,6 +212,7 @@ src_configure() { $(use_with lto) $(use_enable pgo optimizations) $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) ) # disable implicit optimization/debugging flags diff --git a/dev-lang/python/python-3.12.0_alpha2.ebuild b/dev-lang/python/python-3.12.0_alpha2.ebuild index e10b1c493b27..9d0d10adab0b 100644 --- a/dev-lang/python/python-3.12.0_alpha2.ebuild +++ b/dev-lang/python/python-3.12.0_alpha2.ebuild @@ -31,7 +31,7 @@ SLOT="${PYVER}" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" IUSE=" bluetooth build +ensurepip examples gdbm hardened libedit lto - +ncurses pgo +readline +sqlite +ssl test tk + +ncurses pgo +readline +sqlite +ssl test tk valgrind " RESTRICT="!test? ( test )" @@ -72,6 +72,7 @@ DEPEND=" ${RDEPEND} bluetooth? ( net-wireless/bluez ) test? ( app-arch/xz-utils[extra-filters(+)] ) + valgrind? ( dev-util/valgrind ) " # autoconf-archive needed to eautoreconf BDEPEND=" @@ -207,6 +208,7 @@ src_configure() { $(use_with lto) $(use_enable pgo optimizations) $(use_with readline readline "$(usex libedit editline readline)") + $(use_with valgrind) ) # disable implicit optimization/debugging flags diff --git a/dev-lang/python/python-3.8.15_p3.ebuild b/dev-lang/python/python-3.8.15_p3.ebuild index d2a1816f893b..1c522eb3b332 100644 --- a/dev-lang/python/python-3.8.15_p3.ebuild +++ b/dev-lang/python/python-3.8.15_p3.ebuild @@ -31,7 +31,7 @@ SLOT="${PYVER}" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" IUSE=" bluetooth build +ensurepip examples gdbm hardened lto +ncurses pgo - +readline +sqlite +ssl test tk wininst +xml + +readline +sqlite +ssl test tk valgrind wininst +xml " RESTRICT="!test? ( test )" @@ -68,6 +68,7 @@ DEPEND=" ${RDEPEND} bluetooth? ( net-wireless/bluez ) test? ( app-arch/xz-utils[extra-filters(+)] ) + valgrind? ( dev-util/valgrind ) " # autoconf-archive needed to eautoreconf BDEPEND=" @@ -175,6 +176,8 @@ src_configure() { --with-system-expat --with-system-ffi --with-wheel-pkg-dir="${EPREFIX}"/usr/lib/python/ensurepip + + $(use_with valgrind) ) # disable implicit optimization/debugging flags diff --git a/dev-lang/python/python-3.9.15_p3.ebuild b/dev-lang/python/python-3.9.15_p3.ebuild index 7b5a4be382ea..65e32a706fd5 100644 --- a/dev-lang/python/python-3.9.15_p3.ebuild +++ b/dev-lang/python/python-3.9.15_p3.ebuild @@ -31,7 +31,7 @@ SLOT="${PYVER}" KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86" IUSE=" bluetooth build +ensurepip examples gdbm hardened lto +ncurses pgo - +readline +sqlite +ssl test tk +xml + +readline +sqlite +ssl test tk valgrind +xml " RESTRICT="!test? ( test )" @@ -68,6 +68,7 @@ DEPEND=" ${RDEPEND} bluetooth? ( net-wireless/bluez ) test? ( app-arch/xz-utils[extra-filters(+)] ) + valgrind? ( dev-util/valgrind ) " # autoconf-archive needed to eautoreconf BDEPEND=" @@ -216,6 +217,7 @@ src_configure() { $(use_with lto) $(use_enable pgo optimizations) + $(use_with valgrind) ) # disable implicit optimization/debugging flags |