diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2023-06-25 23:22:25 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2023-07-20 12:10:40 -1000 |
commit | 833cbde6c12410b8fe9e1089470713b1172be0c9 (patch) | |
tree | 5341f192e92c44767c757ae66133975a0f13206d /meta/classes-recipe | |
parent | 569b57b9d2bce2633e2395fd796f0900a92f0dcf (diff) | |
download | poky-833cbde6c12410b8fe9e1089470713b1172be0c9.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: a1946efdbec608d47f9e992c1b5cf3c671a204fc)
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>
Diffstat (limited to 'meta/classes-recipe')
-rw-r--r-- | meta/classes-recipe/cargo.bbclass | 1 | ||||
-rw-r--r-- | meta/classes-recipe/cargo_common.bbclass | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass index 7a8cc1e751..3ef0bbbb44 100644 --- a/meta/classes-recipe/cargo.bbclass +++ b/meta/classes-recipe/cargo.bbclass | |||
@@ -55,7 +55,6 @@ oe_cargo_build () { | |||
55 | 55 | ||
56 | do_compile[progress] = "outof:\s+(\d+)/(\d+)" | 56 | do_compile[progress] = "outof:\s+(\d+)/(\d+)" |
57 | cargo_do_compile () { | 57 | cargo_do_compile () { |
58 | oe_cargo_fix_env | ||
59 | oe_cargo_build | 58 | oe_cargo_build |
60 | } | 59 | } |
61 | 60 | ||
diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index 82ab25b59c..1ca0be471c 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass | |||
@@ -149,6 +149,10 @@ python cargo_common_do_patch_paths() { | |||
149 | } | 149 | } |
150 | do_configure[postfuncs] += "cargo_common_do_patch_paths" | 150 | do_configure[postfuncs] += "cargo_common_do_patch_paths" |
151 | 151 | ||
152 | do_compile:prepend () { | ||
153 | oe_cargo_fix_env | ||
154 | } | ||
155 | |||
152 | oe_cargo_fix_env () { | 156 | oe_cargo_fix_env () { |
153 | export CC="${RUST_TARGET_CC}" | 157 | export CC="${RUST_TARGET_CC}" |
154 | export CXX="${RUST_TARGET_CXX}" | 158 | export CXX="${RUST_TARGET_CXX}" |