From: Marius Bakke <mbakke@fastmail.com>
To: Diego Nicola Barbato <dnbarbato@posteo.de>, 37732@debbugs.gnu.org
Subject: bug#37732: mps-youtube propagates util-linux
Date: Sun, 13 Oct 2019 16:26:40 +0200 [thread overview]
Message-ID: <878spo3en3.fsf@devup.no> (raw)
In-Reply-To: <875zks27rf.fsf@GlaDOS.home>
[-- Attachment #1.1: Type: text/plain, Size: 814 bytes --]
Hello Diego,
Thanks for the report!
Diego Nicola Barbato <dnbarbato@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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-util-linux-Move-libraries-to-separate-output.patch --]
[-- Type: text/x-patch, Size: 6769 bytes --]
From b9cbe08694ddd8248ac32ce60d5fc40d5c619a54 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@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@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
[-- Attachment #1.3: Type: text/plain, Size: 492 bytes --]
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!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
next prev parent reply other threads:[~2019-10-13 14:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-13 11:40 bug#37732: mps-youtube propagates util-linux Diego Nicola Barbato
2019-10-13 14:26 ` Marius Bakke [this message]
2019-10-15 14:29 ` Diego Nicola Barbato
2019-11-01 14:41 ` Ludovic Courtès
2019-11-03 16:47 ` Marius Bakke
2020-01-14 23:39 ` Marius Bakke
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878spo3en3.fsf@devup.no \
--to=mbakke@fastmail.com \
--cc=37732@debbugs.gnu.org \
--cc=dnbarbato@posteo.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).