Summary: | sys-apps/man-db man ffmpeg doesn't work and other mans also have the same error (musl) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Tohka <enigmaticsmile> |
Component: | Current packages | Assignee: | Gentoo's Team for Core System packages <base-system> |
Status: | UNCONFIRMED --- | ||
Severity: | normal | CC: | enigmaticsmile, mentalstring |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: | emerge-info.txt |
Description
Tohka
2024-03-07 17:08:05 UTC
Maybe try executing that pipeline in stages until something fails.
For example, assuming /usr/share/man/man1/ffmpeg.1.bz2 exists:
> cd /usr/share/man
> bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim
> bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE
> bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE | preconv -e UTF-8
> bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE | preconv -e UTF-8 | tbl
> bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE | preconv -e UTF-8 | tbl | nroff -mandoc -c -rLL=77n -rLT=77n -Tutf8
(In reply to Mike Gilbert from comment #1) > Maybe try executing that pipeline in stages until something fails. > > For example, assuming /usr/share/man/man1/ffmpeg.1.bz2 exists: > > > cd /usr/share/man > > bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim > > bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE > > bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE | preconv -e UTF-8 > > bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE | preconv -e UTF-8 | tbl > > bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE | preconv -e UTF-8 | tbl | nroff -mandoc -c -rLL=77n -rLT=77n -Tutf8 it fails at bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE the error output is manconv: iconv_open ("UTF-8//IGNORE", "utf-8"): Invalid argument Please provide the output from "emerge --info sys-apps/man-db". Created attachment 887487 [details]
emerge-info.txt
Here it is
It looks like you have LANG set to "C.UTF8". Does it work if you set LANG to "C.UTF-8" instead? I am on musl so locales are different than in glibc. I am using the default locale that came with the stage tarball if you unpack it you see in /etc/profile.env its C.UTF8 afaik. If you wanted me to do LANG=C.UTF-8 man ffmpeg that still fails. LANG=C.UTF-8 bzcat man1/ffmpeg.1.bz2 | /usr/libexec/man-db/zsoelim | /usr/libexec/man-db/manconv -f UTF-8:utf-8 -t UTF-8//IGNORE Also gives the error of: manconv: iconv_open ("UTF-8//IGNORE", "utf-8"): Invalid argument I was able to reproduce the issue.
The problem seems to be triggered by the lowercase "utf-8" in the ffmpeg man page header:
> .\" -*- mode: troff; coding: utf-8 -*-
Changing this to uppercase "UTF-8" allows man-db to render the page on musl.
Running the command with MAN_DEBUG=1 in the environment produces some useful debug output. The debug output differs with "utf-8" vs "UTF-8", but I haven't quite nailed down what is happening.
Ah that is interesting. From my experience its not just ffmpeg that has this there are quite a few man pages that use this lowercase utf-8. I am not sure if we do find a solution how could we implement a fix for all effected packages. Could we just sed and uppercase the headers? Nah, the fix will be a patch for man-db for sure. Just need to figure out exactly where this blows up. could this patch from alpine help in anyway? https://git.alpinelinux.org/aports/tree/community/man-db/ignore.patch yep turns out that patch fixes man ffmpeg That patch will be part of the fix. However it will need to be adapted to work with both glibc and musl and sent upstream. The other thing that needs fixing is to have man-db recognize that "utf-8" and "UTF-8" are the same encoding and not trigger this weird chain of transcoding commands for no reason. Has there been any more work on this? Nope. |