unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars-Dominik Braun <lars@6xq.net>
To: Tanguy LE CARROUR <tanguy@bioneland.org>
Cc: 60240@debbugs.gnu.org
Subject: [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next.
Date: Sat, 2 Mar 2024 10:59:23 +0100	[thread overview]
Message-ID: <ZeL4e8_uI24-2OGc@noor.fritz.box> (raw)
In-Reply-To: <170893592338.2024.18126018474930945065@bioneland.org>

[-- Attachment #1: Type: text/plain, Size: 1792 bytes --]

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


[-- Attachment #2: python-3.12-remove-tk-tcl-refs.patch --]
[-- Type: text/plain, Size: 1901 bytes --]

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

  reply	other threads:[~2024-03-02 10:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-21 15:32 [bug#60240] [PATCH] [WIP] gnu: Add python-3.11 Tanguy Le Carrour
2023-01-06 17:36 ` Simon Tournier
2023-01-09 15:59   ` Tanguy LE CARROUR
2023-03-12 23:35 ` [bug#60240] Python 3.10 in core-updates Andreas Enge
2024-02-19 21:27 ` John Kehayias via Guix-patches via
2024-02-20 14:18   ` Tanguy LE CARROUR
2024-02-21 12:13 ` [bug#60240] [PATCH v2] gnu: Add python-3.12 and python-next Tanguy Le Carrour
2024-02-21 18:36   ` Tanguy Le Carrour
2024-02-22  9:07     ` Tanguy LE CARROUR
2024-02-25 14:08   ` Lars-Dominik Braun
2024-02-26  8:25     ` Tanguy LE CARROUR
2024-03-02  9:59       ` Lars-Dominik Braun [this message]
2024-03-06 12:49         ` Tanguy LE CARROUR
2024-03-06 12:55 ` [bug#60240] [PATCH v3] " Tanguy Le Carrour
2024-03-07 18:45 ` [bug#60240] [PATCH v4] " Tanguy Le Carrour
2024-03-07 18:58 ` [bug#60240] [PATCH v5] " Tanguy Le Carrour

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZeL4e8_uI24-2OGc@noor.fritz.box \
    --to=lars@6xq.net \
    --cc=60240@debbugs.gnu.org \
    --cc=tanguy@bioneland.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).