diff options
author | Sam James <sam@gentoo.org> | 2022-03-18 19:31:21 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-03-19 00:05:46 +0000 |
commit | d5d4b491db81d7cfc47093f66dfbd097fc4a2dc2 (patch) | |
tree | 72c6d5882a35d913635bdbaba9393dac4be8b280 /dev-lang | |
parent | sys-libs/binutils-libs: Remove old (diff) | |
download | gentoo-d5d4b491db81d7cfc47093f66dfbd097fc4a2dc2.tar.gz gentoo-d5d4b491db81d7cfc47093f66dfbd097fc4a2dc2.tar.bz2 gentoo-d5d4b491db81d7cfc47093f66dfbd097fc4a2dc2.zip |
dev-lang/python: save/restore PYTHONDONTWRITEBYTECODE for USE=pgo
This avoids writing bytecode when we call has_version (or make
any other calls). But we do need it on for the 'emake' call
when building w/ USE=pgo.
Save & restore the value from the environment before/after
emake if building with PGO.
Closes: https://bugs.gentoo.org/831897
Signed-off-by: Sam James <sam@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/24642
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/python-3.10.3.ebuild | 8 | ||||
-rw-r--r-- | dev-lang/python/python-3.11.0_alpha6.ebuild | 8 | ||||
-rw-r--r-- | dev-lang/python/python-3.9.11.ebuild | 8 |
3 files changed, 24 insertions, 0 deletions
diff --git a/dev-lang/python/python-3.10.3.ebuild b/dev-lang/python/python-3.10.3.ebuild index 478b5c1af9db..8378f90040c5 100644 --- a/dev-lang/python/python-3.10.3.ebuild +++ b/dev-lang/python/python-3.10.3.ebuild @@ -236,6 +236,11 @@ src_compile() { # https://bugs.gentoo.org/823728 export SETUPTOOLS_USE_DISTUTILS=stdlib + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + if use pgo ; then # bug 660358 local -x COLUMNS=80 @@ -248,6 +253,9 @@ src_compile() { # in _sysconfigdata* emake CPPFLAGS= CFLAGS= LDFLAGS= + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + # Work around bug 329499. See also bug 413751 and 457194. if has_version dev-libs/libffi[pax-kernel]; then pax-mark E python diff --git a/dev-lang/python/python-3.11.0_alpha6.ebuild b/dev-lang/python/python-3.11.0_alpha6.ebuild index ffe6244b6927..ee3604d253a3 100644 --- a/dev-lang/python/python-3.11.0_alpha6.ebuild +++ b/dev-lang/python/python-3.11.0_alpha6.ebuild @@ -226,6 +226,11 @@ src_compile() { export SETUPTOOLS_USE_DISTUTILS=stdlib export PYTHONSTRICTEXTENSIONBUILD=1 + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + if use pgo ; then # bug 660358 local -x COLUMNS=80 @@ -238,6 +243,9 @@ src_compile() { # in _sysconfigdata* emake CPPFLAGS= CFLAGS= LDFLAGS= + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + # Work around bug 329499. See also bug 413751 and 457194. if has_version dev-libs/libffi[pax-kernel]; then pax-mark E python diff --git a/dev-lang/python/python-3.9.11.ebuild b/dev-lang/python/python-3.9.11.ebuild index a71a3caa791d..418a21b762a8 100644 --- a/dev-lang/python/python-3.9.11.ebuild +++ b/dev-lang/python/python-3.9.11.ebuild @@ -221,6 +221,11 @@ src_compile() { # https://bugs.gentoo.org/823728 export SETUPTOOLS_USE_DISTUTILS=stdlib + # Save PYTHONDONTWRITEBYTECODE so that 'has_version' doesn't + # end up writing bytecode & violating sandbox. + # bug #831897 + local -x _PYTHONDONTWRITEBYTECODE=${PYTHONDONTWRITEBYTECODE} + if use pgo ; then # bug 660358 local -x COLUMNS=80 @@ -233,6 +238,9 @@ src_compile() { # in _sysconfigdata* emake CPPFLAGS= CFLAGS= LDFLAGS= + # Restore saved value from above. + local -x PYTHONDONTWRITEBYTECODE=${_PYTHONDONTWRITEBYTECODE} + # Work around bug 329499. See also bug 413751 and 457194. if has_version dev-libs/libffi[pax-kernel]; then pax-mark E python |