GNU bug report logs - #37732
glib propagates util-linux

Previous Next

Package: guix;

Reported by: Diego Nicola Barbato <dnbarbato <at> posteo.de>

Date: Sun, 13 Oct 2019 11:50:03 UTC

Severity: important

Done: Marius Bakke <mbakke <at> fastmail.com>

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 37732 in the body.
You can then email your comments to 37732 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#37732; Package guix. (Sun, 13 Oct 2019 11:50:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Diego Nicola Barbato <dnbarbato <at> posteo.de>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Sun, 13 Oct 2019 11:50:03 GMT) Full text and rfc822 format available.

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

From: Diego Nicola Barbato <dnbarbato <at> posteo.de>
To: bug-guix <at> gnu.org
Subject: mps-youtube propagates util-linux
Date: Sun, 13 Oct 2019 13:40:36 +0200
Hi Guix,

An unfortunate chain of propagated-inputs causes 'util-linux' (mount,
umount, etc.) to be installed alongside 'mps-youtube': 'mps-youtube'
propagates 'python-pygobject', which propagates 'glib', which propagates
'util-linux'.  It seems to have been introduced with commit 6c237a2,
when 'util-linux' was moved to the propagated-inputs of 'glib'.

This is a problem on foreign distributions, where the stowaway 'mount'
and 'umount' commands installed by Guix shadow the setuid ones provided
by the distro.

I am currently on commit ecf3a3a (post core-updates merge).

Regards,

Diego




Information forwarded to bug-guix <at> gnu.org:
bug#37732; Package guix. (Sun, 13 Oct 2019 14:27:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Diego Nicola Barbato <dnbarbato <at> posteo.de>, 37732 <at> debbugs.gnu.org
Subject: Re: bug#37732: mps-youtube propagates util-linux
Date: Sun, 13 Oct 2019 16:26:40 +0200
[Message part 1 (text/plain, inline)]
Hello Diego,

Thanks for the report!

Diego Nicola Barbato <dnbarbato <at> posteo.de> writes:

> Hi Guix,
>
> An unfortunate chain of propagated-inputs causes 'util-linux' (mount,
> umount, etc.) to be installed alongside 'mps-youtube': 'mps-youtube'
> propagates 'python-pygobject', which propagates 'glib', which propagates
> 'util-linux'.  It seems to have been introduced with commit 6c237a2,
> when 'util-linux' was moved to the propagated-inputs of 'glib'.
>
> This is a problem on foreign distributions, where the stowaway 'mount'
> and 'umount' commands installed by Guix shadow the setuid ones provided
> by the distro.

I have attached a WIP patch that fixes this "long term", by moving the
util-linux libraries to a separate output.  It rebuilds 7753 packages
and is intended for the 'core-updates' branch.

[0001-gnu-util-linux-Move-libraries-to-separate-output.patch (text/x-patch, inline)]
From b9cbe08694ddd8248ac32ce60d5fc40d5c619a54 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke <at> fastmail.com>
Date: Sun, 13 Oct 2019 16:07:44 +0200
Subject: [PATCH] gnu: util-linux: Move libraries to separate output.

Fixes <https://bugs.gnu.org/37732>.
Reported by Diego Nicola Barbato <dnbarbato <at> posteo.de>.

* gnu/packages/linux.scm (util-linux)[outputs]: Add "dev".
[arguments]: Update #:configure-flags accordingly.  Add phase
"adjust-bindirs", and rename "move-static-libraries" to "move-libraries",
while adding a substitution for the .pc files.
* gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Use the "dev"
output of UTIL-LINUX.
* gnu/packages/glib.scm (glib)[propagated-inputs]: Likewise.
---
 gnu/packages/fontutils.scm |  2 +-
 gnu/packages/glib.scm      |  2 +-
 gnu/packages/linux.scm     | 39 ++++++++++++++++++++++++++++++++------
 3 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/fontutils.scm b/gnu/packages/fontutils.scm
index e355f7bb89..e01ea615be 100644
--- a/gnu/packages/fontutils.scm
+++ b/gnu/packages/fontutils.scm
@@ -304,7 +304,7 @@ fonts to/from the WOFF2 format.")
    ;; In Requires or Requires.private of fontconfig.pc.
    (propagated-inputs `(("expat" ,expat)
                         ("freetype" ,freetype)
-                        ("libuuid" ,util-linux)))
+                        ("libuuid" ,util-linux "dev")))
    (inputs `(("gs-fonts" ,gs-fonts)))
    (native-inputs
     `(("gperf" ,gperf)
diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm
index c558d9fcb6..ce695843ef 100644
--- a/gnu/packages/glib.scm
+++ b/gnu/packages/glib.scm
@@ -185,7 +185,7 @@ shared NFS home directories.")
     `(("pcre" ,pcre)  ; in the Requires.private field of glib-2.0.pc
       ("libffi" ,libffi) ; in the Requires.private field of gobject-2.0.pc
       ;; These are in the Requires.private field of gio-2.0.pc
-      ("util-linux" ,util-linux)  ; for libmount
+      ("util-linux" ,util-linux "dev")  ;for libmount
       ("libselinux" ,libselinux)
       ("zlib" ,zlib)))
    (inputs
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index bc39757da2..5a7351eaee 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1089,19 +1089,40 @@ providing the system administrator with some help in common tasks.")
                     (("build_kill=yes") "build_kill=no"))
                   #t))))
     (build-system gnu-build-system)
-    (outputs '("out"
-               "static"))      ; >2 MiB of static .a libraries
+    (outputs '("out"                   ;6.4 MiB executables and documentation
+               "dev"                   ;8.8 MiB shared libraries, headers and locales
+               "static"))              ;2.9 MiB static .a libraries
     (arguments
      `(#:configure-flags (list "--disable-use-tty-group"
                                "--enable-fs-paths-default=/run/current-system/profile/sbin"
                                ;; Don't try to chown root:root mount and umount
                                "--disable-makeinstall-chown"
+                               "--localstatedir=/var"
+                               (string-append "--localedir="
+                                              (assoc-ref %outputs "dev")
+                                              "/share/locale")
+                               (string-append "--includedir="
+                                              (assoc-ref %outputs "dev") "/include")
+                               (string-append "--exec_prefix="
+                                              (assoc-ref %outputs "dev"))
+                               (string-append "--bindir="
+                                              (assoc-ref %outputs "out") "/bin")
+                               (string-append "--sbindir="
+                                              (assoc-ref %outputs "out") "/sbin")
                                ;; Install completions where our
                                ;; bash-completion package expects them.
                                (string-append "--with-bashcompletiondir="
                                               (assoc-ref %outputs "out")
                                               "/etc/bash_completion.d"))
        #:phases (modify-phases %standard-phases
+                  (add-before 'configure 'adjust-bindirs
+                    (lambda _
+                      ;; Some binaries are "hard coded" to use $exec_prefix/{,s}bin
+                      ;; instead of --bindir.  Adjust those to use $prefix instead.
+                      (substitute* "configure"
+                        (("\\$\\{exec_prefix\\}/(s?bin)" _ bin)
+                         (string-append "${prefix}/" bin)))
+                      #t))
                   (add-before
                    'build 'set-umount-file-name
                    (lambda* (#:key outputs #:allow-other-keys)
@@ -1122,12 +1143,13 @@ providing the system administrator with some help in common tasks.")
                           (string-append net "/etc/services")))
                        #t)))
                   (add-after
-                   'install 'move-static-libraries
+                   'install 'split-outputs
                    (lambda* (#:key outputs #:allow-other-keys)
-                     (let ((out    (assoc-ref outputs "out"))
+                     (let ((dev    (assoc-ref outputs "dev"))
                            (static (assoc-ref outputs "static")))
+
                        (mkdir-p (string-append static "/lib"))
-                       (with-directory-excursion out
+                       (with-directory-excursion dev
                          (for-each (lambda (file)
                                      (rename-file file
                                                   (string-append static "/"
@@ -1138,7 +1160,12 @@ providing the system administrator with some help in common tasks.")
                          ;; files so that Libtool does the right thing when both
                          ;; the shared and static library is available.
                          (substitute* (find-files "lib" "\\.la$")
-                           (("old_library=.*") "old_library=''\n")))
+                           (("old_library=.*") "old_library=''\n"))
+
+                         ;; Finally, drop the unused "prefix=" from the pkg-config
+                         ;; files to avoid a cyclic reference on "out".
+                         (substitute* (find-files "lib" "\\.pc$")
+                           (("^prefix=.*") "")))
 
                        #t))))))
     (inputs `(("zlib" ,zlib)
-- 
2.23.0

[Message part 3 (text/plain, inline)]
The size of 'fontconfig' (as reported by `guix size`) decreases from
103.6 MiB to 92.1 MiB with this patch.  \o/

Short term I'm not sure what to do.  Perhaps we can add a
"glib-sans-util-linux" variant that does not propagate util-linux?  Or a
variant that propagates a util-linux-sans-binaries?

Diego: one work-around you can try in the meantime is to create a
~/setuid-programs, add it first on PATH, and symlink the required
binaries in there.  Sorry for the inconvenience! 
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37732; Package guix. (Tue, 15 Oct 2019 14:30:02 GMT) Full text and rfc822 format available.

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

From: Diego Nicola Barbato <dnbarbato <at> posteo.de>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 37732 <at> debbugs.gnu.org
Subject: Re: bug#37732: mps-youtube propagates util-linux
Date: Tue, 15 Oct 2019 16:29:30 +0200
Hello Marius,

Marius Bakke <mbakke <at> fastmail.com> writes:


[...]


> Diego: one work-around you can try in the meantime is to create a
> ~/setuid-programs, add it first on PATH, and symlink the required
> binaries in there.  Sorry for the inconvenience! 

No worries.  I have simply removed 'mps-youtube' from my profile and use
it with 'guix environment --ad-hoc mps-youtube -- mpsyt' instead.  The
difficult part was finding out which package propagated 'util-linux'.  I
used 'emacs-guix' and lucky guesses to find it (fortunately the profile
only contained 12 packages).

Is there a more convenient way to recursively show all propagated-inputs
of a given package?  It would be interesting to check how prevalent this
propagation pollution is (another example that comes to mind is 'jami',
which installs 125 programs under bin/, of which only about half can be
attributed to 'util-linux').

Thanks,

Diego




Changed bug title to 'glib propagates util-linux' from 'mps-youtube propagates util-linux' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 01 Nov 2019 14:34:02 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 01 Nov 2019 14:34:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#37732; Package guix. (Fri, 01 Nov 2019 14:42:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Marius Bakke <mbakke <at> fastmail.com>
Cc: 37732 <at> debbugs.gnu.org, Diego Nicola Barbato <dnbarbato <at> posteo.de>
Subject: Re: bug#37732: mps-youtube propagates util-linux
Date: Fri, 01 Nov 2019 15:41:30 +0100
Hi!

Marius Bakke <mbakke <at> fastmail.com> skribis:

> Diego Nicola Barbato <dnbarbato <at> posteo.de> writes:
>
>> Hi Guix,
>>
>> An unfortunate chain of propagated-inputs causes 'util-linux' (mount,
>> umount, etc.) to be installed alongside 'mps-youtube': 'mps-youtube'
>> propagates 'python-pygobject', which propagates 'glib', which propagates
>> 'util-linux'.  It seems to have been introduced with commit 6c237a2,
>> when 'util-linux' was moved to the propagated-inputs of 'glib'.

Do we know why this commit moved ‘util-linux’ to propagated-inputs?
Presumably because of this line in ‘gio-2.0.pc’, right?

  Requires.private: gmodule-no-export-2.0, zlib, mount >= 2.23, libselinux

If it’s “just” because of this, I’d say we don’t need to propagate
‘util-linux’: we only build shared libraries for GLib anyway, so none of
our packages actually use ‘Requires.private’.  If we were to add
packages requiring it, it’s fine to just add ‘mount’ as an explicit
inputs of these packages IMO.

We could follow the same reasoning for the other things that are
propagated due to their being listed in ‘Requires.private’.

Thoughts?

Moving ‘util-linux’ back to ‘inputs’ could perhaps be done on the next
‘staging’ or on ‘core-updates’.

> I have attached a WIP patch that fixes this "long term", by moving the
> util-linux libraries to a separate output.  It rebuilds 7753 packages
> and is intended for the 'core-updates' branch.
>
> From b9cbe08694ddd8248ac32ce60d5fc40d5c619a54 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke <at> fastmail.com>
> Date: Sun, 13 Oct 2019 16:07:44 +0200
> Subject: [PATCH] gnu: util-linux: Move libraries to separate output.
>
> Fixes <https://bugs.gnu.org/37732>.
> Reported by Diego Nicola Barbato <dnbarbato <at> posteo.de>.
>
> * gnu/packages/linux.scm (util-linux)[outputs]: Add "dev".
> [arguments]: Update #:configure-flags accordingly.  Add phase
> "adjust-bindirs", and rename "move-static-libraries" to "move-libraries",
> while adding a substitution for the .pc files.
> * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Use the "dev"
> output of UTIL-LINUX.
> * gnu/packages/glib.scm (glib)[propagated-inputs]: Likewise.

[...]

> --- a/gnu/packages/linux.scm
> +++ b/gnu/packages/linux.scm
> @@ -1089,19 +1089,40 @@ providing the system administrator with some help in common tasks.")
>                      (("build_kill=yes") "build_kill=no"))
>                    #t))))
>      (build-system gnu-build-system)
> -    (outputs '("out"
> -               "static"))      ; >2 MiB of static .a libraries
> +    (outputs '("out"                   ;6.4 MiB executables and documentation
> +               "dev"                   ;8.8 MiB shared libraries, headers and locales
> +               "static"))              ;2.9 MiB static .a libraries

Shared libraries are not just for development, so I’d say it should be
“lib” instead, no?

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#37732; Package guix. (Sun, 03 Nov 2019 16:48:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 37732 <at> debbugs.gnu.org, Diego Nicola Barbato <dnbarbato <at> posteo.de>
Subject: Re: bug#37732: mps-youtube propagates util-linux
Date: Sun, 03 Nov 2019 17:47:34 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Hi!
>
> Marius Bakke <mbakke <at> fastmail.com> skribis:
>
>> Diego Nicola Barbato <dnbarbato <at> posteo.de> writes:
>>
>>> Hi Guix,
>>>
>>> An unfortunate chain of propagated-inputs causes 'util-linux' (mount,
>>> umount, etc.) to be installed alongside 'mps-youtube': 'mps-youtube'
>>> propagates 'python-pygobject', which propagates 'glib', which propagates
>>> 'util-linux'.  It seems to have been introduced with commit 6c237a2,
>>> when 'util-linux' was moved to the propagated-inputs of 'glib'.
>
> Do we know why this commit moved ‘util-linux’ to propagated-inputs?
> Presumably because of this line in ‘gio-2.0.pc’, right?
>
>   Requires.private: gmodule-no-export-2.0, zlib, mount >= 2.23, libselinux

I assume so.

> If it’s “just” because of this, I’d say we don’t need to propagate
> ‘util-linux’: we only build shared libraries for GLib anyway, so none of
> our packages actually use ‘Requires.private’.  If we were to add
> packages requiring it, it’s fine to just add ‘mount’ as an explicit
> inputs of these packages IMO.
>
> We could follow the same reasoning for the other things that are
> propagated due to their being listed in ‘Requires.private’.
>
> Thoughts?

Right.  You know, I had forgotten that Requires.private were for static
libraries.  Thanks for pointing that out.  I think quite a few packages
propagate Requires.private dependencies without using static libraries.

Something to watch out for in the ongoing quest to purge static
libraries from Guix.

> Moving ‘util-linux’ back to ‘inputs’ could perhaps be done on the next
> ‘staging’ or on ‘core-updates’.

util-linux now has 7880 dependent packages, as 'fontconfig' recently
started depending on it.  So it must go through 'core-updates'.  Luckily
that branch is slated to start by the end of this month, so the waiting
time should not be too long.

>> I have attached a WIP patch that fixes this "long term", by moving the
>> util-linux libraries to a separate output.  It rebuilds 7753 packages
>> and is intended for the 'core-updates' branch.
>>
>> From b9cbe08694ddd8248ac32ce60d5fc40d5c619a54 Mon Sep 17 00:00:00 2001
>> From: Marius Bakke <mbakke <at> fastmail.com>
>> Date: Sun, 13 Oct 2019 16:07:44 +0200
>> Subject: [PATCH] gnu: util-linux: Move libraries to separate output.
>>
>> Fixes <https://bugs.gnu.org/37732>.
>> Reported by Diego Nicola Barbato <dnbarbato <at> posteo.de>.
>>
>> * gnu/packages/linux.scm (util-linux)[outputs]: Add "dev".
>> [arguments]: Update #:configure-flags accordingly.  Add phase
>> "adjust-bindirs", and rename "move-static-libraries" to "move-libraries",
>> while adding a substitution for the .pc files.
>> * gnu/packages/fontutils.scm (fontconfig)[propagated-inputs]: Use the "dev"
>> output of UTIL-LINUX.
>> * gnu/packages/glib.scm (glib)[propagated-inputs]: Likewise.
>
> [...]
>
>> --- a/gnu/packages/linux.scm
>> +++ b/gnu/packages/linux.scm
>> @@ -1089,19 +1089,40 @@ providing the system administrator with some help in common tasks.")
>>                      (("build_kill=yes") "build_kill=no"))
>>                    #t))))
>>      (build-system gnu-build-system)
>> -    (outputs '("out"
>> -               "static"))      ; >2 MiB of static .a libraries
>> +    (outputs '("out"                   ;6.4 MiB executables and documentation
>> +               "dev"                   ;8.8 MiB shared libraries, headers and locales
>> +               "static"))              ;2.9 MiB static .a libraries
>
> Shared libraries are not just for development, so I’d say it should be
> “lib” instead, no?

Agreed.  Will adjust this patch accordingly once I get around to start
working on 'core-updates'.  :-)
[signature.asc (application/pgp-signature, inline)]

Reply sent to Marius Bakke <mbakke <at> fastmail.com>:
You have taken responsibility. (Tue, 14 Jan 2020 23:40:02 GMT) Full text and rfc822 format available.

Notification sent to Diego Nicola Barbato <dnbarbato <at> posteo.de>:
bug acknowledged by developer. (Tue, 14 Jan 2020 23:40:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 37732-done <at> debbugs.gnu.org, Diego Nicola Barbato <dnbarbato <at> posteo.de>
Subject: Re: bug#37732: mps-youtube propagates util-linux
Date: Wed, 15 Jan 2020 00:39:21 +0100
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

>>> --- a/gnu/packages/linux.scm
>>> +++ b/gnu/packages/linux.scm
>>> @@ -1089,19 +1089,40 @@ providing the system administrator with some help in common tasks.")
>>>                      (("build_kill=yes") "build_kill=no"))
>>>                    #t))))
>>>      (build-system gnu-build-system)
>>> -    (outputs '("out"
>>> -               "static"))      ; >2 MiB of static .a libraries
>>> +    (outputs '("out"                   ;6.4 MiB executables and documentation
>>> +               "dev"                   ;8.8 MiB shared libraries, headers and locales
>>> +               "static"))              ;2.9 MiB static .a libraries
>>
>> Shared libraries are not just for development, so I’d say it should be
>> “lib” instead, no?
>
> Agreed.  Will adjust this patch accordingly once I get around to start
> working on 'core-updates'.  :-)

I opted for a more conventional "lib" output and pushed the patch to the
'core-updates' branch in bb93042c8beb881ab907fa802eefb3c4091039a2.
[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. (Wed, 12 Feb 2020 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 69 days ago.

Previous Next


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