Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 955343 - dev-lang/rust-bin-1.86 fails to find crates in Gentoo Prefix on RHEL8
Summary: dev-lang/rust-bin-1.86 fails to find crates in Gentoo Prefix on RHEL8
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Rust Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-03 08:17 UTC by Yiyang Wu
Modified: 2025-05-19 08:14 UTC (History)
5 users (show)

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


Attachments
build.log for dev-lang/rust (build.log.xz,53.12 KB, application/x-xz)
2025-05-03 08:18 UTC, Yiyang Wu
Details
emerge --info output (emerge-info.txt,6.59 KB, text/plain)
2025-05-03 08:19 UTC, Yiyang Wu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yiyang Wu 2025-05-03 08:17:18 UTC
After upgrading to dev-lang/rust-bin-1.86-r1, almost any rust package cannot be built due to unable to find crates. The build.log is compiling dev-lang/rust-1.86.0-r1 itself:


error[E0463]: can't find crate for `clap_derive`
  --> /run/user/22252/portage/dev-lang/rust-1.86.0-r1/work/rustc-1.86.0-src/vendor/clap-4.5.20/src/lib.rs:91:9
   |
91 | pub use clap_derive::{self, Args, Parser, Subcommand, ValueEnum};
   |         ^^^^^^^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `clap` (lib) due to 1 previous error

This only occurs on Gentoo Prefix with RHEL8 as host OS. I copied this prefix onto Debian 13 host OS and it works without any issue, so I build dev-lang/rust and copied back to RHEL8. The compiled rust does not have problem on RHEL8, so the issue is with rust-bin. 



Reproducible: Always

Steps to Reproduce:
1. Start from a Gentoo Prefix on RHEL8 or similar distribution 
2. emerge -av rust-bin
3. emerge -av rust
Comment 1 Yiyang Wu 2025-05-03 08:18:18 UTC
Created attachment 927418 [details]
build.log for dev-lang/rust
Comment 2 Yiyang Wu 2025-05-03 08:19:11 UTC
Created attachment 927419 [details]
emerge --info output
Comment 3 Moritz Brunner 2025-05-19 07:49:31 UTC
I believe the problem is that the patchelf interpreter patching of Rust binaries is no longer happening in recent versions.

> patchelf --print-interpreter /srv/moritz/gentoo/usr/bin/rustc
/lib64/ld-linux-x86-64.so.2

The correct value for my system would be:
> patchelf --print-interpreter /srv/moritz/gentoo/bin/bash
/srv/moritz/gentoo/lib64/ld-linux-x86-64.so.2

The problem seems to be the `find' command that would normally pull a list of executables:

 * Changing interpreter to /srv/moritz/gentoo/lib64/ld-linux-x86-64.so.2 for Gentoo prefix at /srv/moritz/gentoo/var/tmp/portage/dev-lang/rust-bin-1.87.0/image/srv/moritz/gentoo/opt/1.87.0/bin ...
find: ‘/srv/moritz/gentoo/var/tmp/portage/dev-lang/rust-bin-1.87.0/image/srv/moritz/gentoo/opt/1.87.0/bin’: No such file or directory

The correct find path would be:
/srv/moritz/gentoo/var/tmp/portage/dev-lang/rust-bin-1.87.0/image/srv/moritz/gentoo/opt/rust-bin-1.87.0/bin

It would appear that the unpacked rust binary package was renamed from just the version number to rust-bin-versionnumber somewhat recently.
Comment 4 Yiyang Wu 2025-05-19 08:00:30 UTC
(In reply to Moritz Brunner from comment #3)
> 
> It would appear that the unpacked rust binary package was renamed from just
> the version number to rust-bin-versionnumber somewhat recently.

Ah, thanks!

Let's fix it
Comment 5 Larry the Git Cow gentoo-dev 2025-05-19 08:14:57 UTC
The bug has been closed via the following commit(s):

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

commit d9b69b495e07f21b8a49f38f87fed5babd3a9476
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2025-05-19 08:13:47 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2025-05-19 08:13:47 +0000

    dev-lang/rust-bin-1.87.0: fix patchelf for prefix
    
    Fix path to bin-dir.  Thanks Moritz Brunner in
    https://bugs.gentoo.org/955343#c3
    
    Closes: https://bugs.gentoo.org/955343
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 dev-lang/rust-bin/rust-bin-1.87.0.ebuild | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)