When RUST_MIN_VER is set (and not RUST_MAX_VER), we can do a bit better with how we express the dependency. Right now, we generate for, say, RUST_MIN_VER=1.78: ``` || ( dev-lang/rust:1.81 dev-lang/rust-bin:1.81 dev-lang/rust:1.80 dev-lang/rust-bin:1.80 dev-lang/rust:1.79 dev-lang/rust-bin:1.79 dev-lang/rust:1.78 dev-lang/rust-bin:1.78 ) ``` This is both: a) unnecessarily large (although who cares), and more importantly b) restrictive when new versions are added to tree. If we instead expand RUST_MIN_VER when it is set and RUST_MAX_VER isn't to `|| ( >=dev-lang/rust-1.78:* >=dev-lang/rust-bin-1.78:* )`, we allow new slots of Rust to satisfy it immediately without people having to revbump to allow upgrades/depcleaning of old slots.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9224c0acf8aa541c49de424042c88e87f0e76e26 commit 9224c0acf8aa541c49de424042c88e87f0e76e26 Author: Matt Jolly <kangie@gentoo.org> AuthorDate: 2024-11-10 01:24:33 +0000 Commit: Matt Jolly <kangie@gentoo.org> CommitDate: 2024-11-11 08:49:16 +0000 eclass: update rust usedep handling; address feedback - Inherit llvm-r1 where required and let it die if LLVM_COMPAT is not set. - New variable: RUST_MULTILIB; if set will generate a multilib usedep for supported rust slots. - RUST_USEDEP -> RUST_REQ_USE to be consistent with other eclasses (ebuild updates handled in a followup commit). - Tidyup & address feedback - Improve RUST_MIN_VER (only) dependency specification Closes: https://bugs.gentoo.org/943206 Signed-off-by: Matt Jolly <kangie@gentoo.org> eclass/rust.eclass | 126 ++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 60 deletions(-)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=34b74faa06a90bf9d4f62ecfca746b380d60517a commit 34b74faa06a90bf9d4f62ecfca746b380d60517a Author: Matt Jolly <kangie@gentoo.org> AuthorDate: 2024-11-12 03:07:51 +0000 Commit: Matt Jolly <kangie@gentoo.org> CommitDate: 2024-11-12 09:07:42 +0000 rust.eclass: revert simplified dependency simplification The simplified dependency specification for cases where no RUST_MAX_SLOT is set is the desired end state, however the edge case where portage drops blockers with `--keep-going` has an unfortunate interaction where both packages are installed simultaneously, e.g. dev-lang/rust-1.82.0:stable and dev-lang/rust-1.82.0:1.82.0, and there's no easy way for end users to resolve that as the legacy (though masked) ebuilds will meet the simple Rust dependency. Both packages install rlibs with different hashes in them to the same path (as shown below) resulting in failures when a package attempts to link against an rlib and finds two. 1.82.0: .../x86_64-unknown-linux-gnu/lib/libunwind-fc4fe814489209c6.rlib 1.82.0-r100: .../x86_64-unknown-linux-gnu/lib/libunwind-ab65e6747cbe4a5a.rlib Bug: https://bugs.gentoo.org/943143 Bug: https://bugs.gentoo.org/943206 Signed-off-by: Matt Jolly <kangie@gentoo.org> eclass/rust.eclass | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-)
We may be able to try this again now that bug 943308 is sorted, as the affected Rust versions have a workaround in there.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=63d033755d8c75aea10c6bdff41deaa533cd6cdd commit 63d033755d8c75aea10c6bdff41deaa533cd6cdd Author: Sam James <sam@gentoo.org> AuthorDate: 2025-05-16 09:53:33 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-05-16 09:57:01 +0000 Revert "rust.eclass: revert simplified dependency simplification" This reverts commit 34b74faa06a90bf9d4f62ecfca746b380d60517a, i.e. reapplies the simplified dependency specification. We had to revert this before because of the collision issues when switching to slotted Rust where the same Rust version existed before in a non-slotted variant. We have a sanity check and workaround for that in pkg_postinst for affected versions now, so there shouldn't be a reason we can't do this. This may ease depcleaning older Rust in some cases w/o having to rebuild packages against new Rust. Bug: https://bugs.gentoo.org/943143 Bug: https://bugs.gentoo.org/943206 Bug: https://bugs.gentoo.org/953884 Signed-off-by: Sam James <sam@gentoo.org> eclass/rust.eclass | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
I don't know if we want to generate a tighter range when both are set or not.