From unknown Sun Jun 22 00:45:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47214] [core-updates] gnu: python: Remove unnecessary files Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Mar 2021 12:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 47214 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 47214@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161598488714091 (code B ref -1); Wed, 17 Mar 2021 12:42:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Mar 2021 12:41:27 +0000 Received: from localhost ([127.0.0.1]:42310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMVUN-0003fD-9I for submit@debbugs.gnu.org; Wed, 17 Mar 2021 08:41:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:44948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMVUK-0003f4-Ib for submit@debbugs.gnu.org; Wed, 17 Mar 2021 08:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMVUK-0005Pd-AK for guix-patches@gnu.org; Wed, 17 Mar 2021 08:41:24 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:34172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMVUG-0004q9-Lw for guix-patches@gnu.org; Wed, 17 Mar 2021 08:41:24 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id a6799cc0 for ; Wed, 17 Mar 2021 12:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=byV qRiCk0ghfO9U6ADgatFuL9a/zn0DOEpOU7IYvB50=; b=lDYdY5MG3sE3HlHHpOR N/RhsbBfcUE9gWULubs9o1UMVnq480dh3arP+g9lBD3toqi6cmbT+tbEvFti0qnT ozlqSYHU0vqyR78YvLUQMRBNC/Vwy0WH+HcaYN93oeUDUUPhR56LqOQJHAopqdsG UTI0Qi/LWPyAmPpHYDWZGgccMo9NZfE34sBoahaiGrvRm8HkdsIaAESuNryocEla A0VTwEb4hD4EkctOBw9d/IFhHoin+NzmmxVnNH511GSFAve0k3x6Xtfw77Ap9KXL ef6fDNU6x2bWYuKfNrGJww8Tjq+iXAm57n5PHDchGav0XH2PAi49LqrpPx15enSz F+w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f1b7b027 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Wed, 17 Mar 2021 12:41:12 +0000 (UTC) Date: Wed, 17 Mar 2021 13:41:02 +0100 From: Julien Lepiller Message-ID: <20210317133933.5eb6d325@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/gvFSeXrPwe0kJB=k.sZclOU" Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --MP_/gvFSeXrPwe0kJB=k.sZclOU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Guix! this patch (going to core-updates) removes files from the output of python2 and python3, in an attempt to save some space. First, I noticed that python3 shipped windows binaries in its source distribution and installs them to the output, in lib/python3.8/distutils/command/*.exe, lib/python3.8/site-packages/*.exe and lib/python3.8/site-packages/pip/_vendor/distlib/*.exe. I remove them from the snippet, so they should not be installed anymore. I also noticed that python installs files that were built during the test phase, so I remove them, but we need to check they are not actually needed. Other distros ship them in a separate package, so maybe we could have a separate test output if this is causing issues? I haven't yet tested the patch, because it needs to rebuild part of the bootstrap chain. I'll report progress and update my patch depending on the results! --MP_/gvFSeXrPwe0kJB=k.sZclOU Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-python-Remove-unnecessary-files.patch >From 63ebe5c610ff8587a73641e4139dc14a4d3e379e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Wed, 17 Mar 2021 13:33:22 +0100 Subject: [PATCH] gnu: python: Remove unnecessary files. * gnu/packages/python.scm (python2)[arguments]: Remove files built during the test phase. (python3)[arguments]: Also remove windows binaries shipped with the sources. --- gnu/packages/python.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 49d43ab008..3bb30ca011 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -294,7 +294,16 @@ (not (string-prefix? "test_support." file)))))) - (call-with-output-file "__init__.py" (const #t))))))))) + (call-with-output-file "__init__.py" (const #t)))) + (let ((libdir (string-append out "/lib/" pythonX.Y))) + (for-each + (lambda (directory) + (let ((dir (string-append libdir "/" directory))) + (when (file-exists? dir) + (delete-file-recursively dir)))) + '("email/test" "ctypes/test" "unittest/test" "tkinter/test" + "sqlite3/test" "bsddb/test" "lib-tk/test" "lib2to3/tests" + "json/tests" "distutils/tests")))))))) (add-after 'remove-tests 'rebuild-bytecode (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -424,6 +433,9 @@ data types.") (substitute* "Modules/Setup" ;; Link Expat instead of embedding the bundled one. (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n")) + ;; Delete windows binaries + (for-each delete-file + (find-files "Lib/distutils/command" ".*.exe$")) #t)))) (arguments (substitute-keyword-arguments (package-arguments python-2) -- 2.30.0 --MP_/gvFSeXrPwe0kJB=k.sZclOU-- From unknown Sun Jun 22 00:45:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47214] [core-updates] gnu: python: Remove unnecessary files Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 17 Mar 2021 19:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47214 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Julien Lepiller Cc: 47214@debbugs.gnu.org Received: via spool by 47214-submit@debbugs.gnu.org id=B47214.161600899629528 (code B ref 47214); Wed, 17 Mar 2021 19:24:02 +0000 Received: (at 47214) by debbugs.gnu.org; 17 Mar 2021 19:23:16 +0000 Received: from localhost ([127.0.0.1]:44001 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMblD-0007gB-Mk for submit@debbugs.gnu.org; Wed, 17 Mar 2021 15:23:16 -0400 Received: from flashner.co.il ([178.62.234.194]:59790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMblC-0007fy-50 for 47214@debbugs.gnu.org; Wed, 17 Mar 2021 15:23:14 -0400 Received: from localhost (unknown [31.210.181.184]) by flashner.co.il (Postfix) with ESMTPSA id 82C3E40501; Wed, 17 Mar 2021 19:23:07 +0000 (UTC) Date: Wed, 17 Mar 2021 21:22:30 +0200 From: Efraim Flashner Message-ID: References: <20210317133933.5eb6d325@tachikoma.lepiller.eu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="IfWW+poehKKYBgWH" Content-Disposition: inline In-Reply-To: <20210317133933.5eb6d325@tachikoma.lepiller.eu> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --IfWW+poehKKYBgWH Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 17, 2021 at 01:41:02PM +0100, Julien Lepiller wrote: > Hi Guix! >=20 > this patch (going to core-updates) removes files from the output of > python2 and python3, in an attempt to save some space. First, I noticed > that python3 shipped windows binaries in its source distribution and > installs them to the output, in lib/python3.8/distutils/command/*.exe, > lib/python3.8/site-packages/*.exe and > lib/python3.8/site-packages/pip/_vendor/distlib/*.exe. I remove them > from the snippet, so they should not be installed anymore. >=20 > I also noticed that python installs files that were built during the > test phase, so I remove them, but we need to check they are not > actually needed. Other distros ship them in a separate package, so > maybe we could have a separate test output if this is causing issues? >=20 > I haven't yet tested the patch, because it needs to rebuild part of the > bootstrap chain. I'll report progress and update my patch depending > on the results! I got stuck on python-minimal with test-asyncio but then it didn't hang the second time I ran the build. I don't have a good pure python package I can think of to test the change. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --IfWW+poehKKYBgWH Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmBSVvYACgkQQarn3Mo9 g1FO4Q//aDeA/4fEkDC7zR3Epu4Dm8xZcrjJvMVVtEDBthdUqB27AskQBGGl2ADd g0L7gF1bQdATpOBcbC0UCoiiLdTeaSIPzfL/+4rlcr4o7ebO1gSbLrlJPf9RzFdN 3ujkyaUWTfT5cUs/m5Xsh9J321Nl7/9/ii0hnoSE4t+DnMElHIJB5RFYHcLbTy7F CS6BiPRzlcCHKt3c/jeGVpM+yGRCg0Et86GlvBIeTJ7LYHKY0LEOYwBnRcyogLHG 9WQfj6oNcIvdjjNf1KgGv8waW4mYQ3/kyhRB2D4epiZh8pGezgdKfnYOeWGcr6OE J6QMeANx4tXI/fBYoPBpmRUiMpf0fNP3Zz9RiWK1OFUsejBvrMAZ/FPGCxgSAjk9 4vAd9IeBXnBQwqBokwS36r29Nz3jLAo4cY9U3vUjrPgrSM3REOBGmrvdpfhUZw9O MvnMsW9HCyq7IpYJZKKovQHu2LSIoIsh+oU538sypWFyss/ZE9F1HSeBYDW9uDHQ ijKv8wdX472vGRP6V4T8o6S99gi8QcZdhIRaczDwWIH+9C6rxnALmTvBoQITJJZR JBESDoN2bcRQ1/Ty2l7UB/d3mEmWrOWbAdmyovCuiQzw7WxKhiWiNMJrurXABRSK vk96dq+onqvyQpiHo2zw9wRiP0olBClIC7u6CEk6krK+gLNrcPg= =bPap -----END PGP SIGNATURE----- --IfWW+poehKKYBgWH-- From unknown Sun Jun 22 00:45:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47214] [core-updates] gnu: python: Remove unnecessary files Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 18 Mar 2021 23:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47214 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 47214@debbugs.gnu.org Received: via spool by 47214-submit@debbugs.gnu.org id=B47214.1616108932444 (code B ref 47214); Thu, 18 Mar 2021 23:09:01 +0000 Received: (at 47214) by debbugs.gnu.org; 18 Mar 2021 23:08:52 +0000 Received: from localhost ([127.0.0.1]:48298 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lN1ky-00006w-VL for submit@debbugs.gnu.org; Thu, 18 Mar 2021 19:08:52 -0400 Received: from lepiller.eu ([89.234.186.109]:41416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lN1kv-00006h-N7 for 47214@debbugs.gnu.org; Thu, 18 Mar 2021 19:08:43 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id f9dcac84 for <47214@debbugs.gnu.org>; Thu, 18 Mar 2021 23:08:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:in-reply-to:references:mime-version :content-type; s=dkim; bh=VN1MbdFM4NAFW3DsAvhQt5z3JKybz2eNMp5ovB UgJdY=; b=emEqftl5qTLeWiV1MZHbonEvp+d578bJ+T7dwBIKtbcgeVwhbdY+l/ z8xBfcQTwNI2aR9Fwm+2Y+uT4SJcQjGYlavHfX8IbBZ+7Pq8c8C5zqyvmL21IcJd MpmmNAl/c3lgcvLxjYfS/DkdpxDj/b9WIXx0yNA7T4JBI+e10y0u+JIL62YJicnz Y+P8Hi6vu92BO0AQW1j2mrVOeN19OLdwrFliJlFFTM2NPIwFFuQOiSBMO7hw7CVZ gi0Zfp5IUXcPQNNWa/nuw3z4yz4xHO2yNDzdUEBCSfepIQ0hz+9/PauFj1b+UdI9 VAURRh2crZbPGn2Plbn0p/lyp7cqz4Vw== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 14d17a30 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for <47214@debbugs.gnu.org>; Thu, 18 Mar 2021 23:08:39 +0000 (UTC) Date: Fri, 19 Mar 2021 00:08:30 +0100 From: Julien Lepiller Message-ID: <20210319000830.23926447@tachikoma.lepiller.eu> In-Reply-To: <20210317133933.5eb6d325@tachikoma.lepiller.eu> References: <20210317133933.5eb6d325@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/BvVfmi5qYD=sir.c_HBijZC" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --MP_/BvVfmi5qYD=sir.c_HBijZC Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Le Wed, 17 Mar 2021 13:41:02 +0100, Julien Lepiller a =C3=A9crit : > Hi Guix! >=20 > this patch (going to core-updates) removes files from the output of > python2 and python3, in an attempt to save some space. First, I > noticed that python3 shipped windows binaries in its source > distribution and installs them to the output, in > lib/python3.8/distutils/command/*.exe, > lib/python3.8/site-packages/*.exe and > lib/python3.8/site-packages/pip/_vendor/distlib/*.exe. I remove them > from the snippet, so they should not be installed anymore. >=20 > I also noticed that python installs files that were built during the > test phase, so I remove them, but we need to check they are not > actually needed. Other distros ship them in a separate package, so > maybe we could have a separate test output if this is causing issues? >=20 > I haven't yet tested the patch, because it needs to rebuild part of > the bootstrap chain. I'll report progress and update my patch > depending on the results! I discovered other .exe in python3, so this updated patch deletes them. Since I modify the python from commencement.scm by changing a phase in python-2.7, I decided to also change the definition there to remove the offending files. I managed to build up to python-3.9 without any issue, but haven't tested building more than a handful of python packages. --MP_/BvVfmi5qYD=sir.c_HBijZC Content-Type: text/x-patch Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename=0001-gnu-python-Remove-unnecessary-files.patch =46rom 0d2d9a32cbbf24eadf74271b2fb1304b7a72d281 Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Wed, 17 Mar 2021 13:33:22 +0100 Subject: [PATCH 1/2] gnu: python: Remove unnecessary files. * gnu/packages/python.scm (python2)[arguments]: Remove files built during the test phase. (python3)[arguments]: Also remove windows binaries shipped with the sources. --- gnu/packages/commencement.scm | 9 ++++++++- gnu/packages/python.scm | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index b2921a4a48..b2b9651444 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -10,6 +10,7 @@ ;;; Copyright =C2=A9 2020 Timothy Sample ;;; Copyright =C2=A9 2020 Guy Fleury Iteriteka ;;; Copyright =C2=A9 2021 Maxim Cournoyer +;;; Copyright =C2=A9 2021 Julien Lepiller ;;; ;;; This file is part of GNU Guix. ;;; @@ -3098,7 +3099,12 @@ memoized as a function of '%current-system'." (delete-file-recursively "Modules/expat") (substitute* "Modules/Setup.dist" ;; Link Expat instead of embedding the bundled one. - (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))))))) + (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n")) + ;; Delete windows binaries + (for-each delete-file + (find-files "Lib/distutils/command" ".*.exe$"= )) + (for-each delete-file + (find-files "Lib/ensurepip" ".*.whl$"))))))) (inputs `(,@(%boot0-inputs) ("expat" ,expat-sans-tests))) ;remove OpenSSL, zlib, e= tc. @@ -3129,6 +3135,7 @@ memoized as a function of '%current-system'." ('add-after unpack apply-alignmen= t-patch _)) `(modify-phases ,original-phases ,@= changes)) (_ phases))) + (delete 'remove-windows-binaries) (add-before 'configure 'disable-modules (lambda _ (substitute* "setup.py" diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 49d43ab008..da9859b11a 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -31,7 +31,7 @@ ;;; Copyright =C2=A9 2016 Dylan Jeffers ;;; Copyright =C2=A9 2016, 2017 Alex Vong ;;; Copyright =C2=A9 2016, 2017, 2018 Arun Isaac -;;; Copyright =C2=A9 2016, 2017, 2018 Julien Lepiller +;;; Copyright =C2=A9 2016, 2017, 2018, 2021 Julien Lepiller ;;; Copyright =C2=A9 2016, 2017, 2018 Tobias Geerinckx-Rice ;;; Copyright =C2=A9 2016, 2017 Thomas Danckaert ;;; Copyright =C2=A9 2017 Carlo Zancanaro @@ -294,7 +294,16 @@ (not (string-prefix? "test_support= ." file)))))) - (call-with-output-file "__init__.py" (const #t))))))= ))) + (call-with-output-file "__init__.py" (const #t)))) + (let ((libdir (string-append out "/lib/" pythonX.Y))) + (for-each + (lambda (directory) + (let ((dir (string-append libdir "/" directory))) + (when (file-exists? dir) + (delete-file-recursively dir)))) + '("email/test" "ctypes/test" "unittest/test" "tkinter= /test" + "sqlite3/test" "bsddb/test" "lib-tk/test" "lib2to3/= tests" + "json/tests" "distutils/tests")))))))) (add-after 'remove-tests 'rebuild-bytecode (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -424,6 +433,9 @@ data types.") (substitute* "Modules/Setup" ;; Link Expat instead of embedding the bundled one. (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n")) + ;; Delete windows binaries + (for-each delete-file + (find-files "Lib/distutils/command" ".*.exe$")) #t)))) (arguments (substitute-keyword-arguments (package-arguments python-2) @@ -469,6 +481,23 @@ data types.") ,@(if (hurd-system?) `((delete 'patch-regen-for-hurd)) ;regen was removed afte= r 3.5.9 '()) + (add-after 'unpack 'remove-windows-binaries + (lambda _ + ;; Delete .exe from embedded .whl (zip) files + (for-each + (lambda (whl) + (let ((dir "whl-content")) + (mkdir-p dir) + (with-directory-excursion dir + (let ((whl (string-append "../" whl))) + (invoke "unzip" whl) + (for-each delete-file + (find-files "." ".*.exe$")) + (delete-file whl) + (apply invoke "zip" "-X" whl + (find-files "." ".*" #:directories? #t)))) + (delete-file-recursively dir))) + (find-files "Lib/ensurepip" ".*.whl$")))) (add-before 'check 'set-TZDIR (lambda* (#:key inputs native-inputs #:allow-other-keys) ;; test_email requires the Olson time zone database. @@ -503,6 +532,8 @@ data types.") ,(customize-site version)))))) (native-inputs `(("tzdata" ,tzdata-for-tests) + ("unzip" ,unzip) + ("zip" ,(@ (gnu packages compression) zip)) ,@(if (%current-target-system) `(("python3" ,this-package)) '()) --=20 2.30.0 --MP_/BvVfmi5qYD=sir.c_HBijZC-- From unknown Sun Jun 22 00:45:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47214] [core-updates] gnu: python: Remove unnecessary files Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 19 Mar 2021 12:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47214 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Julien Lepiller Cc: 47214@debbugs.gnu.org Received: via spool by 47214-submit@debbugs.gnu.org id=B47214.161615683922769 (code B ref 47214); Fri, 19 Mar 2021 12:28:02 +0000 Received: (at 47214) by debbugs.gnu.org; 19 Mar 2021 12:27:19 +0000 Received: from localhost ([127.0.0.1]:49007 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNEDm-0005vB-N3 for submit@debbugs.gnu.org; Fri, 19 Mar 2021 08:27:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lNEDk-0005uu-FY for 47214@debbugs.gnu.org; Fri, 19 Mar 2021 08:27:16 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:32823) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNEDe-0002Ce-FV; Fri, 19 Mar 2021 08:27:10 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=57552 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1lNEDc-0004Vz-Mp; Fri, 19 Mar 2021 08:27:09 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210317133933.5eb6d325@tachikoma.lepiller.eu> <20210319000830.23926447@tachikoma.lepiller.eu> Date: Fri, 19 Mar 2021 13:27:06 +0100 In-Reply-To: <20210319000830.23926447@tachikoma.lepiller.eu> (Julien Lepiller's message of "Fri, 19 Mar 2021 00:08:30 +0100") Message-ID: <87k0q3fhwl.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Hi Julien, Julien Lepiller skribis: > Le Wed, 17 Mar 2021 13:41:02 +0100, > Julien Lepiller a =C3=A9crit : > >> Hi Guix! >>=20 >> this patch (going to core-updates) removes files from the output of >> python2 and python3, in an attempt to save some space. First, I >> noticed that python3 shipped windows binaries in its source >> distribution and installs them to the output, in >> lib/python3.8/distutils/command/*.exe, >> lib/python3.8/site-packages/*.exe and >> lib/python3.8/site-packages/pip/_vendor/distlib/*.exe. I remove them >> from the snippet, so they should not be installed anymore. >>=20 >> I also noticed that python installs files that were built during the >> test phase, so I remove them, but we need to check they are not >> actually needed. Other distros ship them in a separate package, so >> maybe we could have a separate test output if this is causing issues? >>=20 >> I haven't yet tested the patch, because it needs to rebuild part of >> the bootstrap chain. I'll report progress and update my patch >> depending on the results! > > I discovered other .exe in python3, so this updated patch deletes them. > Since I modify the python from commencement.scm by changing a phase in > python-2.7, I decided to also change the definition there to remove the > offending files. Woow, good catch. > From 0d2d9a32cbbf24eadf74271b2fb1304b7a72d281 Mon Sep 17 00:00:00 2001 > From: Julien Lepiller > Date: Wed, 17 Mar 2021 13:33:22 +0100 > Subject: [PATCH 1/2] gnu: python: Remove unnecessary files. > > * gnu/packages/python.scm (python2)[arguments]: Remove files built > during the test phase. > (python3)[arguments]: Also remove windows binaries shipped with the > sources. Unless it causes bootstrapping issues, I recommend removing those files from a snippet so that =E2=80=98guix build -S python=E2=80=99 returns the c= leaned-up source. WDYT? Thanks, Ludo=E2=80=99. From unknown Sun Jun 22 00:45:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47214] [core-updates] gnu: python: Remove unnecessary files Resent-From: Julien Lepiller Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Jun 2021 01:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47214 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 47214@debbugs.gnu.org Received: via spool by 47214-submit@debbugs.gnu.org id=B47214.162268541128967 (code B ref 47214); Thu, 03 Jun 2021 01:57:01 +0000 Received: (at 47214) by debbugs.gnu.org; 3 Jun 2021 01:56:51 +0000 Received: from localhost ([127.0.0.1]:41637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1locbK-0007X8-PX for submit@debbugs.gnu.org; Wed, 02 Jun 2021 21:56:50 -0400 Received: from lepiller.eu ([89.234.186.109]:39224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1locbH-0007Ww-Sg for 47214@debbugs.gnu.org; Wed, 02 Jun 2021 21:56:48 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id c2dd92d9; Thu, 3 Jun 2021 01:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=XRm8qjnxiVhW AkZ0SIXOiE+3IV9J0rkEJgQN+Eg0kqQ=; b=iH/L5zKsVdLiFh+0PPeh7yI8k3oI R2Nbsz7sgcnQZd64qRTY+dUwNC1Yilk6qXvKCDvOp5QOZ5p40Vb2Z5AOVyprM50n o0GnVv7ihs4Syg6DowYzOXMqyVFYZdl+W3asZjNqosM7piGuZCkNc8H6EXg2hfaj DXbHfZWD3A7aIWqUSZ7nxZSTjtbyoOK7P8s6wZxDam/ElCWImFzeZWZ7vPzLJW+u t5yXa2Tmog/TCMNXA6VfMlBJ7C36VU7axSMJyc7bsQEY/xSffPGqSLB0A79vl+hf Jn10TTQ28bLktcnpifeS/Kw5hNVaCi9QTEc9hpRWFf3rotWEH46laR7aIA== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f8b73cb9 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Thu, 3 Jun 2021 01:56:45 +0000 (UTC) Date: Thu, 3 Jun 2021 03:56:38 +0200 From: Julien Lepiller Message-ID: <20210603035638.6e6fe473@tachikoma.lepiller.eu> In-Reply-To: <87k0q3fhwl.fsf_-_@gnu.org> References: <20210317133933.5eb6d325@tachikoma.lepiller.eu> <20210319000830.23926447@tachikoma.lepiller.eu> <87k0q3fhwl.fsf_-_@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Fri, 19 Mar 2021 13:27:06 +0100, Ludovic Court=C3=A8s a =C3=A9crit : > > From 0d2d9a32cbbf24eadf74271b2fb1304b7a72d281 Mon Sep 17 00:00:00 > > 2001 From: Julien Lepiller > > Date: Wed, 17 Mar 2021 13:33:22 +0100 > > Subject: [PATCH 1/2] gnu: python: Remove unnecessary files. > > > > * gnu/packages/python.scm (python2)[arguments]: Remove files built > > during the test phase. > > (python3)[arguments]: Also remove windows binaries shipped with the > > sources. =20 >=20 > Unless it causes bootstrapping issues, I recommend removing those > files from a snippet so that =E2=80=98guix build -S python=E2=80=99 retur= ns the > cleaned-up source. >=20 > WDYT? >=20 > Thanks, > Ludo=E2=80=99. Hi, sorry for the late reply. I need to use unzip on these files to remove some of their content, and rezip them later. How can I do that from a snippet? From unknown Sun Jun 22 00:45:31 2025 X-Loop: help-debbugs@gnu.org Subject: [bug#47214] [core-updates] gnu: python: Remove unnecessary files Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Jun 2021 09:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47214 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Julien Lepiller Cc: 47214@debbugs.gnu.org Received: via spool by 47214-submit@debbugs.gnu.org id=B47214.162271361428788 (code B ref 47214); Thu, 03 Jun 2021 09:47:02 +0000 Received: (at 47214) by debbugs.gnu.org; 3 Jun 2021 09:46:54 +0000 Received: from localhost ([127.0.0.1]:42413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lojwE-0007U3-Ed for submit@debbugs.gnu.org; Thu, 03 Jun 2021 05:46:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33870) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lojwC-0007Op-1k for 47214@debbugs.gnu.org; Thu, 03 Jun 2021 05:46:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34344) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lojw6-0003qo-Kd; Thu, 03 Jun 2021 05:46:46 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=59542 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lojw6-0002l2-CI; Thu, 03 Jun 2021 05:46:46 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210317133933.5eb6d325@tachikoma.lepiller.eu> <20210319000830.23926447@tachikoma.lepiller.eu> <87k0q3fhwl.fsf_-_@gnu.org> <20210603035638.6e6fe473@tachikoma.lepiller.eu> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 15 Prairial an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 03 Jun 2021 11:46:44 +0200 In-Reply-To: <20210603035638.6e6fe473@tachikoma.lepiller.eu> (Julien Lepiller's message of "Thu, 3 Jun 2021 03:56:38 +0200") Message-ID: <87a6o7wa9n.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Julien Lepiller skribis: > Le Fri, 19 Mar 2021 13:27:06 +0100, > Ludovic Court=C3=A8s a =C3=A9crit : > >> > From 0d2d9a32cbbf24eadf74271b2fb1304b7a72d281 Mon Sep 17 00:00:00 >> > 2001 From: Julien Lepiller >> > Date: Wed, 17 Mar 2021 13:33:22 +0100 >> > Subject: [PATCH 1/2] gnu: python: Remove unnecessary files. >> > >> > * gnu/packages/python.scm (python2)[arguments]: Remove files built >> > during the test phase. >> > (python3)[arguments]: Also remove windows binaries shipped with the >> > sources.=20=20 >>=20 >> Unless it causes bootstrapping issues, I recommend removing those >> files from a snippet so that =E2=80=98guix build -S python=E2=80=99 retu= rns the >> cleaned-up source. [...] > Hi, sorry for the late reply. I need to use unzip on these files to > remove some of their content, and rezip them later. How can I do that > from a snippet? Oh right, the bit that unzips/rezips .whl files cannot easily be done from a snippet, so better keep it as a phase. Deleting *.exe can be done from a snippet though. BTW, the patch reads: (find-files "Lib/distutils/command" ".*.exe$") but the regexp should be: "\\.exe$" (=E2=80=9C.*=E2=80=9D is unnecessary, but the dot before =E2=80=9Cexe=E2=80= =9D must be protected.) Likewise for: (find-files "Lib/ensurepip" ".*.whl$") Thanks, Ludo=E2=80=99. From unknown Sun Jun 22 00:45:31 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Julien Lepiller Subject: bug#47214: closed (Re: bug#47214: [core-updates] gnu: python: Remove unnecessary files) Message-ID: References: <20210611030126.25fa8606@tachikoma.lepiller.eu> <20210317133933.5eb6d325@tachikoma.lepiller.eu> X-Gnu-PR-Message: they-closed 47214 X-Gnu-PR-Package: guix-patches Reply-To: 47214@debbugs.gnu.org Date: Fri, 11 Jun 2021 01:02:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1623373323-1058-1" This is a multi-part message in MIME format... ------------=_1623373323-1058-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #47214: [core-updates] gnu: python: Remove unnecessary files which was filed against the guix-patches package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 47214@debbugs.gnu.org. --=20 47214: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D47214 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1623373323-1058-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 47214-done) by debbugs.gnu.org; 11 Jun 2021 01:01:42 +0000 Received: from localhost ([127.0.0.1]:37883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrVYM-0000GA-4u for submit@debbugs.gnu.org; Thu, 10 Jun 2021 21:01:42 -0400 Received: from lepiller.eu ([89.234.186.109]:44248) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lrVYG-0000FK-6h for 47214-done@debbugs.gnu.org; Thu, 10 Jun 2021 21:01:37 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id 21e64764; Fri, 11 Jun 2021 01:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:cc:subject:message-id:in-reply-to:references:mime-version :content-type:content-transfer-encoding; s=dkim; bh=JuGTNBAqy06/ mhMz94hGAVZMoIZ7Ti1oxkbGTSCd574=; b=GnuFQICSjh9sBhaN44TssTeW6EmA 4sxclRw2NSNIbhp2S1gNRIyxZbXlyeuPtQKYT129rEIWK0LDH9MFl1rfET/iUBlH e8WszTAMgwRpYokwgSbG2ygAyCav9M0PLi/9iiWz8dNJCmhGWKaVNVzRH37BhXns pHLR5Ge0Y5kjexUycR/y8gTadkOrpsRC/oGbPDHKrCkaG/h5lae/XhHGYiHFlHoV FFlcfvblYeUvIcuvx/VhvKOA/wAcrcy6Xs/yMR9q5b04wNo4Cs9nS3eyEVviHltn KU4eFRpEoH8tvVSPGLNb+JLvhdlNNk10f3bAX9kbgB4oRrwgTrNyg2rcVQ== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id 0c5a9008 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO); Fri, 11 Jun 2021 01:01:33 +0000 (UTC) Date: Fri, 11 Jun 2021 03:01:26 +0200 From: Julien Lepiller To: Ludovic =?UTF-8?B?Q291cnTDqHM=?= Subject: Re: bug#47214: [core-updates] gnu: python: Remove unnecessary files Message-ID: <20210611030126.25fa8606@tachikoma.lepiller.eu> In-Reply-To: <87a6o7wa9n.fsf@gnu.org> References: <20210317133933.5eb6d325@tachikoma.lepiller.eu> <20210319000830.23926447@tachikoma.lepiller.eu> <87k0q3fhwl.fsf_-_@gnu.org> <20210603035638.6e6fe473@tachikoma.lepiller.eu> <87a6o7wa9n.fsf@gnu.org> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 47214-done Cc: 47214-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Le Thu, 03 Jun 2021 11:46:44 +0200, Ludovic Court=C3=A8s a =C3=A9crit : > Hi, >=20 > Julien Lepiller skribis: >=20 > > Le Fri, 19 Mar 2021 13:27:06 +0100, > > Ludovic Court=C3=A8s a =C3=A9crit : > > =20 > >> > From 0d2d9a32cbbf24eadf74271b2fb1304b7a72d281 Mon Sep 17 00:00:00 > >> > 2001 From: Julien Lepiller > >> > Date: Wed, 17 Mar 2021 13:33:22 +0100 > >> > Subject: [PATCH 1/2] gnu: python: Remove unnecessary files. > >> > > >> > * gnu/packages/python.scm (python2)[arguments]: Remove files > >> > built during the test phase. > >> > (python3)[arguments]: Also remove windows binaries shipped with > >> > the sources. =20 > >>=20 > >> Unless it causes bootstrapping issues, I recommend removing those > >> files from a snippet so that =E2=80=98guix build -S python=E2=80=99 re= turns the > >> cleaned-up source. =20 >=20 > [...] >=20 > > Hi, sorry for the late reply. I need to use unzip on these files to > > remove some of their content, and rezip them later. How can I do > > that from a snippet? =20 >=20 > Oh right, the bit that unzips/rezips .whl files cannot easily be done > from a snippet, so better keep it as a phase. >=20 > Deleting *.exe can be done from a snippet though. >=20 > BTW, the patch reads: >=20 > (find-files "Lib/distutils/command" ".*.exe$") >=20 > but the regexp should be: >=20 > "\\.exe$" >=20 > (=E2=80=9C.*=E2=80=9D is unnecessary, but the dot before =E2=80=9Cexe=E2= =80=9D must be protected.) >=20 > Likewise for: >=20 > (find-files "Lib/ensurepip" ".*.whl$") >=20 > Thanks, > Ludo=E2=80=99. Fixed, and pushed as 20d52562e5c943b30e48e310b58b94054c3a54e5 to core-updates. ------------=_1623373323-1058-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 17 Mar 2021 12:41:27 +0000 Received: from localhost ([127.0.0.1]:42310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMVUN-0003fD-9I for submit@debbugs.gnu.org; Wed, 17 Mar 2021 08:41:27 -0400 Received: from lists.gnu.org ([209.51.188.17]:44948) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lMVUK-0003f4-Ib for submit@debbugs.gnu.org; Wed, 17 Mar 2021 08:41:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMVUK-0005Pd-AK for guix-patches@gnu.org; Wed, 17 Mar 2021 08:41:24 -0400 Received: from lepiller.eu ([2a00:5884:8208::1]:34172) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMVUG-0004q9-Lw for guix-patches@gnu.org; Wed, 17 Mar 2021 08:41:24 -0400 Received: from lepiller.eu (localhost [127.0.0.1]) by lepiller.eu (OpenSMTPD) with ESMTP id a6799cc0 for ; Wed, 17 Mar 2021 12:41:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=lepiller.eu; h=date:from :to:subject:message-id:mime-version:content-type; s=dkim; bh=byV qRiCk0ghfO9U6ADgatFuL9a/zn0DOEpOU7IYvB50=; b=lDYdY5MG3sE3HlHHpOR N/RhsbBfcUE9gWULubs9o1UMVnq480dh3arP+g9lBD3toqi6cmbT+tbEvFti0qnT ozlqSYHU0vqyR78YvLUQMRBNC/Vwy0WH+HcaYN93oeUDUUPhR56LqOQJHAopqdsG UTI0Qi/LWPyAmPpHYDWZGgccMo9NZfE34sBoahaiGrvRm8HkdsIaAESuNryocEla A0VTwEb4hD4EkctOBw9d/IFhHoin+NzmmxVnNH511GSFAve0k3x6Xtfw77Ap9KXL ef6fDNU6x2bWYuKfNrGJww8Tjq+iXAm57n5PHDchGav0XH2PAi49LqrpPx15enSz F+w== Received: by lepiller.eu (OpenSMTPD) with ESMTPSA id f1b7b027 (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256:NO) for ; Wed, 17 Mar 2021 12:41:12 +0000 (UTC) Date: Wed, 17 Mar 2021 13:41:02 +0100 From: Julien Lepiller To: guix-patches@gnu.org Subject: [core-updates] gnu: python: Remove unnecessary files Message-ID: <20210317133933.5eb6d325@tachikoma.lepiller.eu> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/gvFSeXrPwe0kJB=k.sZclOU" Received-SPF: pass client-ip=2a00:5884:8208::1; envelope-from=julien@lepiller.eu; helo=lepiller.eu X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --MP_/gvFSeXrPwe0kJB=k.sZclOU Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Guix! this patch (going to core-updates) removes files from the output of python2 and python3, in an attempt to save some space. First, I noticed that python3 shipped windows binaries in its source distribution and installs them to the output, in lib/python3.8/distutils/command/*.exe, lib/python3.8/site-packages/*.exe and lib/python3.8/site-packages/pip/_vendor/distlib/*.exe. I remove them from the snippet, so they should not be installed anymore. I also noticed that python installs files that were built during the test phase, so I remove them, but we need to check they are not actually needed. Other distros ship them in a separate package, so maybe we could have a separate test output if this is causing issues? I haven't yet tested the patch, because it needs to rebuild part of the bootstrap chain. I'll report progress and update my patch depending on the results! --MP_/gvFSeXrPwe0kJB=k.sZclOU Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=0001-gnu-python-Remove-unnecessary-files.patch >From 63ebe5c610ff8587a73641e4139dc14a4d3e379e Mon Sep 17 00:00:00 2001 From: Julien Lepiller Date: Wed, 17 Mar 2021 13:33:22 +0100 Subject: [PATCH] gnu: python: Remove unnecessary files. * gnu/packages/python.scm (python2)[arguments]: Remove files built during the test phase. (python3)[arguments]: Also remove windows binaries shipped with the sources. --- gnu/packages/python.scm | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 49d43ab008..3bb30ca011 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -294,7 +294,16 @@ (not (string-prefix? "test_support." file)))))) - (call-with-output-file "__init__.py" (const #t))))))))) + (call-with-output-file "__init__.py" (const #t)))) + (let ((libdir (string-append out "/lib/" pythonX.Y))) + (for-each + (lambda (directory) + (let ((dir (string-append libdir "/" directory))) + (when (file-exists? dir) + (delete-file-recursively dir)))) + '("email/test" "ctypes/test" "unittest/test" "tkinter/test" + "sqlite3/test" "bsddb/test" "lib-tk/test" "lib2to3/tests" + "json/tests" "distutils/tests")))))))) (add-after 'remove-tests 'rebuild-bytecode (lambda* (#:key outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) @@ -424,6 +433,9 @@ data types.") (substitute* "Modules/Setup" ;; Link Expat instead of embedding the bundled one. (("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n")) + ;; Delete windows binaries + (for-each delete-file + (find-files "Lib/distutils/command" ".*.exe$")) #t)))) (arguments (substitute-keyword-arguments (package-arguments python-2) -- 2.30.0 --MP_/gvFSeXrPwe0kJB=k.sZclOU-- ------------=_1623373323-1058-1--