Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 787056 - sys-devel/{binutils,gcc}: improve man & info page handling
Summary: sys-devel/{binutils,gcc}: improve man & info page handling
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-30 07:34 UTC by rnddim
Modified: 2023-05-01 16:12 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rnddim 2021-04-30 07:34:40 UTC
After installing gcc-11.1.0, I find that its manpages and info documentation are inaccessible by their utilities. Commands like "man c++" or "info gcc" fail to give back anything.

Using "equery f sys-devel/gcc" shows that the documentation does get installed, they just can't be retrieved by their respective utilities. This makes me wonder if storing them under a directory like "/usr/share/gcc-data/x86_64-pc-linux-gnu/11.1.0/" (where they are in my case) is a new change for GCC that has yet to be accounted for.

Reproducible: Always

Steps to Reproduce:
1. Install gcc-11.1.0 (use of the "doc" USE flag is not required)
2. Check the files exist in the "man" and "info" subdirectories under /usr/share/gcc-data/<target triple>/<version>/
3. Try finding these files via "man gcc" or "info gcc"
Actual Results:  
Both "man" and "info" insist the documentation for GCC does not exist.

Expected Results:  
Both "man" and "info" should display the documentation that comes with GCC.
Comment 1 Ingo Brunberg 2021-04-30 08:46:50 UTC
Configuration files that adjust MANPATH and INFOPATH accordingly are installed into /etc/env.d/gcc.

I guess the reporter overrides these environment variables in his personal .bashrc, .bash_profile or similar files.
Comment 2 rnddim 2021-04-30 08:49:59 UTC
I have never once modified my MANPATH or INFOPATH settings, and I just double-checked my ~/.bashrc to make sure it wasn't calling on something that does change it. I promise you that the reporter has never once in her life fiddled with how "man" or "info" find their documentation.
Comment 3 rnddim 2021-04-30 09:36:34 UTC
I just realized that maybe I should check the aforementioned MANPATH and INFOPATH, and it turns out they were looking for a non-existent old version of GCC. Doing the whole "source /etc/profile" thing updated those variables as you'd expect.

In the future, it would be nice if emerge gave a post-install reminder to refresh these variables, since I never would've expected man and info to rely on environment variables, of all things, to function as their documentation databases. I actually tried to find some tool to manually regenerate man's database before filing a report, and my search results never brought this up.
Comment 4 jospezial 2021-04-30 14:54:47 UTC
(In reply to rnddim from comment #0)
> After installing gcc-11.1.0, I find that its manpages and info documentation
> are inaccessible by their utilities. Commands like "man c++" or "info gcc"
> fail to give back anything.
> 
> Using "equery f sys-devel/gcc" shows that the documentation does get
> installed, they just can't be retrieved by their respective utilities. This
> makes me wonder if storing them under a directory like
> "/usr/share/gcc-data/x86_64-pc-linux-gnu/11.1.0/" (where they are in my
> case) is a new change for GCC that has yet to be accounted for.
> 
> Reproducible: Always
> 
> Steps to Reproduce:
> 1. Install gcc-11.1.0 (use of the "doc" USE flag is not required)
> 2. Check the files exist in the "man" and "info" subdirectories under
> /usr/share/gcc-data/<target triple>/<version>/
> 3. Try finding these files via "man gcc" or "info gcc"
> Actual Results:  
> Both "man" and "info" insist the documentation for GCC does not exist.
> 
> Expected Results:  
> Both "man" and "info" should display the documentation that comes with GCC.

man c++
Kein Handbucheintrag für c++ vorhanden

man gcc
works

info works for both
Comment 5 rnddim 2021-04-30 15:00:24 UTC
Sorry, my original comment had a typo there. It should've read "man g++" instead of c++.
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2021-05-01 19:51:58 UTC
gcc switch already prints the suggestion to source /etc/profile:

# gcc-config 48
 * Switching native-compiler to x86_64-pc-linux-gnu-12.0.0 ...
>>> Regenerating /etc/ld.so.cache...                                      [ ok ]

 * If you intend to use the gcc from the new profile in an already
 * running shell, please remember to do:

 *   . /etc/profile

Unfortunately it does not get piped to `einfo` to get printed after full merge session.

I'd like gcc-config to provide stable directory for man and info files, e.g. instead of current:
    /etc/env.d/04gcc-x86_64-pc-linux-gnu
    # Autogenerated by 'gcc-config'.
    GCC_SPECS=""
    MANPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/12.0.0/man"
    INFOPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/12.0.0/info"
something like
    /etc/env.d/04gcc-x86_64-pc-linux-gnu
    # Autogenerated by 'gcc-config'.
    GCC_SPECS=""
    MANPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/current/man"
    INFOPATH="/usr/share/gcc-data/x86_64-pc-linux-gnu/current/info"

where /usr/share/gcc-data/x86_64-pc-linux-gnu/current/{man,info} is maintained by gcc-config.
Comment 7 SpanKY gentoo-dev 2021-10-19 16:51:26 UTC
for other multislot packages, we install the man & info pages with version suffixes.  for example, autoconf & automake are using -$SLOT suffixes.

we should look at doing the same for binutils & gcc.  this would avoid the need for constant env shuffling with the docs, and make it so people could easily flip between diff versions documentation.  e.g. they can run `man gcc-11` and `man gcc-10` in diff windows.

renaming man pages is trivial, so we should start there.  info pages have long given us trouble due to self referencing nodes needing renaming (e.g. autoconf has literal "autoconf" nodes that look for autoconf.info that we have to rewrite to "autoconf-$SLOT" everywhere so as to not break it).
Comment 8 Arsen Arsenović gentoo-dev 2023-05-01 16:12:00 UTC
(In reply to SpanKY from comment #7)
> for other multislot packages, we install the man & info pages with version
> suffixes.  for example, autoconf & automake are using -$SLOT suffixes.
> 
> we should look at doing the same for binutils & gcc.  this would avoid the
> need for constant env shuffling with the docs, and make it so people could
> easily flip between diff versions documentation.  e.g. they can run `man
> gcc-11` and `man gcc-10` in diff windows.
> 
> renaming man pages is trivial, so we should start there.  info pages have
> long given us trouble due to self referencing nodes needing renaming (e.g.
> autoconf has literal "autoconf" nodes that look for autoconf.info that we
> have to rewrite to "autoconf-$SLOT" everywhere so as to not break it).

i don't believe that to be the right fix as it introduces gentoo-specific behavior.  IMO, we should promote the selected config into a more permanent location in *PATH.

info viewers prefer sibling files to path (by default) on top of that, so they should behave well for our use case.