Bug 16132 - rust-native: sstate is not reused between risc-v and any other target
Summary: rust-native: sstate is not reused between risc-v and any other target
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Undecided normal
Target Milestone: 0.0.0
Assignee: Unassigned
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2026-01-14 10:16 UTC by Alexander Kanavin
Modified: 2026-01-15 15:38 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kanavin 2026-01-14 10:16:01 UTC
I've noticed that rust-native is being rebuilt when MACHINE is set to qemurisv64, even though a suitable rust-native is in sstate (and is used for other targets).

Via task signatures this has been traced to the following code in meta/classes-recipe/rust-target-config.bbclass

    if "riscv64" in tspec['llvm-target']:
        tspec['llvm-abiname'] = d.getVar('TUNE_RISCV_ABI')
    if "riscv32" in tspec['llvm-target']:
        tspec['llvm-abiname'] = d.getVar('TUNE_RISCV_ABI')


Unfortunately this adds a dependency on TUNE_RISCV_ABI (which is set only if the target is a risc-v machine) to rust-native's rust_gen_targets task, breaking sstate reuse for it between risc-v and any other target. I can imagine other native pieces written in rust will have the same issue.

It's not immediately obvious to me how to address this, so I'd really appreciate suggestions. The code is hairy (i.e. tricky and brittle).
Comment 1 Alexander Kanavin 2026-01-14 13:46:37 UTC
Patches: https://patchwork.yoctoproject.org/project/oe-core/list/?series=42264