From: Matt Jolly <
[email protected]>
This commit addresses some feedback that the Rust eclass should provide feedback to users on what it's actually doing and why a particular
Rust was (or was not) deemed suitable for use.
To do this we now:
- Explicitly note if a Rust slot was skipped due to LLVM_SLOT
incompatibility
- Provide a python-utils-r1 style `Checking whether Rust SLOT is
suitable ...` for each slot
- List each package (and usedep) that we are checking for
- Provide an error message that clearly explains the requirements
if no suitable package is available.
`_get_rust_slot` has been adjusted to export RUST_SLOT and RUST_TYPE
if a suitable slot is found.
Still TODO is enhancing output for `rust_check_deps` (perhaps
ebegin/eend?), however there don't appear to be any consumers
in the wild, this can probably wait a little longer.
Signed-off-by: Matt Jolly <
[email protected]>
---
eclass/rust.eclass | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/eclass/rust.eclass b/eclass/rust.eclass
index eb14ca2329b5..a7199f984af8 100644
--- a/eclass/rust.eclass
+++ b/eclass/rust.eclass
@@ -286,7 +286,8 @@ unset -f _rust_set_globals
# @USAGE: [-b|-d]
# @DESCRIPTION:
# Find the newest Rust install that is acceptable for the package,
-# and print its version number (i.e. SLOT) and type (source or bin[ary]).
+# and export its version (i.e. SLOT) and type (source or bin[ary])
+# as RUST_SLOT and RUST_TYPE.
#
# If -b is specified, the checks are performed relative to BROOT,
# and BROOT-path is returned. -b is the default.
@@ -363,10 +364,13 @@ _get_rust_slot() {
# If we're in LLVM mode we can skip any slots that don't match the selected USE
if [[ -n "${RUST_NEEDS_LLVM}" ]]; then
if [[ "${llvm_slot}" != "${llvm_r1_slot}" ]]; then
+ einfo "Skipping Rust ${slot} as it does not match llvm_slot_${llvm_r1_slot}"
con