Subject: bug#20765: closed (Re: bug#20765: Compressed eggs (Python))

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 17 Dec 2016 18:44:02 +0000

Your bug report

#20765: Python .egg files must not be compressed

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
20765: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20765
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#20765: Compressed eggs (Python)
From: Leo Famulari <[email-masked]>
To: Hartmut Goebel <[email-masked]>
Cc: [email-masked]
Date: Sat, 17 Dec 2016 13:43:34 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

>From what I can see, this bug is fixed by the new Python build system
introduced in commit 03e856ddf5d28bc61144effb1a393b73cb4a2d9f.

Please re-open the bug if I am mistaken.

Subject: Python .egg files must not be compressed
From: [email-masked] (Ludovic Courtès)
To: [email-masked]
Cc: Ricardo Wurmus <[email-masked]>, [email-masked]
Date: Sun, 07 Jun 2015 22:37:19 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

The other day on IRC Ricardo and 宋文武 noted that python-pillow
currently comes with a compressed egg.  Because it is compressed, the
daemon’s conservative scanning fails to see what store items it refers
to; in particular Ricardo noted that on his machine, python-pillow
refers to a non-existent store item for OpenJPEG.

To fix that, python-build-system must be tweaked to ask for uncompressed
eggs.  I tried the attached patch, which uses the ‘--always-unzip’
option of easyinstall.

Unfortunately, that option is unsupported by some setup.py, such as that
of setuptools itself.

What would be the right way to do that?

TIA.  :-)

Ludo’.

--- a/guix/build/python-build-system.scm
+++ b/guix/build/python-build-system.scm
@@ -60,14 +60,20 @@
                   #:allow-other-keys)
   "Install a given Python package."
   (let* ((out (assoc-ref outputs "out"))
-         (params (append (list (string-append "--prefix=" out))
+         (params (cons* (string-append "--prefix=" out)
+
+                        ;; Make sure the .egg files are kept unzipped,
+                        ;; otherwise the daemon's conservative scanning may
+                        ;; not find store references embedded in it.
+                        "--always-unzip"
+
                         configure-flags))
          (python-version (get-python-version (assoc-ref inputs "python")))
          (old-path (getenv "PYTHONPATH"))
          (add-path (string-append out "/lib/python" python-version
                                   "/site-packages/")))
-        ;; create the module installation directory and add it to PYTHONPATH
-        ;; to make setuptools happy
+    ;; Create the module installation directory and add it to PYTHONPATH
+    ;; to make setuptools happy.
     (mkdir-p add-path)
     (setenv "PYTHONPATH"
             (string-append (if old-path