Skip to contentSkip to conversation

rust: Rework and improve so SDK and target versions work

PATCH New Richard Purdie 1 participant 1 message Aug 5, 2022 1 message not in the archive

lore
Share & tools
lore
#1 lore raw

cover rust: Rework and improve so SDK and target versions work

In reply to a message not in the archive

This patch series:
* Uses RUST_{BUILD|HOST|TARGET}_SYS everywhere consistently within rust context
* Moves the on target libraries to rust's "sysroot" layout so the SDK can find libraries without prompting
* Moves the target SDK libraries into the target sysroot rather than the native one
* Enables the target rustc compiler to be built
* Replaces cargo-cross-canadian with nativesdk-cargo
* Drops rust-cross-XXX and uses rust-target-config to generate json config in each WORKDIR
* Add nativeksdk-rust as the SDK compiler
* Simplifies rust-cross-canadian-XXX to be the environment and json config for the target only (no binaries)
* Drop rust-crosssdk since it isnt needed now
* Drop a lot of the virtual/ compiler dependency mess since we don't need it
* Cargo cross-canadian environment config is compiled with rust-cross-canadian
* Adds RUST_{BUILD|HOST|TARGET}_SYS to the variable ignore list for hash purposes (since it should be accounted for in the build paths)
* Adds a slightly hacky approach to make target llvm-config work which removes the need for patching llvm.
* Drop rust-tools-cross-canadian and just build the tools as part of the main rust/nativesdk-rust recipe to avoid rebuilding large chunks of the toolchain

Work still remaining:
* Fully clean up the dependency simplification and removal of the virutal/ code.
* Remove RUST_TARGETGENS since I think it is the same everywhere now
* The rust recipe doesn't need to always build stage0
* The rust recipe doesn't need to always build libstd-rs since we have a separate recipe. May drop the separate recipe and just copy the pieces out of the target rust build
* Maybe drop RUSTC variable, not sure it is used?
* Properly investigate and fix the reproducibility issues the patch hacks around
* Fix reproducibility so we can remove the reproducibility exclusion for rust
* Work out why n32 doesn't build libstd-rs
* Drop llvm-config patch (only used by rust-llvm itself now)
* Consider tweaking mesa to use new llvm-config approach and drop patch there
* Track down and clean up obsolete/unused code. Install pieces in rust.inc?
* File bugs for remaining issues

Adding to an SDK looks like:

SDK_TOOLCHAIN_LANGS += "rust"