]> 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)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 27 Jun 2023 15:23:34 +0000 (16:23 +0100)
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>
meta/classes-recipe/cargo.bbclass
meta/classes-recipe/cargo_common.bbclass

index 7a8cc1e75188eac8cdf4ad29cdaed866deabf226..3ef0bbbb44e9670a03b205ae6b0cbb6a48363fb1 100644 (file)
@@ -55,7 +55,6 @@ oe_cargo_build () {
 
 do_compile[progress] = "outof:\s+(\d+)/(\d+)"
 cargo_do_compile () {
-       oe_cargo_fix_env
        oe_cargo_build
 }
 
index 82ab25b59c59de77cff06e753cbbcbe5c9713912..1ca0be471cec1876b7b0772bb00d0db31ae9a06c 100644 (file)
@@ -149,6 +149,10 @@ python cargo_common_do_patch_paths() {
 }
 do_configure[postfuncs] += "cargo_common_do_patch_paths"
 
+do_compile:prepend () {
+        oe_cargo_fix_env
+}
+
 oe_cargo_fix_env () {
        export CC="${RUST_TARGET_CC}"
        export CXX="${RUST_TARGET_CXX}"