Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 945752 - rust.eclass: add ERUSTC (?) or respect RUSTC variable to allow choosing Rust compiler as long as it's suitable
Summary: rust.eclass: add ERUSTC (?) or respect RUSTC variable to allow choosing Rust ...
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: 2024-12-02 16:13 UTC by Sam James
Modified: 2024-12-08 23:34 UTC (History)
1 user (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 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-02 16:13:11 UTC
Prompted by https://bugs.gentoo.org/945751#c2 but been on my mind otherwise.

It'd be nice if we had an ERUSTC or RUSTC variable we can set to say "please use this version of rustc, assuming it's compatible" (i.e. it would still have to pass RUST_MIN_SLOT/RUST_MAX_SLOT checks, it would just affect iteration order; we would check the slot referenced by $VAR first, then do the usual iteration).

Would also be nice if could do "-bin" or something in there to prefer bin (or not).
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-12-02 16:15:13 UTC
Another option could be to (as well?) prefer the eselect-ed Rust if suitable over iteration.
Comment 2 Larry the Git Cow gentoo-dev 2024-12-04 11:33:02 UTC
The bug has been closed via the following commit(s):

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

commit 4ff6bf33c94566b2acc07b75712094d567c77fc9
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2024-12-03 12:06:30 +0000
Commit:     Matt Jolly <kangie@gentoo.org>
CommitDate: 2024-12-04 11:30:31 +0000

    rust.eclass: add ERUST_{SLOT,TYPE} user variables
    
    These variables enable users (though most likely Gentoo developers)
    to override the selection of the Rust implementation by the eclass.
    
    This means that _only_ the specified ERUST_SLOT and/or ERUST_TYPE
    ('source' or 'binary') will be checked for, with the eclass `die`ing
    with "No Rust slot satisfying the package's dependencies..." if the
    selected impl is not available.
    
    These variables are intended to enable reproducing bugs and testing
    packages against specific dev-lang/rust{,-bin} packages; they must
    not be set in ebuilds.
    
    Closes: https://bugs.gentoo.org/945752
    Signed-off-by: Matt Jolly <kangie@gentoo.org>

 eclass/rust.eclass | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 5 deletions(-)
Comment 3 Matt Jolly gentoo-dev 2024-12-04 11:36:31 UTC
Commit accidentally pushed; reverted in 7687cc69cda0158af53edae6d89944653760dea9 .

Minor changes requested and slightly more time for feedback before merging this.
Comment 4 Larry the Git Cow gentoo-dev 2024-12-08 23:34:35 UTC
The bug has been closed via the following commit(s):

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

commit d1ef411b6e2cab683bbaf83a03f44b22fd46cede
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2024-12-03 12:22:37 +0000
Commit:     Matt Jolly <kangie@gentoo.org>
CommitDate: 2024-12-08 23:34:01 +0000

    rust.eclass: add ERUST_{SLOT,TYPE}_OVERRIDE user variables
    
    These variables enable users (though most likely Gentoo developers)
    to override the selection of the Rust implementation by the eclass.
    
    This means that _only_ the specified SLOT and/or TYPE ('source'/'binary')
    will be checked for, with the eclass `die`ing with
    "No Rust slot satisfying the package's dependencies..." if the
    selected impl is not available.
    
    These variables are intended to enable reproducing bugs and testing
    packages against specific dev-lang/rust{,-bin} packages; they must
    not be set in ebuilds.
    
    Closes: https://bugs.gentoo.org/945752
    Signed-off-by: Matt Jolly <kangie@gentoo.org>

 eclass/rust.eclass | 49 ++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 44 insertions(+), 5 deletions(-)