GNU bug report logs - #38838
'whatis' doesn't work

Previous Next

Package: guix;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Tue, 31 Dec 2019 22:00:01 UTC

Severity: normal

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.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 38838 in the body.
You can then email your comments to 38838 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#38838; Package guix. (Tue, 31 Dec 2019 22:00:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Tue, 31 Dec 2019 22:00:02 GMT) Full text and rfc822 format available.

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

From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: bug-guix <at> gnu.org
Subject: 'whatis' doesn't work
Date: Tue, 31 Dec 2019 22:59:41 +0100
The 'whatis' utility from man-db 2.9.0 doesn't work for me. This
includes both my user profile and 'guix environment's. 'apropos' works,
so the man database is present and working.

$ guix environment --pure --ad-hoc man-db man-pages
[env] $ apropos memcpy
memcpy (3)           - copy memory area
wmemcpy (3)          - copy an array of wide-characters
[env] $ whatis memcpy
memcpy: nothing appropriate.

Regards,
Jakub Kądziołka




Information forwarded to bug-guix <at> gnu.org:
bug#38838; Package guix. (Mon, 06 Jan 2020 18:06:02 GMT) Full text and rfc822 format available.

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

From: zimoun <zimon.toutoune <at> gmail.com>
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Cc: 38838 <at> debbugs.gnu.org
Subject: Re: bug#38838: 'whatis' doesn't work
Date: Mon, 6 Jan 2020 19:05:06 +0100
Dear,

I confirm that something appears unexpected with the command 'whatis'.


Below, using Guix 3a695c01d7ee18f30f22df53f3c44dfac04017f1, and running
`guix environment --ad-hoc man-db man-pages --pure` then let output the
internal debugging information (option '-d'). See below.

Everything seems pointing to the correct path, so maybe it should come
from the 'index.db' file.


Well, let manually build an index, by first download the necessary files
with (outside the environment):

   guix build man-pages --no-grafts --check -K

then inside the environment:

  mandb -c /tmp/guix-build-man-pages-5.04.drv-0/man-pages-5.04

and now,

  whatis -M /tmp/guix-build-man-pages-5.04.drv-0/man-pages-5.04 memcpy

works as expected.


Last, note that using the 'apropos/whatis' binary from Debian and the
path of the temporary profile (guix environment), I get:

--8<---------------cut here---------------start------------->8---
/usr/bin/apropos -M
/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man memcpy
memcpy (3)           - copy memory area
wmemcpy (3)          - copy an array of wide-characters

/usr/bin/whatis -M
/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man memcpy
memcpy: nothing appropriate
--8<---------------cut here---------------end--------------->8---



I do not know if this report helps and if the index is the culprit.
What do you think?

All the best,
simon



--8<---------------cut here---------------start------------->8---
# whatis
man -d -f memcpy
From the config file
/gnu/store/l9j6dsfs2i4spfkia492wnighplvhb1c-man-db-2.9.0/etc/man_db.conf:
  Mandatory mandir `/usr/man'.
  Mandatory mandir `/usr/share/man'.
  Mandatory mandir `/usr/local/share/man'.
  Path `/bin' mapped to mandir `/usr/share/man'.
  Path `/usr/bin' mapped to mandir `/usr/share/man'.
  Path `/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/games' mapped to mandir `/usr/share/man'.
  Path `/opt/bin' mapped to mandir `/opt/man'.
  Path `/opt/sbin' mapped to mandir `/opt/man'.
  Global mandir `/usr/man', catdir `/var/cache/man/fsstnd'.
  Global mandir `/usr/share/man', catdir `/var/cache/man'.
  Global mandir `/usr/local/man', catdir `/var/cache/man/oldlocal'.
  Global mandir `/usr/local/share/man', catdir `/var/cache/man/local'.
  Global mandir `/usr/X11R6/man', catdir `/var/cache/man/X11R6'.
  Global mandir `/opt/man', catdir `/var/cache/man/opt'.
  Added sections: `1', `n', `l', `8', `3', `0', `2', `5', `4', `9', `6', `7'.
From the config file
/gnu/store/l9j6dsfs2i4spfkia492wnighplvhb1c-man-db-2.9.0/etc/man_db.conf:
  Mandatory mandir `/usr/man'.
  Mandatory mandir `/usr/share/man'.
  Mandatory mandir `/usr/local/share/man'.
  Path `/bin' mapped to mandir `/usr/share/man'.
  Path `/usr/bin' mapped to mandir `/usr/share/man'.
  Path `/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/games' mapped to mandir `/usr/share/man'.
  Path `/opt/bin' mapped to mandir `/opt/man'.
  Path `/opt/sbin' mapped to mandir `/opt/man'.
  Global mandir `/usr/man', catdir `/var/cache/man/fsstnd'.
  Global mandir `/usr/share/man', catdir `/var/cache/man'.
  Global mandir `/usr/local/man', catdir `/var/cache/man/oldlocal'.
  Global mandir `/usr/local/share/man', catdir `/var/cache/man/local'.
  Global mandir `/usr/X11R6/man', catdir `/var/cache/man/X11R6'.
  Global mandir `/opt/man', catdir `/var/cache/man/opt'.
  Added sections: `1', `n', `l', `8', `3', `0', `2', `5', `4', `9', `6', `7'.
add_nls_manpaths(): processing
/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
checking for locale C
adding /gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
to manpathlist
final search path =
/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
path=/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
memcpy: nothing appropriate.
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
# apropos
man -d -k memcpy
From the config file
/gnu/store/l9j6dsfs2i4spfkia492wnighplvhb1c-man-db-2.9.0/etc/man_db.conf:
  Mandatory mandir `/usr/man'.
  Mandatory mandir `/usr/share/man'.
  Mandatory mandir `/usr/local/share/man'.
  Path `/bin' mapped to mandir `/usr/share/man'.
  Path `/usr/bin' mapped to mandir `/usr/share/man'.
  Path `/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/games' mapped to mandir `/usr/share/man'.
  Path `/opt/bin' mapped to mandir `/opt/man'.
  Path `/opt/sbin' mapped to mandir `/opt/man'.
  Global mandir `/usr/man', catdir `/var/cache/man/fsstnd'.
  Global mandir `/usr/share/man', catdir `/var/cache/man'.
  Global mandir `/usr/local/man', catdir `/var/cache/man/oldlocal'.
  Global mandir `/usr/local/share/man', catdir `/var/cache/man/local'.
  Global mandir `/usr/X11R6/man', catdir `/var/cache/man/X11R6'.
  Global mandir `/opt/man', catdir `/var/cache/man/opt'.
  Added sections: `1', `n', `l', `8', `3', `0', `2', `5', `4', `9', `6', `7'.
From the config file
/gnu/store/l9j6dsfs2i4spfkia492wnighplvhb1c-man-db-2.9.0/etc/man_db.conf:
  Mandatory mandir `/usr/man'.
  Mandatory mandir `/usr/share/man'.
  Mandatory mandir `/usr/local/share/man'.
  Path `/bin' mapped to mandir `/usr/share/man'.
  Path `/usr/bin' mapped to mandir `/usr/share/man'.
  Path `/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/games' mapped to mandir `/usr/share/man'.
  Path `/opt/bin' mapped to mandir `/opt/man'.
  Path `/opt/sbin' mapped to mandir `/opt/man'.
  Global mandir `/usr/man', catdir `/var/cache/man/fsstnd'.
  Global mandir `/usr/share/man', catdir `/var/cache/man'.
  Global mandir `/usr/local/man', catdir `/var/cache/man/oldlocal'.
  Global mandir `/usr/local/share/man', catdir `/var/cache/man/local'.
  Global mandir `/usr/X11R6/man', catdir `/var/cache/man/X11R6'.
  Global mandir `/opt/man', catdir `/var/cache/man/opt'.
  Added sections: `1', `n', `l', `8', `3', `0', `2', `5', `4', `9', `6', `7'.
add_nls_manpaths(): processing
/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
checking for locale C
adding /gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
to manpathlist
final search path =
/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
path=/gnu/store/hg02c2i5ycd4g0498xwgsbxyikz1bvf1-profile/share/man
name:      memcpy
sec. ext:  3
section:   3
comp. ext: gz
id:        A
mtime:     0.000000000
pointer:   -
filter:    -
whatis:    copy memory area

memcpy (3)           - copy memory area
name:      wmemcpy
sec. ext:  3
section:   3
comp. ext: gz
id:        A
mtime:     0.000000000
pointer:   -
filter:    -
whatis:    copy an array of wide-characters

wmemcpy (3)          - copy an array of wide-characters
--8<---------------cut here---------------end--------------->8---




Reply sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
You have taken responsibility. (Wed, 02 Mar 2022 05:27:02 GMT) Full text and rfc822 format available.

Notification sent to Jakub Kądziołka <kuba <at> kadziolka.net>:
bug acknowledged by developer. (Wed, 02 Mar 2022 05:27:02 GMT) Full text and rfc822 format available.

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

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: zimoun <zimon.toutoune <at> gmail.com>
Cc: Jakub Kądziołka <kuba <at> kadziolka.net>,
 38838-done <at> debbugs.gnu.org
Subject: Re: bug#38838: 'whatis' doesn't work
Date: Wed, 02 Mar 2022 00:26:13 -0500
Hello,

zimoun <zimon.toutoune <at> gmail.com> writes:

> Dear,
>
> I confirm that something appears unexpected with the command 'whatis'.
>
> Below, using Guix 3a695c01d7ee18f30f22df53f3c44dfac04017f1, and running
> `guix environment --ad-hoc man-db man-pages --pure` then let output the
> internal debugging information (option '-d'). See below.
>
> Everything seems pointing to the correct path, so maybe it should come
> from the 'index.db' file.

[...]

> I do not know if this report helps and if the index is the culprit.

You were on the right path; the database file was indeed the culprit.
This is the database, in hex, generated by man-db for a single cat.1.gz
man page:

--8<---------------cut here---------------start------------->8---
2476 6572 7369 6f6e 2400 322e 352e 3000  $version$.2.5.0.
00003010: 6361 7400 2d09 3109 3109 3136 3436 3138  cat.-.1.1.164618
00003020: 3834 3934 0939 3333 3430 3030 3430 0941  8494.933400040.A
00003030: 092d 092d 0967 7a09 636f 6e63 6174 656e  .-.-.gz.concaten
00003040: 6174 6520 6669 6c65 7320 616e 6420 7072  ate files and pr
00003050: 696e 7420 6f6e 2074 6865 2073 7461 6e64  int on the stand
00003060: 6172 6420 6f75 7470 7574 0000 0000 0000  ard output......
00003070:
--8<---------------cut here---------------end--------------->8---

while this is what Guix was generating:

--8<---------------cut here---------------start------------->8---
00000600: 2476 6572 7369 6f6e 2400 322e 352e 3000  $version$.2.5.0.
00000610: 2f74 6d70 2f67 7569 782f 6d61 6e2f 6d61  /tmp/guix/man/ma
00000620: 6e31 2f63 6174 2e31 2e67 7a00 6361 7409  n1/cat.1.gz.cat.
00000630: 3109 3109 3009 3009 4109 2d09 2d09 677a  1.1.0.0.A.-.-.gz
00000640: 0963 6f6e 6361 7465 6e61 7465 2066 696c  .concatenate fil
00000650: 6573 2061 6e64 2070 7269 6e74 206f 6e20  es and print on
00000660: 7468 6520 7374 616e 6461 7264 206f 7574  the standard out
00000670: 7075 7400 0000 0000 0000 0000 0000 0000  put.............
--8<---------------cut here---------------end--------------->8---

The entry that comes right after the 2.5.0 version is the key.  Guix was
using the file name, while man-db uses the name of the man page, such as
'cat'.

With the following change:

--8<---------------cut here---------------start------------->8---
modified   guix/man-db.scm
@@ -110,7 +110,12 @@ (define (write-mandb-database file entries)
     ;; Write ENTRIES in sorted order so we get deterministic output.
     (for-each (lambda (entry)
                 (gdbm-set! db
-                           (string-append (mandb-entry-file-name entry)
+                           ;; For the 'whatis' tool to find anything, the key
+                           ;; should match the name of the software,
+                           ;; e.g. 'cat'.  Derive it from the file name, as
+                           ;; the name could technically be #f.
+                           (string-append (abbreviate-file-name
+                                           (mandb-entry-file-name entry))
                                           "\x00")
                            (entry->string entry)))
               (sort entries mandb-entry<?))
--8<---------------cut here---------------end--------------->8---
               
I now get:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix shell --pure man-db coreutils -- whatis cat
[...]
building database for manual pages...
building profile with 2 packages...
cat (1)              - concatenate files and print on the standard output
--8<---------------cut here---------------end--------------->8---

and apropos, man seem to continue working as expected.

Pushed as deaa322963.

Closing.

Thanks for the report!

Maxim




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

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

Previous Next


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