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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 177CF139360 for ; Thu, 12 Aug 2021 17:04:31 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D6BFBE0903; Thu, 12 Aug 2021 17:04:29 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id BCC6AE0903 for ; Thu, 12 Aug 2021 17:04:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8DE23342B2E for ; Thu, 12 Aug 2021 17:04:28 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D200F8CB for ; Thu, 12 Aug 2021 17:04:24 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1628787859.7a9b4f552e4c93525ab8d3a353bf8c4c1aee5537.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/python-utils-r1.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 7a9b4f552e4c93525ab8d3a353bf8c4c1aee5537 X-VCS-Branch: master Date: Thu, 12 Aug 2021 17:04:24 +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: a683c267-dfdc-47d9-bd74-7cae2c5860ce X-Archives-Hash: 28e66e7c9fce12ef81b4586a464ebcb9 commit: 7a9b4f552e4c93525ab8d3a353bf8c4c1aee5537 Author: Mart Raudsepp gentoo org> AuthorDate: Wed Jun 23 08:26:41 2021 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Aug 12 17:04:19 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7a9b4f55 python-utils-r1.eclass: Enable hardlinking of identical pyc files for py3.9+ Python 3.9 includes a new feature for compileall to automatically hardlink different optimization level cache files if they are identical. Make use of it for python_optimize for some space savings. This however does not cover distutils use cases and python itself. Signed-off-by: Mart Raudsepp gentoo.org> Signed-off-by: Michał Górny gentoo.org> eclass/python-utils-r1.eclass | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index b104b6694ac..ddd1a25e6de 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -601,12 +601,15 @@ python_optimize() { "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" ;; - python*|pypy3) + python3.[5678]|pypy3) # both levels of optimization are separate since 3.5 "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" "${PYTHON}" -O -m compileall -q -f -d "${instpath}" "${d}" "${PYTHON}" -OO -m compileall -q -f -d "${instpath}" "${d}" ;; + python*) + "${PYTHON}" -m compileall -o 0 -o 1 -o 2 --hardlink-dupes -q -f -d "${instpath}" "${d}" + ;; *) "${PYTHON}" -m compileall -q -f -d "${instpath}" "${d}" ;;