Bug 2152697
Summary: | rust2rpm / rust-packaging doesn't support Rust 1.60+ features for optional and conditional dependencies | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Fabio Valentini <decathorpe> |
Component: | rust-packaging | Assignee: | Rust SIG <rust-sig> |
Status: | CLOSED ERRATA | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 38 | CC: | decathorpe, fge, igor.raits, rust-sig |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | rust-packaging-24-1.fc39 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-02-16 18:43:10 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | 2169233 | ||
Bug Blocks: | 2117147, 2119164, 2125013, 2126224, 2136580, 2137029, 2137245, 2140158, 2140269, 2148310, 2166384, 2167496 |
Description
Fabio Valentini
2022-12-12 17:54:22 UTC
*** Bug 2161128 has been marked as a duplicate of this bug. *** Hi Fabio, In case you didn't noticed, currently rust packaging tool is treating __every__ dependency as a internal feature. For example, the rust-rtnetlink has Cargo.toml [features] test_as_root = [] default = ["tokio_socket"] tokio_socket = ["netlink-proto/tokio_socket", "tokio"] smol_socket = ["netlink-proto/smol_socket", "async-global-executor"] Then fedora packaging tool is treating `tokio` as a feature: `rust-rtnetlink+tokio-devel.noarch`. A lot rust crate package is impacted on this. Hi Gris - it looks like there's a misunderstanding here. I am well aware about how our rust packaging works, and the behaviour is correct. :) In cargo, optional dependencies *are* features. And up until Rust 1.60, there was no way to discriminate between optional dependencies that are supposed to be "internal" (i.e. implenentation details) or "public". In your example, "tokio" is indeed an optional dependency, which is turned into a feature by cargo. Now, what's new with Rust 1.60 is that you can actually mark optional dependencies as "private", in your example, that would look like using tokio_socket = ["netlink-proto/tokio_socket", "dep:tokio"] instead of tokio_socket = ["netlink-proto/tokio_socket", "tokio"] as cargo now no longer generates implicit features for optional dependencies if they are referenced like "dep:foo". This new syntax is what our tools don't understand yet. But for packages that *don't* use this syntax, the generated feature subpackages *are correct* and match upstream cargo behaviour. This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38. FEDORA-2023-77a65a092d has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-77a65a092d FEDORA-2023-77a65a092d has been pushed to the Fedora 39 stable repository. If problem still persists, please make note of it in this bug report. |