NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.23k stars 14.22k forks source link

chawan: `mancha -k` doesn't find results #346082

Open eclairevoyant opened 1 month ago

eclairevoyant commented 1 month ago

Describe the bug

mancha -k doesn't find results

Steps To Reproduce

$ mancha -k regular
cha: Can't load man-k:regular (nothing appropriate)

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

man -k works:

$ man -k regular   
bzegrep (1)          - search possibly bzip2 compressed files for a regular expression
bzfgrep (1)          - search possibly bzip2 compressed files for a regular expression
bzgrep (1)           - search possibly bzip2 compressed files for a regular expression
pam_usertype (8)     - check if the authenticated user is a system or regular account
perlfaq6 (1)         - Regular Expressions
perlre (1)           - Perl regular expressions
perlreapi (1)        - Perl regular expression plugin interface
perlrebackslash (1)  - Perl Regular Expression Backslash Sequences and Escapes
perlrecharclass (1)  - Perl Regular Expression Character Classes
perlreguts (1)       - Description of the Perl regular expression engine.
perlrequick (1)      - Perl regular expressions quick start
perlreref (1)        - Perl Regular Expressions Reference
perlretut (1)        - Perl regular expressions tutorial
regex (7)            - POSIX.2 regular expressions
zgrep (1)            - search possibly compressed files for a regular expression

Notify maintainers

@jtbx

Metadata

I'm using chawan from nixos-unstable. I even tried bumping chawan to the current upstream commit.


Add a :+1: reaction to issues you find important.

rnhmjoj commented 1 month ago

Is this thing reusing the man-db caches to search for man pages? If so, it probably can't find NixOS caches, man-db as well had to be patched to work correctly.

jtbx commented 1 month ago

If I recall correctly it's patched to use mandoc because of a particular flag mancha requires.

bptato commented 1 month ago

Is this thing reusing the man-db caches to search for man pages? If so, it probably can't find NixOS caches, man-db as well had to be patched to work correctly.

No, it's nowhere that sophisticated. mancha just shells out to man, so if man works, then so should mancha.

If I recall correctly it's patched to use mandoc because of a particular flag mancha requires.

It works with man-db on Debian, so I don't understand why this is needed.

eclairevoyant commented 1 month ago

I don't understand why this is needed.

It's not directly mancha's fault, it's due to a patch added in nixpkgs which uses the -m flag to allow the nixpkgs build of mancha to find its own manpages, so MANCHA_MAN was also set to point to mandoc

bptato commented 1 month ago

Hmm. But doesn't that mean that man cha with the system man still won't work?

At least I remember OpenBSD's man wouldn't find man pages in their default installation directory, so I had to adjust MANPREFIX manually. Perhaps this is a similar case?