summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2023-06-25 23:22:25 +0200
committerSteve Sakoman <steve@sakoman.com>2023-09-23 05:26:16 -1000
commit598c3d25c6a5f3bffa9665d9bdb9862ad32d993e (patch)
tree02a64f8b357a6c80849e704384d04c587e371fe7
parent1cdf86a68f30924d4607e119ee82408e2fe3ae41 (diff)
downloadpoky-598c3d25c6a5f3bffa9665d9bdb9862ad32d993e.tar.gz
cargo.bbclass: set up cargo environment in common do_compile
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. (From OE-Core rev: a3f566fcbfc02e0a3b3f6a676d6dde88a5b50506) 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>
-rw-r--r--meta/classes/cargo.bbclass1
-rw-r--r--meta/classes/cargo_common.bbclass4
2 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes/cargo.bbclass b/meta/classes/cargo.bbclass
index 4a780a501f..6df3b19b00 100644
--- a/meta/classes/cargo.bbclass
+++ b/meta/classes/cargo.bbclass
@@ -49,7 +49,6 @@ oe_cargo_build () {
49 49
50do_compile[progress] = "outof:\s+(\d+)/(\d+)" 50do_compile[progress] = "outof:\s+(\d+)/(\d+)"
51cargo_do_compile () { 51cargo_do_compile () {
52 oe_cargo_fix_env
53 oe_cargo_build 52 oe_cargo_build
54} 53}
55 54
diff --git a/meta/classes/cargo_common.bbclass b/meta/classes/cargo_common.bbclass
index 1e9d284b5d..c1bc142d85 100644
--- a/meta/classes/cargo_common.bbclass
+++ b/meta/classes/cargo_common.bbclass
@@ -101,6 +101,10 @@ cargo_common_do_configure () {
101 EOF 101 EOF
102} 102}
103 103
104do_compile:prepend () {
105 oe_cargo_fix_env
106}
107
104oe_cargo_fix_env () { 108oe_cargo_fix_env () {
105 export CC="${RUST_TARGET_CC}" 109 export CC="${RUST_TARGET_CC}"
106 export CXX="${RUST_TARGET_CXX}" 110 export CXX="${RUST_TARGET_CXX}"