GNU bug report logs - #52333
[PATCH] Remove extraneous references

Previous Next

Package: guix;

Reported by: Ricardo Wurmus <rekado <at> elephly.net>

Date: Mon, 6 Dec 2021 17:00:02 UTC

Severity: normal

Tags: patch

Done: Ricardo Wurmus <rekado <at> elephly.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 52333 in the body.
You can then email your comments to 52333 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#52333; Package guix. (Mon, 06 Dec 2021 17:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ricardo Wurmus <rekado <at> elephly.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 06 Dec 2021 17:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: bug-guix <at> gnu.org
Subject: [PATCH] Remove extraneous references
Date: Mon, 06 Dec 2021 16:56:09 +0000
Hi Guix,

r-minimal keeps a record of build time inputs in a comment and in a
libtool script.  I don’t know if I may remove them all, but some of them
seem to safe to remove, so that’s what the first patch does.

While I removed texlive-union references from r-minimal, I noticed that
python-nbconvert also does something undesirable: it retains references
to xelatex and bibtex, but takes these from the texlive-union of the
native-inputs.  That seems like a mistake, so I added a regular
texlive-bin input and embedded a reference to *that* instead of the
texlive-union-wrapped scripts.

-- 
Ricardo




Information forwarded to bug-guix <at> gnu.org:
bug#52333; Package guix. (Mon, 06 Dec 2021 17:32:01 GMT) Full text and rfc822 format available.

Message #8 received at 52333 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 52333 <at> debbugs.gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: [PATCH 2/2] gnu: r-minimal: Remove extraneous references.
Date: Mon,  6 Dec 2021 18:30:54 +0100
* gnu/packages/statistics.scm (r-minimal)[arguments]: Remove references to
native build-time tools.
---
 gnu/packages/statistics.scm | 39 ++++++++++++++++++++++++++++++++++++-
 1 file changed, 38 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm
index cf7a64ec7a..599d6a8fc3 100644
--- a/gnu/packages/statistics.scm
+++ b/gnu/packages/statistics.scm
@@ -403,12 +403,49 @@ (define-public r-minimal
     (arguments
      `(#:tests? #f
        ,@(substitute-keyword-arguments (package-arguments r-with-tests)
+           ((#:disallowed-references refs '())
+            (cons perl refs))
            ((#:configure-flags flags)
             ;; Do not build the recommended packages.  The build system creates
             ;; random temporary directories and embeds their names in some
             ;; package files.  We build these packages with the r-build-system
             ;; instead.
-            `(cons "--without-recommended-packages" ,flags)))))))
+            `(cons "--without-recommended-packages" ,flags))
+           ((#:phases phases '%standard-phases)
+            `(modify-phases ,phases
+               (add-after 'install 'remove-extraneous-references
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (let ((out (assoc-ref outputs "out")))
+                     (substitute* (string-append out "/lib/R/etc/Makeconf")
+                       (("^# configure.*")
+                        "# Removed to avoid extraneous references\n"))
+                     (substitute* (string-append out "/lib/R/bin/libtool")
+                       (((string-append
+                          "(-L)?("
+                          (assoc-ref inputs "bzip2")
+                          "|"
+                          (assoc-ref inputs "perl")
+                          "|"
+                          (assoc-ref inputs "texlive")
+                          "|"
+                          (assoc-ref inputs "texlive-bin")
+                          "|"
+                          (assoc-ref inputs "texinfo")
+                          "|"
+                          (assoc-ref inputs "xz")
+                          "|"
+                          (format #false
+                                  "/gnu/store/[^-]+-(~{~a~^|~})-[^/]+"
+                                  '("glibc-utf8-locales"
+                                    "libselinux"
+                                    "libsepol"
+                                    "file"
+                                    "texlive-bin"
+                                    "util-macros"
+                                    "graphite2"))
+                          "|"
+                          "/gnu/store/[^-]+-glibc-[^-]+-static"
+                          ")/lib")) ""))))))))))))
 
 (define-public rmath-standalone
   (package (inherit r-minimal)
-- 
2.34.0





Information forwarded to bug-guix <at> gnu.org:
bug#52333; Package guix. (Mon, 06 Dec 2021 17:32:02 GMT) Full text and rfc822 format available.

Message #11 received at 52333 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 52333 <at> debbugs.gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: [PATCH 1/2] gnu: python-nbconvert: Embed reference to texlive-bin,
 not texlive-union.
Date: Mon,  6 Dec 2021 18:30:53 +0100
* gnu/packages/python-xyz.scm (python-nbconvert)[inputs]: Add texlive-bin.
[arguments]: Embed reference to xelatex and bibtex from the texlive-bin, not
the texlive-union.
---
 gnu/packages/python-xyz.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 81b99e1d2e..602833c4f4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -12117,14 +12117,15 @@ (define-public python-nbconvert
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-paths-and-tests
-           (lambda _
+           (lambda* (#:key inputs #:allow-other-keys)
              ;; Use pandoc binary from input.
              (substitute* "nbconvert/utils/pandoc.py"
                (("'pandoc'") (string-append "'" (which "pandoc") "'")))
              ;; Same for LaTeX.
-             (substitute* "nbconvert/exporters/pdf.py"
-               (("\"xelatex\"") (string-append "\"" (which "xelatex") "\""))
-               (("\"bibtex\"") (string-append "\"" (which "bibtex") "\"")))
+             (let ((texlive (assoc-ref inputs "texlive-bin")))
+               (substitute* "nbconvert/exporters/pdf.py"
+                 (("\"xelatex\"") (string-append "\"" texlive "/bin/xelatex\""))
+                 (("\"bibtex\"") (string-append "\"" texlive "/bin/bibtex\""))))
              ;; Make sure tests are not skipped.
              (substitute* (find-files "." "test_.+\\.py$")
                (("@onlyif_cmds_exist\\(('(pandoc|xelatex)'(, )?)+\\)") ""))
@@ -12158,6 +12159,7 @@ (define-public python-nbconvert
                (invoke "pytest" "-vv")))))))
     (inputs
      `(("pandoc" ,pandoc)
+       ("texlive-bin" ,texlive-bin)
        ;; XXX: Disabled, needs substitute*.
        ;;("inkscape" ,inkscape)
        ))
-- 
2.34.0





Information forwarded to bug-guix <at> gnu.org:
bug#52333; Package guix. (Mon, 06 Dec 2021 23:06:02 GMT) Full text and rfc822 format available.

Message #14 received at 52333 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 52333 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/2] gnu: python-nbconvert: Embed reference to
 texlive-bin, not texlive-union.
Date: Mon, 06 Dec 2021 23:03:58 +0000
Ricardo Wurmus <rekado <at> elephly.net> writes:

> * gnu/packages/python-xyz.scm (python-nbconvert)[inputs]: Add texlive-bin.
> [arguments]: Embed reference to xelatex and bibtex from the texlive-bin, not
> the texlive-union.

This is a bad idea, because it breaks PDF conversion.

I still think that the texlive stuff should be a regular input, not a
native input, but however we do this: it’s not with this patch.

-- 
Ricardo




Reply sent to Ricardo Wurmus <rekado <at> elephly.net>:
You have taken responsibility. (Wed, 15 Dec 2021 12:54:02 GMT) Full text and rfc822 format available.

Notification sent to Ricardo Wurmus <rekado <at> elephly.net>:
bug acknowledged by developer. (Wed, 15 Dec 2021 12:54:02 GMT) Full text and rfc822 format available.

Message #19 received at 52333-done <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 52333-done <at> debbugs.gnu.org
Subject: [PATCH] Remove extraneous references
Date: Wed, 15 Dec 2021 12:53:28 +0000
I applied the change to r-minimal and discarded the other one.

-- 
Ricardo




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 13 Jan 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 104 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.