diff options
| author | Gyorgy Sarvari <skandigraun@gmail.com> | 2025-09-05 22:28:12 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-09-08 18:02:40 +0100 |
| commit | 533adb63d178be9feb4ba62862a4eb254d02726b (patch) | |
| tree | 571e4141ce7d2d0eee1cf10b5723f84241204332 /meta | |
| parent | 54e5c536db0ed5fa76242d3fadbf64a8cee1f464 (diff) | |
| download | poky-533adb63d178be9feb4ba62862a4eb254d02726b.tar.gz | |
rust-target-config.bbclass: move target generation before do_configure
The rust_get_targets task from the rust-target-config class generates some
Rust compiler configurations for different the target and host machine, which
is used by Rust during compiling a recipe. These configurations supposed to
be available by the time the Rust compiler is used for the first time.
By default, this task is executed "before do_compile" - it assumes that
this is the first task that would use this configuration.
However this is not always the case, especially with projects which are not
pure Cargo projects, rather Cargo/Rust is called by a different build system.
As an example librsvg uses meson, and during the do_configure step Meson probes
the Rust compiler, trying to gather some library info from Rust. In case the
rust_gen_targets task was executed before the do_configure task, then
everything works. However this is not always the case - sometimes the job is
executed between the configure and compile steps, in which case the configuration
fails.
To avoid such problems, generate these targets before the do_configure step.
(From OE-Core rev: 1d3c02553122982daedfe32c6ce09fac9e091952)
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes-recipe/rust-target-config.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes-recipe/rust-target-config.bbclass b/meta/classes-recipe/rust-target-config.bbclass index 2114c5850c..e53c5d1bc6 100644 --- a/meta/classes-recipe/rust-target-config.bbclass +++ b/meta/classes-recipe/rust-target-config.bbclass | |||
| @@ -443,7 +443,7 @@ python do_rust_gen_targets () { | |||
| 443 | rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_ARCH')) | 443 | rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_ARCH')) |
| 444 | } | 444 | } |
| 445 | 445 | ||
| 446 | addtask rust_gen_targets after do_patch before do_compile | 446 | addtask rust_gen_targets after do_patch before do_configure |
| 447 | do_rust_gen_targets[dirs] += "${RUST_TARGETS_DIR}" | 447 | do_rust_gen_targets[dirs] += "${RUST_TARGETS_DIR}" |
| 448 | 448 | ||
| 449 | # For building target C dependecies use only compiler parameters defined in OE | 449 | # For building target C dependecies use only compiler parameters defined in OE |
