From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id APyrGyr5UWBXVwAA0tVLHw (envelope-from ) for ; Wed, 17 Mar 2021 12:42:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WJGGFyr5UWBmdAAA1q6Kng (envelope-from ) for ; Wed, 17 Mar 2021 12:42:18 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D8E0EB2F for ; Wed, 17 Mar 2021 13:42:17 +0100 (CET) Received: from localhost ([::1]:43352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMVVA-0005Tz-Ob for larch@yhetil.org; Wed, 17 Mar 2021 08:42:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34310) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMVUx-0005Tf-A3 for guix-patches@gnu.org; Wed, 17 Mar 2021 08:42:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58997) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMVUw-0005M6-4e for guix-patches@gnu.org; Wed, 17 Mar 2021 08:42:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lMVUw-0003g3-0e for guix-patches@gnu.org; Wed, 17 Mar 2021 08:42:02 -0400 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1615984937; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=imd+git0nxFZcgqLS3XPL2oSlzKNpkDWC35rOVt1Xq0=; b=BjcSgLHDNtL2a5F4F/NFVAkFJpinu+JDjBOPh9cecXk4h5lsnBHESMOBvconfVTN5cxPUW cbcrTHFKbpI5QXbv5xuheYzDeUwjBQDeyXHPODNufb0zAEuALB/wGc78e6rj6cQ/9Yhr9F j6TfRuAK58XB9MnbNQeVbDaN25iRkaQKCWJIb5CvcxT8NcpYXFaOoEAoH/pUB/WtD7tfwT 6D/12zvJpkbs+Gyqynn1r2tNncLx5eaQXjRs27fQQFYIaGKM2BFcFSuTg8oXhjYh9a/Q4t qbysehpXsrSgusUbzDEplKXhb3uvY2h2XNUVJdsLdfqa46Gv4mMOP778ithCTw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1615984937; a=rsa-sha256; cv=none; b=QHIYYdqaWlBPrMfx36SDVPFMqX0ERGkb2nCbmaqRJEOITgOj4jDP9lyUEIhXNVZlR0T54U cCOGD2RmdD3RS9O7qoqz1mlows9gLi++4wfzg9v8rNDvbN9NhYTnGg14lvOrPtLo+7ChMd Y8P2dNm7IM/1q5whbKDNmxb4QEI59rYde+WEaYDlLFr05B6atUbkdp5KA86q5GZ4oSIRse 7mWaQaen6zzsi9kSIIh7S++islwAueTyFRaswfSgYQj60rIAqXR2qp92DNketMHaYcGDgA 5I33gXU2ndRT5S1AJc1qD0JoHRCRUkuyd8qMx4lwjhWPGEHCm6il6tVmMD4VGw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=lDYdY5MG; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -1.30 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lepiller.eu header.s=dkim header.b=lDYdY5MG; dmarc=fail reason="SPF not aligned (relaxed)" header.from=lepiller.eu (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 8D8E0EB2F X-Spam-Score: -1.30 X-Migadu-Scanner: scn0.migadu.com X-TUID: yjcLEFomuzqj --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--