diff options
author | Alexander Kanavin <alex@linutronix.de> | 2024-05-21 14:50:39 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-05-28 15:09:01 +0100 |
commit | a7bf118441d81d47a8a2eb53a73b265d84c80d92 (patch) | |
tree | 71a9d7ad7575dce587287f55548516ecf1a934ad /meta/recipes-devtools/rust | |
parent | d419566eda490870a51fff5b94834d0564718e10 (diff) | |
download | poky-a7bf118441d81d47a8a2eb53a73b265d84c80d92.tar.gz |
rust: use rust-snapshot binaries only in rust-native
Otherwise, use rust-native and cargo-native binaries as that allows
our native tweaks in them to be used for target/nativesdk rust -
same as for everything else written in rust.
In particular, this allows building target rust with
cargo-native that includes important reproducibility tweaks.
Unfortunately, this also breaks rust selftest, and that
is partially addressed by the following commit.
[YOCTO #15185]
(From OE-Core rev: 8f2230cb51fe22ef4711a56fecfab4858c04e35b)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust')
-rw-r--r-- | meta/recipes-devtools/rust/rust_1.75.0.bb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/meta/recipes-devtools/rust/rust_1.75.0.bb b/meta/recipes-devtools/rust/rust_1.75.0.bb index c1b0a35e7b..d5bc057a45 100644 --- a/meta/recipes-devtools/rust/rust_1.75.0.bb +++ b/meta/recipes-devtools/rust/rust_1.75.0.bb | |||
@@ -11,6 +11,11 @@ DEPENDS += "file-native python3-native" | |||
11 | DEPENDS:append:class-native = " rust-llvm-native" | 11 | DEPENDS:append:class-native = " rust-llvm-native" |
12 | DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" | 12 | DEPENDS:append:class-nativesdk = " nativesdk-rust-llvm" |
13 | 13 | ||
14 | # native rust uses cargo/rustc from binary snapshots to bootstrap | ||
15 | # but everything else should use our native builds | ||
16 | DEPENDS:append:class-target = " cargo-native rust-native" | ||
17 | DEPENDS:append:class-nativesdk = " cargo-native rust-native" | ||
18 | |||
14 | DEPENDS += "rust-llvm (=${PV})" | 19 | DEPENDS += "rust-llvm (=${PV})" |
15 | 20 | ||
16 | RDEPENDS:${PN}:append:class-target = " gcc g++ binutils" | 21 | RDEPENDS:${PN}:append:class-target = " gcc g++ binutils" |
@@ -68,6 +73,11 @@ addtask do_test_compile after do_configure do_rust_gen_targets | |||
68 | do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" | 73 | do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" |
69 | do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" | 74 | do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" |
70 | 75 | ||
76 | RUSTC_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/rustc" | ||
77 | CARGO_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/cargo" | ||
78 | RUSTC_BOOTSTRAP:class-native = "${WORKDIR}/rust-snapshot/bin/rustc" | ||
79 | CARGO_BOOTSTRAP:class-native = "${WORKDIR}/rust-snapshot/bin/cargo" | ||
80 | |||
71 | python do_configure() { | 81 | python do_configure() { |
72 | import json | 82 | import json |
73 | import configparser | 83 | import configparser |
@@ -141,10 +151,10 @@ python do_configure() { | |||
141 | config.set("build", "docs", e(False)) | 151 | config.set("build", "docs", e(False)) |
142 | config.set("build", "tools", ["rust-demangler",]) | 152 | config.set("build", "tools", ["rust-demangler",]) |
143 | 153 | ||
144 | rustc = d.expand("${WORKDIR}/rust-snapshot/bin/rustc") | 154 | rustc = d.getVar('RUSTC_BOOTSTRAP') |
145 | config.set("build", "rustc", e(rustc)) | 155 | config.set("build", "rustc", e(rustc)) |
146 | 156 | ||
147 | cargo = d.expand("${WORKDIR}/rust-snapshot/bin/cargo") | 157 | cargo = d.getVar('CARGO_BOOTSTRAP') |
148 | config.set("build", "cargo", e(cargo)) | 158 | config.set("build", "cargo", e(cargo)) |
149 | 159 | ||
150 | config.set("build", "vendor", e(True)) | 160 | config.set("build", "vendor", e(True)) |