Skip to content

OpenBSD: why can't I install man pages locally? #23292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jkeenan opened this issue May 15, 2025 · 13 comments
Closed

OpenBSD: why can't I install man pages locally? #23292

jkeenan opened this issue May 15, 2025 · 13 comments
Labels
Closable? We might be able to close this ticket, but we need to check with the reporter distro-openbsd

Comments

@jkeenan
Copy link
Contributor

jkeenan commented May 15, 2025

I am trying to determine why, when I am building perl in a git checkout and installing it locally, I get man pages installed on Linux and FreeBSD but not on OpenBSD.

Linux (Ubuntu Linux 24.04 LTS)

$ sh ./Configure -des -Dusedevel -Dprefix=/tmp/alpha && make install
...
$ ls -l /tmp/alpha/
total 12
drwxr-xr-x 2 jkeenan jkeenan 4096 May 15 16:52 bin
drwxr-xr-x 3 jkeenan jkeenan 4096 May 15 16:52 lib
drwxr-xr-x 4 jkeenan jkeenan 4096 May 15 16:53 man

$ ls -l /tmp/alpha/man/man1 | wc -l
265

$ ls -l /tmp/alpha/man/man3 | wc -l
702

FreeBSD-14

$ sh ./Configure -des -Dusedevel -Dprefix=/tmp/alpha && make install
...
$ ls -l /tmp/alpha/
total 10
drwxr-xr-x  2 jkeenan wheel 32 May 15 20:54 bin
drwxr-xr-x  3 jkeenan wheel  3 May 15 20:54 lib
drwxr-xr-x  4 jkeenan wheel  4 May 15 20:54 man

$ ls -l /tmp/alpha/man
total 33
drwxr-xr-x  2 jkeenan wheel 266 May 15 20:54 man1
drwxr-xr-x  2 jkeenan wheel 706 May 15 20:54 man3

$ ls -l /tmp/alpha/man/man1 | wc -l
     265

$ ls -l /tmp/alpha/man/man3 | wc -l
     705

OpenBSD-6.9

$ sh ./Configure -des -Dusedevel -Dprefix=/tmp/alpha && make install
...
  /tmp/alpha/lib/perl5/5.41.13/pod/perltoot.pod
./perl -Ilib -I. installman --destdir= 
Manual page installation was disabled by Configure

$ ls -l /tmp/alpha/   
total 8
drwxr-xr-x  2 jkeenan  wheel  1024 May 15 21:02 bin
drwxr-xr-x  3 jkeenan  wheel   512 May 15 21:02 lib

I cannot figure out why Configure is disabling man page installation when I have not passed it options like -Dman1dir=none -Dman3dir=none. Suggestions?

@jkeenan
Copy link
Contributor Author

jkeenan commented May 15, 2025

@afresh1 @tonycoz @Tux ^^

@afresh1
Copy link
Contributor

afresh1 commented May 15, 2025

My Configure agrees

System manual is in /usr/share/man/man1.

Perl5 has manual pages available in source form.
However, you don't have nroff, so they're probably useless to you.
If you don't want the manual sources installed, answer 'none'.
 
Where do the main Perl5 manual pages (source) go? (~name ok) [none]  

This clues us in a bit:

$ which nroff
which: nroff: Command not found.

In the base system, we fix this in config.over.

Of note, OpenBSD uses mandoc(1) from mandoc.bsd.lv as our manpage formatter.

@Leont
Copy link
Contributor

Leont commented May 15, 2025

My Configure agrees

System manual is in /usr/share/man/man1.

Perl5 has manual pages available in source form.
However, you don't have nroff, so they're probably useless to you.
If you don't want the manual sources installed, answer 'none'.
 
Where do the main Perl5 manual pages (source) go? (~name ok) [none]  

This clues us in a bit:

$ which nroff
which: nroff: Command not found.

In the base system, we fix this in config.over.

Of note, OpenBSD uses mandoc(1) from mandoc.bsd.lv as our manpage formatter.

I suspect something like -Dnroff=mandoc would make things work more smoothly.

@jkeenan
Copy link
Contributor Author

jkeenan commented May 16, 2025

I suspect something like -Dnroff=mandoc would make things work more smoothly.

Close, but unfortunately no cigar.

With this configuration (at (v5.41.13 (v5.41.12-69-g482fd30fb2))):

$ sh ./Configure -des -Dusedevel -Dprefix=/tmp/beta -Dnroff=mandoc

... (which would have been better if it also had -Uversiononly), I did get man/man1 and man/man3 subdirectories populated.

$ ls /tmp/beta/man/man1 | wc -l                    
     264
$ ls /tmp/beta/man/man3 | wc -l 
     703

... but the non-ASCII characters were still elusive.

$ man /tmp/beta/man/man1/perlhist.1 | grep var
       "BinGOs" Williams, Zefram, AEvar Arnfjordh Bjarmason, Stevan Little,
       David Croy.  We had passed around various names (baton, token, hot
        AEvar     5.13.10       2011-Feb-20

$ man /tmp/beta/man/man1/perlcn.1 | head           
PERLCN(1)              Perl Programmers Reference Guide              PERLCN(1)




NAME
       perlcn - <?><?><?><?> Perl <?><?>

DESCRIPTION
       <?><?><?><?> Perl <?><?><?>!

@Leont
Copy link
Contributor

Leont commented May 16, 2025

... but the non-ASCII characters were still elusive.

What does your locale look like? Are you accidentally using a iso-8859-1 locale?

If you are using a utf8 locale: What do file /tmp/beta/man/man1/perlcn.1 and md5sum /tmp/beta/man/man1/perlcn.1 return? And the same for perlhist I suppose.

@jkeenan
Copy link
Contributor Author

jkeenan commented May 16, 2025

What does your locale look like? Are you accidentally using a iso-8859-1 locale?

$ ./bin/perl5.41.13  -V | grep -i locale                                                    
    ccflags ='-DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE -DNO_LOCALE_MONETARY -DNO_LOCALE_TIME -DNO_LOCALE_MESSAGES -DLIBC_HANDLES_MISMATCHED_CTYPE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    cppflags='-DNO_LOCALE_NUMERIC -DNO_LOCALE_COLLATE -DNO_LOCALE_MONETARY -DNO_LOCALE_TIME -DNO_LOCALE_MESSAGES -DLIBC_HANDLES_MISMATCHED_CTYPE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include'
    USE_LOCALE
    USE_LOCALE_CTYPE

If you are using a utf8 locale: What do file /tmp/beta/man/man1/perlcn.1 and md5sum /tmp/beta/man/man1/perlcn.1 return? And the same for perlhist I suppose.

$ perl -V:d_setlocale                                                         
d_setlocale='define';
$ file /tmp/beta/man/man1/perlcn.1
/tmp/beta/man/man1/perlcn.1: troff or preprocessor input text
$ file /tmp/beta/man/man1/perlhist.1
/tmp/beta/man/man1/perlhist.1: troff or preprocessor input text
$ md5sum /tmp/beta/man/man1/perlcn.1 
ksh: md5sum: not found

@Leont
Copy link
Contributor

Leont commented May 16, 2025

What does your locale look like? Are you accidentally using a iso-8859-1 locale?

what does the locale command say?

@jkeenan
Copy link
Contributor Author

jkeenan commented May 16, 2025

What does your locale look like? Are you accidentally using a iso-8859-1 locale?

what does the locale command say?

[openbsd69: ~] $ locale
LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"
LC_ALL=

@Leont
Copy link
Contributor

Leont commented May 17, 2025

Yeah that explains why you couldn't see perlcn, that's not a UTF8 locale. That's no a perl problem.

@khwilliamson
Copy link
Contributor

khwilliamson commented May 17, 2025

openbsd only has effectively two locales. C and C.UTF8.

(This is for security reasons.)

If you run locale -a, you can see if there exists a Chinese UTF-8 locale. The openbsd box I have access to does not

@khwilliamson
Copy link
Contributor

Actually, it does zh_CN.UTF-8

@jkeenan
Copy link
Contributor Author

jkeenan commented May 17, 2025

Actually, it does zh_CN.UTF-8

So does my OpenBSD-6.9 VM, along with many other UTF-8 locales.

$ locale -a | ack -c '\.UTF-8$'
66

But I don't see that that gets us anywhere with generating man pages on that platform programmatically.

In any case, I opened this ticket originally to get data to support my argument that #11977 was closable. I have just now closed that ticket, so I think this one is closable too.

@jkeenan jkeenan added the Closable? We might be able to close this ticket, but we need to check with the reporter label May 17, 2025
@khwilliamson
Copy link
Contributor

fine with me to close it

@jkeenan jkeenan closed this as completed May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Closable? We might be able to close this ticket, but we need to check with the reporter distro-openbsd
Projects
None yet
Development

No branches or pull requests

4 participants