Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 835800 - dev-lang/rust: /usr/bin/cargo guesses wrong os without the presence of sys-apps/lsb-release at runtime
Summary: dev-lang/rust: /usr/bin/cargo guesses wrong os without the presence of sys-ap...
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: https://github.com/stanislav-tkach/os...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-22 12:58 UTC by tt_1
Modified: 2024-02-18 14:45 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 tt_1 2022-03-22 12:58:33 UTC
so when I fired up /usr/bin/cargo -vV, it shows:

/usr/bin/cargo -Vv
cargo 1.58.0
release: 1.58.0
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1 (sys:0.4.51+curl-7.80.0 system ssl:OpenSSL/1.1.1n)
os: Linux 2.7 [64-bit]


if the gentoo install doesn't have sys-apps/lsb-release emerged at runtime, cargo believes it is on an OS called OracleLinux: 

cargo -Vv
cargo 1.58.0
release: 1.58.0
host: x86_64-gentoo-linux-musl
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.79.1 (sys:0.4.51+curl-7.80.0 system ssl:OpenSSL/1.1.1n)
os: OracleLinux [64-bit]


I don't know if this has any real world consequences, but adding sys-apps/lsb-release to runtime dependencies of dev-lang/rust will propably not hurt anyone.
Comment 2 Georgy Yakovlev archtester gentoo-dev 2022-03-25 06:04:42 UTC
will check it out, thanks for finding exact crate responsible.
while we can add lsb-release support and it looks harmless indeed, I believe crate needs to be fixed too =) there are some PRs got in that fixed other distros mis-detected too.
Comment 3 tt_1 2022-03-25 06:10:06 UTC
I believe that /etc/gentoo-release from baselayout would be a good source for the crate.
Comment 4 Larry the Git Cow gentoo-dev 2022-04-08 05:25:56 UTC
The bug has been referenced in the following commit(s):

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

commit 1bcdd0766268c493cddfbe5a20637d89d4e8a8f2
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-04-08 01:24:10 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-04-08 04:58:48 +0000

    dev-lang/rust: add 1.60.0
    
    Bug: https://bugs.gentoo.org/835800
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust/Manifest           |  34 ++
 dev-lang/rust/rust-1.60.0.ebuild | 703 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 737 insertions(+)

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

commit 1d77470d58e206aa88fb7b72473f4b90fd38d191
Author:     Georgy Yakovlev <gyakovlev@gentoo.org>
AuthorDate: 2022-04-08 01:23:50 +0000
Commit:     Georgy Yakovlev <gyakovlev@gentoo.org>
CommitDate: 2022-04-08 04:58:48 +0000

    dev-lang/rust-bin: add 1.60.0
    
    Bug: https://bugs.gentoo.org/835800
    Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>

 dev-lang/rust-bin/Manifest               |  33 +++++
 dev-lang/rust-bin/rust-bin-1.60.0.ebuild | 219 +++++++++++++++++++++++++++++++
 2 files changed, 252 insertions(+)
Comment 5 tt_1 2022-08-05 11:03:46 UTC
there is a fix which landed in os_info, and it seems that it will be available through rust-1.64.0; if someone has the nightly available - maybe you can confirm the fix?
Comment 6 tt_1 2024-02-18 14:45:19 UTC
the fix is in the crate, and all current rust versions have the crate updated to include the fix: 

$ cargo -Vv

cargo 1.75.0 (1d8b05cdd 2023-11-20)
release: 1.75.0
commit-hash: 1d8b05cdd1287c64467306cf3ca2c8ac60c11eb0
commit-date: 2023-11-20
host: aarch64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u  30 May 2023
os: Gentoo Linux 2.14 [64-bit]