From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 53390158087 for ; Wed, 17 Nov 2021 10:49:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1F414E07FE; Wed, 17 Nov 2021 10:49:46 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E2FBCE07FE for ; Wed, 17 Nov 2021 10:49:45 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id ED886342E41 for ; Wed, 17 Nov 2021 10:49:43 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 793AC1CC for ; Wed, 17 Nov 2021 10:49:41 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1637146157.074a78fe03e77fe3337dae773c3d46d0af47eb95.sam@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/python/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/python/python-3.10.0_p1.ebuild dev-lang/python/python-3.9.9.ebuild X-VCS-Directories: dev-lang/python/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 074a78fe03e77fe3337dae773c3d46d0af47eb95 X-VCS-Branch: master Date: Wed, 17 Nov 2021 10:49:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 08560bb6-e59f-48b3-a3fa-c7daea59fb65 X-Archives-Hash: 7b2d393570618d83ad814fd9cbd0ed62 commit: 074a78fe03e77fe3337dae773c3d46d0af47eb95 Author: Sam James gentoo org> AuthorDate: Wed Nov 17 10:49:17 2021 +0000 Commit: Sam James gentoo org> CommitDate: Wed Nov 17 10:49:17 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=074a78fe dev-lang/python: backport PGO, LTO to 3.9.x and 3.10.x Bug: https://bugs.gentoo.org/615412 Bug: https://bugs.gentoo.org/700012 Signed-off-by: Sam James gentoo.org> dev-lang/python/python-3.10.0_p1.ebuild | 18 +++++++++++++++++- dev-lang/python/python-3.9.9.ebuild | 18 +++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/dev-lang/python/python-3.10.0_p1.ebuild b/dev-lang/python/python-3.10.0_p1.ebuild index ba5bca461986..b1491cac95e8 100644 --- a/dev-lang/python/python-3.10.0_p1.ebuild +++ b/dev-lang/python/python-3.10.0_p1.ebuild @@ -24,7 +24,7 @@ S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml" +IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -160,6 +160,11 @@ src_configure() { dbmliborder+="${dbmliborder:+:}gdbm" fi + if use pgo; then + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") + export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb" + fi + local myeconfargs=( # glibc-2.30 removes it; since we can't cleanly force-rebuild # Python on glibc upgrade, remove it proactively to give @@ -178,6 +183,9 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + + $(use_with lto) + $(use_enable pgo optimizations) ) OPT="" econf "${myeconfargs[@]}" @@ -197,6 +205,14 @@ src_compile() { # https://bugs.gentoo.org/823728 export SETUPTOOLS_USE_DISTUTILS=stdlib + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict /usr/lib/python3.10/site-packages + fi + emake CPPFLAGS= CFLAGS= LDFLAGS= # Work around bug 329499. See also bug 413751 and 457194. diff --git a/dev-lang/python/python-3.9.9.ebuild b/dev-lang/python/python-3.9.9.ebuild index 8429cdeafe53..492a5a2fcbb2 100644 --- a/dev-lang/python/python-3.9.9.ebuild +++ b/dev-lang/python/python-3.9.9.ebuild @@ -24,7 +24,7 @@ S="${WORKDIR}/${MY_P}" LICENSE="PSF-2" SLOT="${PYVER}" KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" -IUSE="bluetooth build examples gdbm hardened +ncurses +readline +sqlite +ssl test tk wininst +xml" +IUSE="bluetooth build examples gdbm hardened lto +ncurses pgo +readline +sqlite +ssl test tk wininst +xml" RESTRICT="!test? ( test )" # Do not add a dependency on dev-lang/python to this ebuild. @@ -158,6 +158,11 @@ src_configure() { dbmliborder+="${dbmliborder:+:}gdbm" fi + if use pgo; then + local jobs=$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)") + export PROFILE_TASK="-m test -j${jobs} --pgo-extended -x test_gdb" + fi + local myeconfargs=( # glibc-2.30 removes it; since we can't cleanly force-rebuild # Python on glibc upgrade, remove it proactively to give @@ -175,6 +180,9 @@ src_configure() { --without-ensurepip --with-system-expat --with-system-ffi + + $(use_with lto) + $(use_enable pgo optimizations) ) OPT="" econf "${myeconfargs[@]}" @@ -194,6 +202,14 @@ src_compile() { # https://bugs.gentoo.org/823728 export SETUPTOOLS_USE_DISTUTILS=stdlib + if use pgo ; then + # bug 660358 + local -x COLUMNS=80 + local -x PYTHONDONTWRITEBYTECODE= + + addpredict /usr/lib/python3.9/site-packages + fi + emake CPPFLAGS= CFLAGS= LDFLAGS= # Work around bug 329499. See also bug 413751 and 457194.