GNU bug report logs -
#29515
[PATCH 0/2] Reducing the closure of man-db
Previous Next
Reported by: Ludovic Courtès <ludo <at> gnu.org>
Date: Fri, 1 Dec 2017 09:58:01 UTC
Severity: normal
Tags: patch
Done: ludo <at> gnu.org (Ludovic Courtès)
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 29515 in the body.
You can then email your comments to 29515 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#29515
; Package
guix-patches
.
(Fri, 01 Dec 2017 09:58:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Fri, 01 Dec 2017 09:58:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hello,
These patches reduce the man-db closure significantly, notably by
removing Perl and Gawk from the reference graph. Incidentally, that
also removes Perl from the reference graph of the GuixSD installation
image.
I’ve confirmed that the resulting man-db still works as expected by
running commands like:
./pre-inst-env guix environment -C --ad-hoc man-db man-pages \
-- man pthread_create
Feedback welcome!
Ludo’.
Ludovic Courtès (2):
gnu: Add groff-minimal.
gnu: man-db: Use 'groff-minimal' at run time.
gnu/packages/groff.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++
gnu/packages/man.scm | 18 +++++++++++++-----
2 files changed, 60 insertions(+), 5 deletions(-)
--
2.15.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#29515
; Package
guix-patches
.
(Fri, 01 Dec 2017 10:00:03 GMT)
Full text and
rfc822 format available.
Message #8 received at 29515 <at> debbugs.gnu.org (full text, mbox):
* gnu/packages/groff.scm (groff-minimal): New variable.
---
gnu/packages/groff.scm | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 47 insertions(+)
diff --git a/gnu/packages/groff.scm b/gnu/packages/groff.scm
index 67dd1dbfa..9b949f8ff 100644
--- a/gnu/packages/groff.scm
+++ b/gnu/packages/groff.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2013 Andreas Enge <andreas <at> enge.fr>
;;; Copyright © 2014 Mark H Weaver <mhw <at> netris.org>
;;; Copyright © 2016 Ricardo Wurmus <rekado <at> elephly.net>
+;;; Copyright © 2017 Ludovic Courtès <ludo <at> gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -65,6 +66,52 @@ is usually the formatter of \"man\" documentation pages.")
(license gpl3+)
(home-page "https://www.gnu.org/software/groff/")))
+(define-public groff-minimal
+ ;; Minimialist groff for use by man-db. Its closure size is less than half
+ ;; that of the full-blown groff.
+ (package
+ (inherit groff)
+ (name "groff-minimal")
+ (synopsis "Minimalist variant of Groff for use by man-db")
+ (outputs '("out"))
+
+ ;; Omit the DVI, PS, PDF, and HTML backends.
+ (inputs '())
+ (native-inputs `(("bison" ,bison)
+ ("perl" ,perl)))
+
+ (arguments
+ `(#:disallowed-references (,perl)
+
+ #:configure-flags '("--docdir=/tmp/trash/doc")
+
+ #:phases (modify-phases %standard-phases
+ (add-after 'install 'remove-non-essential-programs
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Keep only the programs that man-db needs at run time,
+ ;; and make sure we don't pull in Perl.
+ (let ((out (assoc-ref outputs "out"))
+ (kept '("eqn" "neqn" "pic" "tbl" "refer"
+ "nroff" "groff" "troff" "grotty")))
+ (for-each (lambda (file)
+ (unless (member (basename file) kept)
+ (delete-file file)))
+ (find-files (string-append out "/bin")))
+
+ ;; Remove a bunch of unneeded Perl scripts.
+ (for-each delete-file (find-files out "\\.pl$"))
+ (for-each delete-file
+ (find-files out "BuildFoundries"))
+
+ ;; Remove ~3 MiB from share/groff/X.Y/font/devBACKEND
+ ;; corresponding to the unused backends.
+ (for-each delete-file-recursively
+ (find-files out "^dev(dvi|ps|pdf|html|lj4)$"
+ #:directories? #t))
+ #t))))
+
+ ,@(package-arguments groff)))))
+
;; There are no releases, so we take the latest commit.
(define-public roffit
(let ((commit "e5228388e3faf2b7f1ae5bd048ad46ed565304c6")
--
2.15.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#29515
; Package
guix-patches
.
(Fri, 01 Dec 2017 10:00:03 GMT)
Full text and
rfc822 format available.
Message #11 received at 29515 <at> debbugs.gnu.org (full text, mbox):
This reduces the closure of man-db from 175 MiB to 97 MiB.
* gnu/packages/man.scm (man-db)[native-inputs]: Add GROFF.
[inputs]: Replace GROFF with GROFF-MINIMAL.
[arguments]: #:configure-flags now refers to GROFF-MINIMAL.
Add #:disallowed-references.
---
gnu/packages/man.scm | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/man.scm b/gnu/packages/man.scm
index fed7d08ae..4e21b0df6 100644
--- a/gnu/packages/man.scm
+++ b/gnu/packages/man.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2014, 2015 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2012, 2014, 2015, 2017 Ludovic Courtès <ludo <at> gnu.org>
;;; Copyright © 2014 David Thompson <dthompson2 <at> worcester.edu>
;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado <at> elephly.net>
;;; Copyright © 2015 Alex Kost <alezost <at> gmail.com>
@@ -67,7 +67,7 @@ a flexible and convenient way.")
"0gqgs4zc3r87apns0k5qp689p2ylxx2596s2mkmkxjjay99brv88"))))
(build-system gnu-build-system)
(arguments
- '(#:phases
+ `(#:phases
(modify-phases %standard-phases
(add-after 'patch-source-shebangs 'patch-test-shebangs
(lambda* (#:key outputs #:allow-other-keys)
@@ -87,6 +87,7 @@ a flexible and convenient way.")
#t)))
#:configure-flags
(let ((groff (assoc-ref %build-inputs "groff"))
+ (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
(less (assoc-ref %build-inputs "less"))
(gzip (assoc-ref %build-inputs "gzip"))
(bzip2 (assoc-ref %build-inputs "bzip2"))
@@ -109,17 +110,24 @@ a flexible and convenient way.")
(string-append "--with-systemdtmpfilesdir="
%output "/lib/tmpfiles.d"))
(map (lambda (prog)
- (string-append "--with-" prog "=" groff "/bin/" prog))
+ (string-append "--with-" prog "=" groff-minimal
+ "/bin/" prog))
'("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))
+
+ ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
+ ;; pulls in Perl.)
+ #:disallowed-references (,groff)
+
#:modules ((guix build gnu-build-system)
(guix build utils)
(srfi srfi-1))))
(native-inputs
- `(("pkg-config" ,pkg-config)))
+ `(("pkg-config" ,pkg-config)
+ ("groff" ,groff))) ;needed at build time (troff, grops, soelim, etc.)
(inputs
`(("flex" ,flex)
("gdbm" ,gdbm)
- ("groff" ,groff)
+ ("groff-minimal" ,groff-minimal)
("less" ,less)
("libpipeline" ,libpipeline)
("util-linux" ,util-linux)))
--
2.15.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#29515
; Package
guix-patches
.
(Fri, 01 Dec 2017 18:24:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 29515 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
On Fri, Dec 01, 2017 at 10:56:49AM +0100, Ludovic Courtès wrote:
> Hello,
>
> These patches reduce the man-db closure significantly, notably by
> removing Perl and Gawk from the reference graph. Incidentally, that
> also removes Perl from the reference graph of the GuixSD installation
> image.
>
> I’ve confirmed that the resulting man-db still works as expected by
> running commands like:
>
> ./pre-inst-env guix environment -C --ad-hoc man-db man-pages \
> -- man pthread_create
>
> Feedback welcome!
I think it's great!
[signature.asc (application/pgp-signature, inline)]
Reply sent
to
ludo <at> gnu.org (Ludovic Courtès)
:
You have taken responsibility.
(Sat, 02 Dec 2017 14:11:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Ludovic Courtès <ludo <at> gnu.org>
:
bug acknowledged by developer.
(Sat, 02 Dec 2017 14:11:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 29515-done <at> debbugs.gnu.org (full text, mbox):
Leo Famulari <leo <at> famulari.name> skribis:
> On Fri, Dec 01, 2017 at 10:56:49AM +0100, Ludovic Courtès wrote:
>> Hello,
>>
>> These patches reduce the man-db closure significantly, notably by
>> removing Perl and Gawk from the reference graph. Incidentally, that
>> also removes Perl from the reference graph of the GuixSD installation
>> image.
>>
>> I’ve confirmed that the resulting man-db still works as expected by
>> running commands like:
>>
>> ./pre-inst-env guix environment -C --ad-hoc man-db man-pages \
>> -- man pthread_create
>>
>> Feedback welcome!
>
> I think it's great!
Thanks, pushed! :-)
Ludo’.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 31 Dec 2017 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 7 years and 224 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.