Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 1/9] classes/cargo_common: move PKG_CONFIG_ALLOW_CROSS export to oe_cargo_fix_env
@ 2026-08-04 16:57 Ross Burton
  2026-08-04 16:57 ` [PATCH 2/9] classes/rust: remove unused variables Ross Burton
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Ross Burton @ 2026-08-04 16:57 UTC (permalink / raw)
  To: openembedded-core

This export is used to tell the pkg-config-rs crate how to behave, so is
only needed at build time.  Move the export to oe_cargo_fix_env() along
with the other variables so that the exports are localised and not
global.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/cargo_common.bbclass | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass
index a21c5423642..95739122a59 100644
--- a/meta/classes-recipe/cargo_common.bbclass
+++ b/meta/classes-recipe/cargo_common.bbclass
@@ -20,11 +20,6 @@ inherit rust-common
 # Where we download our registry and dependencies to
 export CARGO_HOME = "${UNPACKDIR}/cargo_home"
 
-# The pkg-config-rs library used by cargo build scripts disables itself when
-# cross compiling unless this is defined. We set up pkg-config appropriately
-# for cross compilation, so tell it we know better than it.
-export PKG_CONFIG_ALLOW_CROSS = "1"
-
 # Don't instruct cargo to use crates downloaded by bitbake. Some rust packages,
 # for example the rust compiler itself, come with their own vendored sources.
 # Specifying two [source.crates-io] will not work.
@@ -241,11 +236,15 @@ oe_cargo_fix_env () {
 	# openssl-sys
 	export OPENSSL_NO_VENDOR="1"
 
-	# pkg-config-rs. Crates can still override the dynamic linking
-	# but try to dynamically link to system libraries.
+	# pkg-config-rs.
 	# https://docs.rs/pkg-config/latest/pkg_config/
-	export SYSTEM_DEPS_BUILD_INTERNAL="never"
+	# In cross pkg-config-rs disables itself unless this is defined to tell it
+	# we have set up sysroots appropriately.
+	export PKG_CONFIG_ALLOW_CROSS="1"
+	# Crates can still override the dynamic linking but try to dynamically link
+	# to system libraries.
 	export PKG_CONFIG_ALL_DYNAMIC="1"
+	export SYSTEM_DEPS_BUILD_INTERNAL="never"
 
 	# zstd-sys
 	export ZSTD_SYS_USE_PKG_CONFIG="1"
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-08-05  9:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-04 16:57 [PATCH 1/9] classes/cargo_common: move PKG_CONFIG_ALLOW_CROSS export to oe_cargo_fix_env Ross Burton
2026-08-04 16:57 ` [PATCH 2/9] classes/rust: remove unused variables Ross Burton
2026-08-04 16:57 ` [PATCH 3/9] classes/cargo: move general assignments to cargo_common.bbclass Ross Burton
2026-08-04 16:57 ` [PATCH 4/9] classes/cargo: consolidate dependencies Ross Burton
2026-08-05  9:02   ` [OE-core] " Mathieu Dubois-Briand
2026-08-04 16:57 ` [PATCH 5/9] rust: clean up dependencies Ross Burton
2026-08-04 16:58 ` [PATCH 6/9] classes/cargo_c: inherit cargo_common Ross Burton
2026-08-04 16:58 ` [PATCH 7/9] classes/cargo-c: remove CARGO_C_BUILD/CARGO_C_INSTALL variables Ross Burton
2026-08-04 16:58 ` [PATCH 8/9] classes/cargo-c: pass flags via CARGO_BUILD_FLAGS Ross Burton
2026-08-04 16:58 ` [PATCH 9/9] classes/cargo: merge oe_cargo_build into cargo_do_compile Ross Burton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox