]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
cargo.bbclass: set up cargo environment in common do_compile
authorAlexander Kanavin <alex.kanavin@gmail.com>
Sun, 25 Jun 2023 21:22:25 +0000 (23:22 +0200)
committerSteve Sakoman <steve@sakoman.com>
Tue, 19 Sep 2023 14:19:54 +0000 (04:19 -1000)
cargo_do_compile runs only if the recipe is built using cargo
as the top level tool. Some recipes hide usage of cargo inside setuptools
(or autoconf) and use do_compile definitions specific to those,
and so the environment isn't properly set up.

This was exposed by latest versions of python3-cryptography.

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>
(cherry picked from commit 9f4ff643a028d7f5670d80861f2ce19ca2d90faa)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/cargo.bbclass
meta/classes/cargo_common.bbclass

index 4a780a501ff6114cf30e5415952c0f5cb1d927df..6df3b19b00b98fd9f08116382372e80764d47091 100644 (file)
@@ -49,7 +49,6 @@ oe_cargo_build () {
 
 do_compile[progress] = "outof:\s+(\d+)/(\d+)"
 cargo_do_compile () {
-       oe_cargo_fix_env
        oe_cargo_build
 }
 
index 1e9d284b5d36829836f0af5976cdbc6df87b2af0..c1bc142d85c0abea68a941b34dd1cbee299a3abe 100644 (file)
@@ -101,6 +101,10 @@ cargo_common_do_configure () {
        EOF
 }
 
+do_compile:prepend () {
+        oe_cargo_fix_env
+}
+
 oe_cargo_fix_env () {
        export CC="${RUST_TARGET_CC}"
        export CXX="${RUST_TARGET_CXX}"