GNU bug report logs - #56051

Previous Next

Package: guix-patches;

Reported by: Julien Lepiller <julien <at> lepiller.eu>

Date: Sat, 18 Jun 2022 06:55:02 UTC

Severity: normal

Done: Julien Lepiller <julien <at> lepiller.eu>

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 56051 in the body.
You can then email your comments to 56051 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 guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 06:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Lepiller <julien <at> lepiller.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 18 Jun 2022 06:55:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: guix-patches <at> gnu.org
Cc: Hi <at> lepiller.eu, Guix!@lepiller.eu
Date: Sat, 18 Jun 2022 08:46:32 +0200
This patch ensures that we don't record a reference to gcc-toolchain in
the result of `guix pull`.  With this, we save 150 MB of closure.

This is a patch to fix the first issue I found in
https://issues.guix.gnu.org/56030.

From f96742e204f6b98401f49f7d1066257d7355c873 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien <at> lepiller.eu>
Date: Sat, 18 Jun 2022 08:17:59 +0200
Subject: [PATCH] guix: self: Do not record reference to gcc-toolchain.

The ld-wrapper from gcc-toolchain records a reference to the library
path through rpath, but this is not needed.  By explicitely using rpath
flags instead, we save 150 MB of closure.

* guix/self.scm (quiet-guile): Do not record reference to gcc-toolchain.
---
 guix/self.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/self.scm b/guix/self.scm
index 9a64051c32..36ada4d171 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -569,10 +569,12 @@ (define build
                               (filter package? packages))))
                    ":"))
           (setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))
+          (setenv "GUIX_LD_WRAPPER_DISABLE_RPATH" "1")
 
           (invoke "gcc" #$(local-file source) "-Wall" "-g0" "-O2"
                   "-I" #$(file-append guile "/include/guile/" effective)
                   "-L" #$(file-append guile "/lib")
+                  "-Wl,-rpath" #$(file-append guile "/lib")
                   #$(string-append "-lguile-" effective)
                   "-o" (string-append #$output "/bin/guile")))))
 
-- 
2.35.1





Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 06:59:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: 56051 <at> debbugs.gnu.org
Subject: [PATCH] guix: self: Do not record reference to gcc-toolchain.
Date: Sat, 18 Jun 2022 08:58:10 +0200
The ld-wrapper from gcc-toolchain records a reference to the library
path through rpath, but this is not needed.  By explicitely using rpath
flags instead, we save 150 MB of closure.

* guix/self.scm (quiet-guile): Do not record reference to gcc-toolchain.
---
 guix/self.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/guix/self.scm b/guix/self.scm
index 9a64051c32..36ada4d171 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -569,10 +569,12 @@ (define build
                               (filter package? packages))))
                    ":"))
           (setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))
+          (setenv "GUIX_LD_WRAPPER_DISABLE_RPATH" "1")
 
           (invoke "gcc" #$(local-file source) "-Wall" "-g0" "-O2"
                   "-I" #$(file-append guile "/include/guile/" effective)
                   "-L" #$(file-append guile "/lib")
+                  "-Wl,-rpath" #$(file-append guile "/lib")
                   #$(string-append "-lguile-" effective)
                   "-o" (string-append #$output "/bin/guile")))))
 
-- 
2.36.1





Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 09:46:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Julien Lepiller <julien <at> lepiller.eu>, 56051 <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to
 gcc-toolchain.
Date: Sat, 18 Jun 2022 11:45:43 +0200
[Message part 1 (text/plain, inline)]
Julien Lepiller schreef op za 18-06-2022 om 08:58 [+0200]:
>            (setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))

I'm wondering if is this line that is incorrect, given that the
'gcc:out' store item does not have a /lib subdirectory.  Would removing
this line be sufficient?

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 16:53:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Maxime Devos <maximedevos <at> telenet.be>, 56051 <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to gcc-toolchain.
Date: Sat, 18 Jun 2022 14:13:03 +0200
On June 18, 2022 11:45:43 AM GMT+02:00, Maxime Devos <maximedevos <at> telenet.be> wrote:
>Julien Lepiller schreef op za 18-06-2022 om 08:58 [+0200]:
>>            (setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))
>
>I'm wondering if is this line that is incorrect, given that the
>'gcc:out' store item does not have a /lib subdirectory.  Would removing
>this line be sufficient?
>
>Greetings,
>Maxime.

Removing this line I get a message that gcc can't find crt*.o. Remember that this gcc is actually gcc-toolchain.

Another possibility is to explicitely use gcc, binutils, glibc and ld-wrapper. Thought this would be better?




Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 17:24:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Julien Lepiller <julien <at> lepiller.eu>, 56051 <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to
 gcc-toolchain.
Date: Sat, 18 Jun 2022 19:23:28 +0200
[Message part 1 (text/plain, inline)]
Julien Lepiller schreef op za 18-06-2022 om 14:13 [+0200]:
> On June 18, 2022 11:45:43 AM GMT+02:00, Maxime Devos <maximedevos <at> telenet.be> wrote:
> > Julien Lepiller schreef op za 18-06-2022 om 08:58 [+0200]:
> > >            (setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))
> > 
> > I'm wondering if is this line that is incorrect, given that the
> > 'gcc:out' store item does not have a /lib subdirectory.  Would removing
> > this line be sufficient?
> > 
> > Greetings,
> > Maxime.
> 
> Removing this line I get a message that gcc can't find crt*.o.

Which crt are these? crt1.o, crti.o, crtn.o (from glibc) or crtbegin.o,
crtend.o, crtprec64.o, ... (from gcc)?

> Another possibility is to explicitely use gcc, binutils, glibc and
> ld-wrapper. Thought this would be better?

FWIW, the <c-compiler> infrastructure in (guix scripts pack) does that,
and the code in guix/self.scm has a comment:

    ;; XXX: Reuse <c-compiler> from (guix scripts pack) instead?

though maybe (guix scripts pack) has the same reference-keeping problem
...

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 17:54:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 56051 <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to
 gcc-toolchain.
Date: Sat, 18 Jun 2022 19:53:25 +0200
Le Sat, 18 Jun 2022 19:23:28 +0200,
Maxime Devos <maximedevos <at> telenet.be> a écrit :

> Julien Lepiller schreef op za 18-06-2022 om 14:13 [+0200]:
> > On June 18, 2022 11:45:43 AM GMT+02:00, Maxime Devos
> > <maximedevos <at> telenet.be> wrote:  
> > > Julien Lepiller schreef op za 18-06-2022 om 08:58 [+0200]:  
> > > >            (setenv "LIBRARY_PATH" #$(file-append gcc "/lib"))  
> > > 
> > > I'm wondering if is this line that is incorrect, given that the
> > > 'gcc:out' store item does not have a /lib subdirectory.  Would
> > > removing this line be sufficient?
> > > 
> > > Greetings,
> > > Maxime.  
> > 
> > Removing this line I get a message that gcc can't find crt*.o.  
> 
> Which crt are these? crt1.o, crti.o, crtn.o (from glibc) or
> crtbegin.o, crtend.o, crtprec64.o, ... (from gcc)?

crt1.o and friends, from glibc. I tried using glibc explicitely and
setting LIBRARY_PATH to (file-append glibc "/lib") and it worked.

> 
> > Another possibility is to explicitely use gcc, binutils, glibc and
> > ld-wrapper. Thought this would be better?  
> 
> FWIW, the <c-compiler> infrastructure in (guix scripts pack) does
> that, and the code in guix/self.scm has a comment:
> 
>     ;; XXX: Reuse <c-compiler> from (guix scripts pack) instead?
> 
> though maybe (guix scripts pack) has the same reference-keeping
> problem ...
> 
> Greetings,
> Maxime.

Mh, I'm not sure how to do that. Do you mind if I push this patch, and
leave using <c-compiler> to future work?




Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 19:09:02 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 56051 <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to
 gcc-toolchain.
Date: Sat, 18 Jun 2022 21:08:18 +0200
[Message part 1 (text/plain, inline)]
Julien Lepiller schreef op za 18-06-2022 om 19:53 [+0200]:
> crt1.o and friends, from glibc. I tried using glibc explicitely and
> setting LIBRARY_PATH to (file-append glibc "/lib") and it worked.
> 
> > 
> > > Another possibility is to explicitely use gcc, binutils, glibc and
> > > ld-wrapper. Thought this would be better?  
> > 
> > FWIW, the <c-compiler> infrastructure in (guix scripts pack) does
> > that, and the code in guix/self.scm has a comment:
> > 
> >      ;; XXX: Reuse <c-compiler> from (guix scripts pack) instead?
> > 
> > though maybe (guix scripts pack) has the same reference-keeping
> > problem ...
> > 
> > Greetings,
> > Maxime.
> 
> Mh, I'm not sure how to do that. Do you mind if I push this patch, and
> leave using <c-compiler> to future work?

Sure, but keep in mind this adds 'glibc' to the closure (IIUC, packages
like 'hello' use a different glibc, from %final-inputs in (gnu packages
commencement)), so maybe best use (canonical-package glibc) instead?
(*)

(*) IIUC, (guix self) isn't used from any package module, so no cycle
problems, can be imported directly.

Greetings,
Maxime
[signature.asc (application/pgp-signature, inline)]

Reply sent to Julien Lepiller <julien <at> lepiller.eu>:
You have taken responsibility. (Sat, 18 Jun 2022 20:15:02 GMT) Full text and rfc822 format available.

Notification sent to Julien Lepiller <julien <at> lepiller.eu>:
bug acknowledged by developer. (Sat, 18 Jun 2022 20:15:02 GMT) Full text and rfc822 format available.

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

From: Julien Lepiller <julien <at> lepiller.eu>
To: Maxime Devos <maximedevos <at> telenet.be>
Cc: 56051-done <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to
 gcc-toolchain.
Date: Sat, 18 Jun 2022 22:14:01 +0200
[Message part 1 (text/plain, inline)]
Le Sat, 18 Jun 2022 21:08:18 +0200,
Maxime Devos <maximedevos <at> telenet.be> a écrit :

> Julien Lepiller schreef op za 18-06-2022 om 19:53 [+0200]:
> > crt1.o and friends, from glibc. I tried using glibc explicitely and
> > setting LIBRARY_PATH to (file-append glibc "/lib") and it worked.
> >   
> > >   
> > > > Another possibility is to explicitely use gcc, binutils, glibc
> > > > and ld-wrapper. Thought this would be better?    
> > > 
> > > FWIW, the <c-compiler> infrastructure in (guix scripts pack) does
> > > that, and the code in guix/self.scm has a comment:
> > > 
> > >      ;; XXX: Reuse <c-compiler> from (guix scripts pack) instead?
> > > 
> > > though maybe (guix scripts pack) has the same reference-keeping
> > > problem ...
> > > 
> > > Greetings,
> > > Maxime.  
> > 
> > Mh, I'm not sure how to do that. Do you mind if I push this patch,
> > and leave using <c-compiler> to future work?  
> 
> Sure, but keep in mind this adds 'glibc' to the closure (IIUC,
> packages like 'hello' use a different glibc, from %final-inputs in
> (gnu packages commencement)), so maybe best use (canonical-package
> glibc) instead? (*)
> 
> (*) IIUC, (guix self) isn't used from any package module, so no cycle
> problems, can be imported directly.
> 
> Greetings,
> Maxime

I didn't notice a different glibc. I think gcc-toolchain already uses
that glibc from commencement.scm. It's also defined in commencement.scm.

Pushed to master as 319b8331b2357e12ec9edb9665513c32bef56622.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#56051; Package guix-patches. (Sat, 18 Jun 2022 20:21:01 GMT) Full text and rfc822 format available.

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

From: Maxime Devos <maximedevos <at> telenet.be>
To: Julien Lepiller <julien <at> lepiller.eu>
Cc: 56051-done <at> debbugs.gnu.org
Subject: Re: [bug#56051] [PATCH] guix: self: Do not record reference to
 gcc-toolchain.
Date: Sat, 18 Jun 2022 22:20:10 +0200
[Message part 1 (text/plain, inline)]
Julien Lepiller schreef op za 18-06-2022 om 22:14 [+0200]:
> I didn't notice a different glibc. I think gcc-toolchain already uses
> that glibc from commencement.scm. It's also defined in
> commencement.scm.


OOps I misread your message and thought you were adding #$(file-append
glibc "/lib") somewhere.
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 17 Jul 2022 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 277 days ago.

Previous Next


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