GNU bug report logs - #51416
[PATCH] profiles: Build the man database only if 'man-db' is in the profile.

Previous Next

Package: guix-patches;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Tue, 26 Oct 2021 17:34:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 51416 in the body.
You can then email your comments to 51416 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#51416; Package guix-patches. (Tue, 26 Oct 2021 17:34:02 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. (Tue, 26 Oct 2021 17:34:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: guix-patches <at> gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [PATCH] profiles: Build the man database only if 'man-db' is in the
 profile.
Date: Tue, 26 Oct 2021 19:33:28 +0200
This allows us to skip the expensive man-db profile hook in most cases.

Suggested by Liliana Marie Prikler <liliana.prikler <at> gmail.com>.

* guix/profiles.scm (manual-database/optional): New procedure.
(%default-profile-hooks): Use it instead of 'manual-database'.
---
 guix/profiles.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Hi!

As y’all know, computing the manual page database is CPU- and I/O-intensive
and thus a good candidate for removal, as discussed earlier¹.

I would prefer to provide a replacement for the ‘man -k’ functionality,
such as a Xapian-based full-text search².  Now, this hasn’t materialized
yet, but I feel it’s about time to remove that hook.

The other day Liliana came with a smart idea on IRC: to build the database
only when ‘man-db’ is also in the profile.  It’s a good way to not quite
make a decision :-), but it’s going to address the main pain point.

Thoughts?

Thanks,
Ludo’.

¹ https://lists.gnu.org/archive/html/guix-devel/2020-12/msg00052.html
  Thread continues in January and March.

² https://lists.gnu.org/archive/html/guix-devel/2021-04/msg00027.html

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 9f30349c69..ffdd5f57f6 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1682,6 +1682,16 @@ (define man-directory
                     `((type . profile-hook)
                       (hook . manual-database))))
 
+(define (manual-database/optional manifest)
+  "Return a derivation to build the manual database of MANIFEST, but only if
+MANIFEST contains the \"man-db\" package.  Otherwise, return #f."
+  ;; Building the man database (for "man -k") is expensive and rarely used.
+  ;; Build it only if the profile also contains "man-db".
+  (mlet %store-monad ((man-db (manifest-lookup-package manifest "man-db")))
+    (if man-db
+        (manual-database manifest)
+        (return #f))))
+
 (define (texlive-configuration manifest)
   "Return a derivation that builds a TeXlive configuration for the entries in
 MANIFEST."
@@ -1784,7 +1794,7 @@ (define %default-profile-hooks
   ;; This is the list of derivation-returning procedures that are called by
   ;; default when making a non-empty profile.
   (list info-dir-file
-        manual-database
+        manual-database/optional
         fonts-dir-file
         ghc-package-cache-file
         ca-certificate-bundle

base-commit: 0a42998a50e8bbe9e49142b21a570db00efe7491
-- 
2.33.0





Information forwarded to guix-patches <at> gnu.org:
bug#51416; Package guix-patches. (Tue, 26 Oct 2021 17:45:01 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51416 <at> debbugs.gnu.org
Subject: Re: [bug#51416] [PATCH] profiles: Build the man database only if
 'man-db' is in the profile.
Date: Tue, 26 Oct 2021 13:44:09 -0400
On Tue, Oct 26, 2021 at 07:33:28PM +0200, Ludovic Courtès wrote:
> The other day Liliana came with a smart idea on IRC: to build the database
> only when ‘man-db’ is also in the profile.  It’s a good way to not quite
> make a decision :-), but it’s going to address the main pain point.
> 
> Thoughts?

From the user's perspective, what would change? Would `man foo` still
work after installing foo?




Information forwarded to guix-patches <at> gnu.org:
bug#51416; Package guix-patches. (Tue, 26 Oct 2021 21:52:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Leo Famulari <leo <at> famulari.name>
Cc: 51416 <at> debbugs.gnu.org
Subject: Re: bug#51416: [PATCH] profiles: Build the man database only if
 'man-db' is in the profile.
Date: Tue, 26 Oct 2021 23:50:54 +0200
Leo Famulari <leo <at> famulari.name> skribis:

> On Tue, Oct 26, 2021 at 07:33:28PM +0200, Ludovic Courtès wrote:
>> The other day Liliana came with a smart idea on IRC: to build the database
>> only when ‘man-db’ is also in the profile.  It’s a good way to not quite
>> make a decision :-), but it’s going to address the main pain point.
>> 
>> Thoughts?
>
>>From the user's perspective, what would change? Would `man foo` still
> work after installing foo?

Yes.  What wouldn’t work, unless ‘man-db’ is in the same profile, is
‘man -k whatever’:

  https://guix.gnu.org/manual/en/html_node/Documentation.html

On Guix System, the system profile does include man-db by default.

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#51416; Package guix-patches. (Tue, 26 Oct 2021 22:46:02 GMT) Full text and rfc822 format available.

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

From: Leo Famulari <leo <at> famulari.name>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51416 <at> debbugs.gnu.org
Subject: Re: bug#51416: [PATCH] profiles: Build the man database only if
 'man-db' is in the profile.
Date: Tue, 26 Oct 2021 18:45:00 -0400
On Tue, Oct 26, 2021 at 11:50:54PM +0200, Ludovic Courtès wrote:
> Yes.  What wouldn’t work, unless ‘man-db’ is in the same profile, is
> ‘man -k whatever’:
> 
>   https://guix.gnu.org/manual/en/html_node/Documentation.html
> 
> On Guix System, the system profile does include man-db by default.

Wow, I never knew about that feature. I figured the database was
necessary for `man foo`.

+1 for this change!




Information forwarded to guix-patches <at> gnu.org:
bug#51416; Package guix-patches. (Wed, 27 Oct 2021 10:30:02 GMT) Full text and rfc822 format available.

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

From: Oleg Pykhalov <go.wigust <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 51416 <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#51416] [PATCH] profiles: Build the man database only if
 'man-db' is in the profile.
Date: Wed, 27 Oct 2021 13:29:04 +0300
[Message part 1 (text/plain, inline)]
Hi,

Ludovic Courtès <ludo <at> gnu.org> writes:

[…]

>   https://guix.gnu.org/manual/en/html_node/Documentation.html
>
> On Guix System, the system profile does include man-db by default.

We probably should add a line in the documentation about 'man -k'
requirement on non Guix system, WDYT?  Otherwise +1 for the change.

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

Information forwarded to guix-patches <at> gnu.org:
bug#51416; Package guix-patches. (Wed, 27 Oct 2021 14:05:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 51416 <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: [bug#51416] [PATCH] profiles: Build the man database only if
 'man-db' is in the profile.
Date: Wed, 27 Oct 2021 16:03:58 +0200
Hi,

Oleg Pykhalov <go.wigust <at> gmail.com> skribis:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
> […]
>
>>   https://guix.gnu.org/manual/en/html_node/Documentation.html
>>
>> On Guix System, the system profile does include man-db by default.
>
> We probably should add a line in the documentation about 'man -k'
> requirement on non Guix system, WDYT?  Otherwise +1 for the change.

Yes, good idea, I’ll do that.

Thanks!

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sat, 06 Nov 2021 22:24:01 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Sat, 06 Nov 2021 22:24:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Oleg Pykhalov <go.wigust <at> gmail.com>
Cc: 51416-done <at> debbugs.gnu.org, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#51416: [PATCH] profiles: Build the man database only if
 'man-db' is in the profile.
Date: Sat, 06 Nov 2021 23:22:54 +0100
Hi,

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Oleg Pykhalov <go.wigust <at> gmail.com> skribis:
>
>> Ludovic Courtès <ludo <at> gnu.org> writes:
>>
>> […]
>>
>>>   https://guix.gnu.org/manual/en/html_node/Documentation.html
>>>
>>> On Guix System, the system profile does include man-db by default.
>>
>> We probably should add a line in the documentation about 'man -k'
>> requirement on non Guix system, WDYT?  Otherwise +1 for the change.
>
> Yes, good idea, I’ll do that.

Done in 3c1158ac4e5ef825a9b9a229a233fabd7cef334e!

Thanks,
Ludo’.




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

This bug report was last modified 2 years and 143 days ago.

Previous Next


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