commit:     c3b28333c0bd00bf405559c15de1551e17fdd9a6
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 31 02:31:14 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Oct 31 02:31:14 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3b28333

dev-lang/rust: re-sync 1.91.0_beta* with 1.90.0 and 9999

The wasm changes got lost somewhere.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-lang/rust/rust-1.91.0_beta20251009.ebuild | 31 ++++++++++++++++++---------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/dev-lang/rust/rust-1.91.0_beta20251009.ebuild 
b/dev-lang/rust/rust-1.91.0_beta20251009.ebuild
index b84b675c5c36..004abcb8339d 100644
--- a/dev-lang/rust/rust-1.91.0_beta20251009.ebuild
+++ b/dev-lang/rust/rust-1.91.0_beta20251009.ebuild
@@ -62,10 +62,15 @@ for _x in "${_ALL_RUST_EXPERIMENTAL_TARGETS[@]}"; do
        ALL_RUST_EXPERIMENTAL_TARGETS["llvm_targets_${_x}"]=0
 done
 
+# Bare metal targets which can be built on the host system and have no
+# dependency on compiler runtime, libc and unwinder.
+ALL_RUST_SYSROOTS=( bpf wasm )
+ALL_RUST_SYSROOTS=( "${ALL_RUST_SYSROOTS[@]/#/rust_sysroots_}" )
+
 LICENSE="|| ( MIT Apache-2.0 ) BSD BSD-1 BSD-2 BSD-4"
 SLOT="${PV%%_*}" # Beta releases get to share the same SLOT as the eventual 
stable
 
-IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto 
rustfmt rust-analyzer rust-src +system-llvm test wasm ${ALL_LLVM_TARGETS[*]}"
+IUSE="big-endian clippy cpu_flags_x86_sse2 debug dist doc llvm-libunwind lto 
rustfmt rust-analyzer rust-src system-llvm test ${ALL_LLVM_TARGETS[*]} 
${ALL_RUST_SYSROOTS[*]}"
 
 if [[ ${PV} = *9999* ]]; then
        # These USE flags require nightly rust
@@ -80,7 +85,7 @@ for _x in "${ALL_LLVM_TARGETS[@]}"; do
                ALL_RUST_EXPERIMENTAL_TARGETS["${_x}"]=1
        fi
 done
-LLVM_DEPEND+=( "       wasm? ( $(llvm_gen_dep 'llvm-core/lld:${LLVM_SLOT}') )" 
)
+LLVM_DEPEND+=( "       rust_sysroots_wasm? ( $(llvm_gen_dep 
'llvm-core/lld:${LLVM_SLOT}') )" )
 LLVM_DEPEND+=( "       $(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}')" )
 
 # dev-libs/oniguruma is used for documentation
@@ -132,7 +137,8 @@ RDEPEND="${DEPEND}
 REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )
        rust-analyzer? ( rust-src )
        test? ( ${ALL_LLVM_TARGETS[*]} )
-       wasm? ( llvm_targets_WebAssembly )
+       rust_sysroots_bpf? ( llvm_targets_BPF )
+       rust_sysroots_wasm? ( llvm_targets_WebAssembly )
        x86? ( cpu_flags_x86_sse2 )
 "
 
@@ -194,7 +200,8 @@ pre_build_checks() {
                        M=$(( $(usex ${ltarget} 256 0) + ${M} ))
                done
        fi
-       M=$(( $(usex wasm 256 0) + ${M} ))
+       M=$(( $(usex rust_sysroots_bpf 256 0) + ${M} ))
+       M=$(( $(usex rust_sysroots_wasm 256 0) + ${M} ))
        M=$(( $(usex debug 2 1) * ${M} ))
        eshopts_push -s extglob
        if is-flagq '-g?(gdb)?([1-9])'; then
@@ -355,7 +362,10 @@ src_configure() {
        for v in $(multilib_get_enabled_abi_pairs); do
                rust_targets+=",\"$(rust_abi $(get_abi_CHOST ${v##*.}))\""
        done
-       if use wasm; then
+       if use rust_sysroots_bpf; then
+               rust_targets+=",\"bpfeb-unknown-none\",\"bpfel-unknown-none\""
+       fi
+       if use rust_sysroots_wasm; then
                rust_targets+=",\"wasm32-unknown-unknown\""
                if use system-llvm; then
                        # un-hardcode rust-lld linker for this target
@@ -505,14 +515,14 @@ src_configure() {
                omit-git-hash = false
                dist-src = false
                remap-debuginfo = true
-               lld = $(usex system-llvm false $(toml_usex wasm))
+               lld = $(usex system-llvm false $(toml_usex rust_sysroots_wasm))
                $(if use lto && tc-is-clang && ! tc-ld-is-mold; then
                        echo "use-lld = true"
                fi)
                # only deny warnings if doc+wasm are NOT requested, documenting 
stage0 wasm std fails without it
                # https://github.com/rust-lang/rust/issues/74976
                # https://github.com/rust-lang/rust/issues/76526
-               deny-warnings = $(usex wasm $(usex doc false true) true)
+               deny-warnings = $(usex rust_sysroots_wasm $(usex doc false 
true) true)
                backtrace-on-ice = true
                jemalloc = false
                # See https://github.com/rust-lang/rust/issues/121124
@@ -552,7 +562,7 @@ src_configure() {
                        _EOF_
                fi
        done
-       if use wasm; then
+       if use rust_sysroots_wasm; then
                wasm_target="wasm32-unknown-unknown"
                export CFLAGS_${wasm_target//-/_}="$(filter-flags '-mcpu*' 
'-march*' '-mtune*'; echo "$CFLAGS")"
                cat <<- _EOF_ >> "${S}"/bootstrap.toml
@@ -722,9 +732,10 @@ src_install() {
 
        docompress /usr/lib/${PN}/${SLOT}/share/man/
 
-       # bug #689562, #689160
+       # bash-completion files are installed by dev-lang/rust-common instead
+       # bug #689562, #689160.
        rm -v "${ED}/usr/lib/${PN}/${SLOT}/etc/bash_completion.d/cargo" || die
-       rmdir -v "${ED}/usr/lib/${PN}/${SLOT}"/etc/bash_completion.d || die
+       rmdir -v "${ED}/usr/lib/${PN}/${SLOT}/etc/bash_completion.d" || die
 
        local symlinks=(
                cargo

Reply via email to