Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 715890 - cargo.eclass has a logic error / oversight in doman
Summary: cargo.eclass has a logic error / oversight in doman
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-02 10:16 UTC by Jannik Glückert
Modified: 2024-02-11 06:01 UTC (History)
6 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 Jannik Glückert 2020-04-02 10:16:26 UTC
In the cargo.eclass in cargo_src_install, line 181 there is

[ -d "${S}/man" ] && doman "${S}/man" || return 0

However, invoking doman on a directory returns an error, and the ebuild fails.
Instead, it should be

[ -d "${S}/man" ] && doman "${S}/man/*" || return 0

An example where this is an issue is https://github.com/orhun/kmon

Note that this fix does not cover the edge case of directories within the man directory - why anyone would do this is beyond me, but I'm not to judge

Regards,
Jannik
Comment 1 Georgy Yakovlev archtester gentoo-dev 2020-04-03 22:39:37 UTC
Indeed it's wrong.
I currently use a workaround and move man directoy and call doman explicitly later in install phase, but it should be fixed.
Comment 2 Dennis Schridde 2021-04-18 12:15:44 UTC
Would it be possible to entirely remove this?  Man pages are generally not handled by Cargo, so cargo.eclass trying to install them is rather surprising.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2021-04-19 22:05:24 UTC
yes, it needs to go.
it's a historical thing that assumes that such directory structure is standard, which turned out not quite the fact.

I'll all in favor for removing it, but first I'll need to find all ebuilds that actually rely on it, and replace with proper doman calls.

Can't just make a eclass change that affects results of installation.

if you happen to know such ebuilds - let me know =)

Otherwise I'll have to emerge all cargo.eclass's cargo_src_install() consumers and check file lists.
Comment 4 Dennis Schridde 2021-04-20 10:46:02 UTC
(In reply to Georgy Yakovlev from comment #3)
> Can't just make a eclass change that affects results of installation.

Of course.

> if you happen to know such ebuilds - let me know =)
> 
> Otherwise I'll have to emerge all cargo.eclass's cargo_src_install()
> consumers and check file lists.

I only have a few Rust-based packages installed, but maybe this fish shell script helps:

❯ for inherit in /var/db/pkg/*/*/INHERITED
      grep -q cargo $inherit || continue
      set -l package (string replace /var/db/pkg/ '' (dirname $inherit))
      set -l contents (dirname $inherit)/CONTENTS
      grep -q '^dir /usr/share/man$' $contents && echo $package
  end
app-benchmarks/hyperfine-1.11.0
app-misc/skim-0.9.3
dev-vcs/mercurial-5.7
gui-libs/greetd-0.7.0
sys-apps/bat-0.17.1-r1
sys-apps/exa-0.9.0-r1
sys-apps/fd-8.2.1
sys-apps/ripgrep-12.1.1
sys-apps/zram-generator-0.3.2
x11-terms/alacritty-0.7.2

I also briefly checked whether https://www.portagefilelist.de could be of help, but they index only files, not directories, and the paths to those files are not searchable.
Comment 5 Larry the Git Cow gentoo-dev 2021-07-03 07:03:06 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e24170cba4af14df622c4a2d465534583d30d625

commit e24170cba4af14df622c4a2d465534583d30d625
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2021-07-02 00:34:04 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2021-07-03 06:59:09 +0000

    cargo.eclass: support EAPI=8, misc changes
    
    remove cargo-snapshot* unpacker, it was needed
    for separate dev-util/cargo we used to have.
    
    Bug: https://bugs.gentoo.org/715890
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 eclass/cargo.eclass | 39 ++++++++++++++++++++++++++-------------
 1 file changed, 26 insertions(+), 13 deletions(-)