From patchwork Sat Mar 2 09:59:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lars-Dominik Braun X-Patchwork-Id: 61284 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4B7A227BBE2; Sat, 2 Mar 2024 10:01:07 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 8E36327BBE9 for ; Sat, 2 Mar 2024 10:01:01 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rgMAi-0006Ys-T4; Sat, 02 Mar 2024 05:00:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rgMAU-0006Rl-A7 for guix-patches@gnu.org; Sat, 02 Mar 2024 05:00:43 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rgMAU-0006d6-1e for guix-patches@gnu.org; Sat, 02 Mar 2024 05:00:34 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rgMAv-0005hf-S0 for guix-patches@gnu.org; Sat, 02 Mar 2024 05:01:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next. Resent-From: Lars-Dominik Braun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 02 Mar 2024 10:01:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60240 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Tanguy LE CARROUR Cc: 60240@debbugs.gnu.org Received: via spool by 60240-submit@debbugs.gnu.org id=B60240.170937363821881 (code B ref 60240); Sat, 02 Mar 2024 10:01:01 +0000 Received: (at 60240) by debbugs.gnu.org; 2 Mar 2024 10:00:38 +0000 Received: from localhost ([127.0.0.1]:38065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgMAX-0005gq-OD for submit@debbugs.gnu.org; Sat, 02 Mar 2024 05:00:38 -0500 Received: from mout-p-202.mailbox.org ([80.241.56.172]:60718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rgMAU-0005gT-H0 for 60240@debbugs.gnu.org; Sat, 02 Mar 2024 05:00:35 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (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 mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Tn0mc1KfSz9t9n; Sat, 2 Mar 2024 10:59:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6xq.net; s=MBO0001; t=1709373568; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xqw65LwZ7Kwzc2G2rPsKhSyj4jgwZhwOUeLOEP+k8zI=; b=lnMa3/YUKxMiShJiiKxVmV77cDFctzs3TC8oVbm/BDxL5xbpbK6n9uX7fxeJThtaV4xTSm NtpjvBUPvAIJ1u3uX2YJWr5BVWlEFO86v4csR7uo+enBhdIr7yPFMmEtTa2Wwz2UWpOj7i g56JeSQmznaeIoApJSP9gWiTHh9HMKt1BXGXdRwRpBi2sCUlyMySEAUb4oTmF1Iwwq9V2s mNKcLrRb8zJWobryMcjh/G3ExbOrKQKdSZL1L9ihwil5sIoDx9FWuZ7gIaznQ36zkny8gD TVemHkdUBagftmgpmMOHLrzPU8LOxOUJ3Gtwd1l1ZyDY5+yb1nxIMRUkYPfWww== Date: Sat, 2 Mar 2024 10:59:23 +0100 From: Lars-Dominik Braun Message-ID: References: <20221221153230.27764-1-tanguy@bioneland.org> <4832d706e706ced5aa8a52f1b63b1e676ea5fd3d.1708516654.git.tanguy@bioneland.org> <170893592338.2024.18126018474930945065@bioneland.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <170893592338.2024.18126018474930945065@bioneland.org> X-Rspamd-Queue-Id: 4Tn0mc1KfSz9t9n 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches Hey, > Sorry, but I’m not sure to see what you mean!? > Outputs are defined for `out`, `tk` and `idle`. And I see phases to move > files to the outputs: `move-tk-inter` and `move-idle`. > > What do you mean by `referenced from out`? And how would you remove such > a reference! so, if you look at `guix size python@3.12`, you can see it lists tk and tcl. And then a `grep -Ri /gnu/store/path/to/tcl /gnu/store/path/to/python` reveals it’s being referenced by lib/python3.12/_sysconfigdata__linux_x86_64-linux-gnu.py and lib/python3.12/config-3.12-x86_64-linux-gnu/Makefile, which are both part of the default “out” output. That means TCL and TK are both part of the closure of the python@3.12 package, i.e. they are downloaded whenever you install it, making the package “bigger” in size (234.5 MiB in total to be precise). I believe we wanted to avoid that by moving some parts of Python into the separate “tk” output. But apparently that does not work (any more). The attached patch (on top of yours) removes these references and shrinks the closure of python@3.12 to 180.6 MiB. But I don’t know whether it has any negative side-effects (i.e. packages not building any more), because I can’t build libxslt with Python 3.12 due to the module “imp” having been removed in Python 3.12. > I searched in the issue list on GH, but couldn’t find anything relevant. > But there are quite a lot of issues there. > Do we have to fix this before we merge it? No, we’d have to dig deeper into which particular test causes this behavior. And actually one more nitpick: The name of the package should be “python-next” not “python”, otherwise `guix install python` will pick Python 3.12 (it’s based on the name property, not the variable name). Cheers, Lars diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 471cf190fb..0b887a2cdb 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -836,7 +836,7 @@ (define-public python-3.12 "json/tests" "distutils/tests")))))))) (add-after 'remove-tests 'move-tk-inter - (lambda* (#:key outputs #:allow-other-keys) + (lambda* (#:key outputs inputs #:allow-other-keys) ;; When Tkinter support is built move it to a separate output so ;; that the main output doesn't contain a reference to Tcl/Tk. (let ((out (assoc-ref outputs "out")) @@ -854,7 +854,14 @@ (define-public python-3.12 len) "/site-packages"))) (install-file tkinter.so target) - (delete-file tkinter.so)))))))) + (delete-file tkinter.so)))) + ;; Remove explicit store path references. + (let ((tcl (assoc-ref inputs "tcl")) + (tk (assoc-ref inputs "tk"))) + (substitute* (find-files (string-append out "/lib") + "^(_sysconfigdata_.*\\.py|Makefile)$") + (((string-append "-L" tk "/lib")) "") + (((string-append "-L" tcl "/lib")) ""))))))) (add-after 'move-tk-inter 'move-idle (lambda* (#:key outputs #:allow-other-keys) ;; when idle is built, move it to a separate output to save some