GNU bug report logs -
#31210
Perl graft breakage
Previous Next
Reported by: Leo Famulari <leo <at> famulari.name>
Date: Wed, 18 Apr 2018 18:10:01 UTC
Severity: normal
Done: Leo Famulari <leo <at> famulari.name>
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 31210 in the body.
You can then email your comments to 31210 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Wed, 18 Apr 2018 18:10:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Leo Famulari <leo <at> famulari.name>
:
New bug report received and forwarded. Copy sent to
bug-guix <at> gnu.org
.
(Wed, 18 Apr 2018 18:10:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Sun, Apr 15, 2018 at 05:34:05PM +0200, Marius Bakke wrote:
> * gnu/packages/perl.scm (perl-5.26.2): New public variable.
> (perl)[replacement]: New field.
I noticed on my Debian system that this broke rxvt-unicode, and it
probably affects other packages as well.
The issue is that the full path of libperl.so includes the Perl version
number, for example:
/gnu/store/...-perl-5.26.1/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE/libperl.so
The RUNPATH of urxvt with the Perl graft includes this bogus path:
/gnu/store/ynk3rg3i791i6k7rz2imbyj9wyfjrnrc-perl-5.26.2/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE
Grafting fails to replace the latter instance of the version number,
and so lookups fail like this:
------
[...]
openat(AT_FDCWD, "/gnu/store/4sqaib7c2dfjv62ivrg9b8wa7bh226la-glibc-2.26.105-g0890d5379c/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/95b2fv709zvxdrb38l2w8jd73vz5v5ff-fontconfig-2.12.6/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/4pj266bvxiris0vbvm1j568n1smdj7m8-freetype-2.8.1/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/6n2pn58p6l7v9icg0m3i8kp4wbn8nzl2-libxft-2.3.2/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/7lm90jgm2y00382yqriq4yw1nvb3p7b6-libxrender-0.9.10/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/6x1p96h51dlgpdsmrx3821ixbawbm19l-libx11-1.6.5/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/x86_64/x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/x86_64/x86_64", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/x86_64", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/x86_64", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../tls", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../x86_64/x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../x86_64/x86_64", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../x86_64", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../x86_64/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../x86_64", 0x7ffd43384b10) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../../libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
stat("/gnu/store/2ifmksc425qcysl5rkxkbv6yrgc1w9cs-gcc-5.5.0-lib/lib/gcc/x86_64-unknown-linux-gnu/5.5.0/../../..", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
openat(AT_FDCWD, "/gnu/store/4sqaib7c2dfjv62ivrg9b8wa7bh226la-glibc-2.26.105-g0890d5379c/lib/libperl.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
writev(2, [{iov_base="urxvt", iov_len=5}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libperl.so", iov_len=10}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="No such file or directory", iov_len=25}, {iov_base="\n", iov_len=1}], 10urxvt: error while loading shared libraries: libperl.so: cannot open shared object file: No such file or directory
) = 115
exit_group(127) = ?
------
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Wed, 18 Apr 2018 19:16:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 31210 <at> debbugs.gnu.org (full text, mbox):
Hi Leo,
Leo Famulari <leo <at> famulari.name> writes:
> On Sun, Apr 15, 2018 at 05:34:05PM +0200, Marius Bakke wrote:
>> * gnu/packages/perl.scm (perl-5.26.2): New public variable.
>> (perl)[replacement]: New field.
>
> I noticed on my Debian system that this broke rxvt-unicode, and it
> probably affects other packages as well.
>
> The issue is that the full path of libperl.so includes the Perl version
> number, for example:
>
> /gnu/store/...-perl-5.26.1/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE/libperl.so
>
> The RUNPATH of urxvt with the Perl graft includes this bogus path:
>
> /gnu/store/ynk3rg3i791i6k7rz2imbyj9wyfjrnrc-perl-5.26.2/lib/perl5/5.26.1/x86_64-linux-thread-multi/CORE
I suggest that we add a phase to the replacement 'perl' to install a
symlink from $out/lib/perl5/5.26.1 pointing to "5.26.2".
Would you like to try this, Leo, and push it if it solves the problem
for you?
Mark
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Wed, 18 Apr 2018 20:53:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 31210 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Wed, Apr 18, 2018 at 03:14:45PM -0400, Mark H Weaver wrote:
> I suggest that we add a phase to the replacement 'perl' to install a
> symlink from $out/lib/perl5/5.26.1 pointing to "5.26.2".
>
> Would you like to try this, Leo, and push it if it solves the problem
> for you?
Thanks for your advice. The attached patch fixes the issue for me.
I would have pushed it but there is one thing I don't understand. Before
I set (replacement #f), the build would fail because the new phase was
run twice, and symlinking fails because it is not "forced" (as in `ln
-sf`). Is this expected behaviour?
[0001-gnu-Perl-Fix-a-grafting-failure-due-to-a-path-that-i.patch (text/plain, attachment)]
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Thu, 19 Apr 2018 07:07:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 31210 <at> debbugs.gnu.org (full text, mbox):
Leo Famulari <leo <at> famulari.name> writes:
> On Wed, Apr 18, 2018 at 03:14:45PM -0400, Mark H Weaver wrote:
>> I suggest that we add a phase to the replacement 'perl' to install a
>> symlink from $out/lib/perl5/5.26.1 pointing to "5.26.2".
>>
>> Would you like to try this, Leo, and push it if it solves the problem
>> for you?
>
> Thanks for your advice. The attached patch fixes the issue for me.
>
> I would have pushed it but there is one thing I don't understand. Before
> I set (replacement #f), the build would fail because the new phase was
> run twice, and symlinking fails because it is not "forced" (as in `ln
> -sf`). Is this expected behaviour?
The problem is that you should never use 'package/inherit' to create a
graft. That leads to an infinite tower of grafts. I'm surprised it
works at all, but it's definitely not right. Use (package (inherit ...)
...) instead, and leave out the (replacement #f).
Thanks!
Mark
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Thu, 19 Apr 2018 10:30:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 31210 <at> debbugs.gnu.org (full text, mbox):
Hi again,
I wrote:
> The problem is that you should never use 'package/inherit' to create a
> graft. That leads to an infinite tower of grafts.
I should explain why this is. We cannot use (package/inherit P ...) to
define the replacement of package P, because it leads to a circular
definition. Recall that (package/inherit P ...) applies the given
transformation to both P and its replacement. In this case, P's
replacement is the thing we're trying to define. See the circularity?
This would lead to an infinite recursion if not for the fact that
'replacement' is a "thunked" field, i.e. its evaluation is delayed.
Instead it leads to an infinite series of replacements, each one based
on the previous one, but with the transformation applied one more time.
In this example with 'perl', the transformation involved adding a new
phase. Let's call that transformation 'f', so that (f perl) is the
replacement you wanted. Since you used (package/inherit perl ...) to
define perl's replacement, it led to an infinite series of replacements:
perl
(f perl)
(f (f perl))
(f (f (f perl)))
...
I would have expected the grafting machinery to iterate until reaching
the end of this series of replacements. I guess it didn't because the
(f (f perl)) build failed, since it added the phase twice.
Also note that since 'package/inherit' implicitly adds its own
'replacement' field, if you manually override 'replacement' within
'package/inherit' as you did in your first proposed patch, it expands
into a package definition with two 'replacement' overrides, like this:
(package (inherit P)
(replacement #f)
...
(replacement ...))
Ideally, guix records would report an error in this case.
Regards,
Mark
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Thu, 19 Apr 2018 11:59:03 GMT)
Full text and
rfc822 format available.
Message #20 received at 31210 <at> debbugs.gnu.org (full text, mbox):
Hi Leo,
One more thing:
Leo Famulari <leo <at> famulari.name> writes:
> + (add-after 'install 'workaround-grafting-version-bug
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let* ((out (assoc-ref outputs "out"))
> + (new (string-append out "/lib/perl5/5.26.2"))
> + (old (string-append out "/lib/perl5/5.26.1")))
> + (symlink new old)
> + #t)))))))))
It would be better for 'new' to be simply "5.26.2" instead of an
absolute file name. If I'm not mistaken, on ext4, files (including
symlinks) smaller than 60 bytes are stored entirely within the inode,
saving both a disk block and a seek operation when accessing it.
Mark
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Thu, 19 Apr 2018 14:39:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 31210 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Thu, Apr 19, 2018 at 07:57:32AM -0400, Mark H Weaver wrote:
> Hi Leo,
>
> One more thing:
>
> Leo Famulari <leo <at> famulari.name> writes:
> > + (add-after 'install 'workaround-grafting-version-bug
> > + (lambda* (#:key outputs #:allow-other-keys)
> > + (let* ((out (assoc-ref outputs "out"))
> > + (new (string-append out "/lib/perl5/5.26.2"))
> > + (old (string-append out "/lib/perl5/5.26.1")))
> > + (symlink new old)
> > + #t)))))))))
>
> It would be better for 'new' to be simply "5.26.2" instead of an
> absolute file name. If I'm not mistaken, on ext4, files (including
> symlinks) smaller than 60 bytes are stored entirely within the inode,
> saving both a disk block and a seek operation when accessing it.
Thanks for all your expert advice! I pushed a fix as
44b98b00026e62766620dbc4330a305282d61069.
[signature.asc (application/pgp-signature, inline)]
bug closed, send any further explanations to
31210 <at> debbugs.gnu.org and Leo Famulari <leo <at> famulari.name>
Request was from
Leo Famulari <leo <at> famulari.name>
to
control <at> debbugs.gnu.org
.
(Thu, 19 Apr 2018 14:40:04 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Thu, 19 Apr 2018 15:22:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 31210 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Mark H Weaver <mhw <at> netris.org> writes:
> Hi Leo,
>
> One more thing:
>
> Leo Famulari <leo <at> famulari.name> writes:
>> + (add-after 'install 'workaround-grafting-version-bug
>> + (lambda* (#:key outputs #:allow-other-keys)
>> + (let* ((out (assoc-ref outputs "out"))
>> + (new (string-append out "/lib/perl5/5.26.2"))
>> + (old (string-append out "/lib/perl5/5.26.1")))
>> + (symlink new old)
>> + #t)))))))))
>
> It would be better for 'new' to be simply "5.26.2" instead of an
> absolute file name. If I'm not mistaken, on ext4, files (including
> symlinks) smaller than 60 bytes are stored entirely within the inode,
> saving both a disk block and a seek operation when accessing it.
Hello Mark and Leo,
I'm sorry for not testing this graft more thoroughly. And thanks for
the explanation about package/inherit, I had misunderstood its purpose.
The attached patch should address all concerns. I have also tested
urxvt with it.
[0001-gnu-perl-Fix-grafting-error-due-to-version-number-in.patch (text/x-patch, inline)]
From 44ae580e4affc03bcfd6d27277ea78aa63021fb9 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke <at> fastmail.com>
Date: Thu, 19 Apr 2018 17:17:54 +0200
Subject: [PATCH] gnu: perl: Fix grafting error due to version number in Perl
library path.
Fixes <https://bugs.gnu.org/31210>.
* gnu/packages/perl.scm (perl-5.26.2): Use (package (inherit) ...) instead
of (package/inherit ...).
[arguments]: Add phase 'workaround-grafting-version-bug'.
---
gnu/packages/perl.scm | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/gnu/packages/perl.scm b/gnu/packages/perl.scm
index aaf3e2e82..4cd5bf6df 100644
--- a/gnu/packages/perl.scm
+++ b/gnu/packages/perl.scm
@@ -44,6 +44,7 @@
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix build-system perl)
+ #:use-module (guix utils) ;substitute-keyword-arguments for perl-5.26.2
#:use-module (gnu packages base)
#:use-module (gnu packages compression)
#:use-module (gnu packages freedesktop)
@@ -161,7 +162,8 @@
;; Fixes CVE-2018-6797, CVE-2018-6798, and CVE-2018-6913.
;; See <https://metacpan.org/changes/release/SHAY/perl-5.26.2>.
(define-public perl-5.26.2
- (package/inherit perl
+ (package
+ (inherit perl)
(version "5.26.2")
(source (origin
(inherit (package-source perl))
@@ -169,7 +171,19 @@
version ".tar.gz"))
(sha256
(base32
- "03gpnxx1g6hvlh0v4aqx00580h787sfywp1vlvw64q2xcbm9qbsp"))))))
+ "03gpnxx1g6hvlh0v4aqx00580h787sfywp1vlvw64q2xcbm9qbsp"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments perl)
+ ((#:phases phases)
+ `(modify-phases ,phases
+ ;; The path to libperl.so includes the Perl version number, and this
+ ;; is not handled by grafting. See <https://bugs.gnu.org/31210>.
+ (add-after 'install 'workaround-grafting-version-bug
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((out (assoc-ref outputs "out")))
+ (with-directory-excursion (string-append out "/lib/perl5")
+ (symlink "5.26.2" "5.26.1")
+ #t))))))))))
(define-public perl-algorithm-c3
(package
--
2.17.0
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
bug-guix <at> gnu.org
:
bug#31210
; Package
guix
.
(Sat, 21 Apr 2018 05:55:02 GMT)
Full text and
rfc822 format available.
Message #31 received at 31210 <at> debbugs.gnu.org (full text, mbox):
My suggested approach of making compatibility symlinks didn't work.
See <https://bugs.gnu.org/31216> for details and further discussion.
Mark
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 19 May 2018 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 years and 337 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.