To determine the host architecture dpkg --print-architecture is
executed. This call is currently a lazy one, hence it is evaluated at
the location where HOST_ARCH is expanded. On multiconfig this led to
almost a million process invocations, slowing down the parsing.
By making this assignment immediate, it is only evaluated once (per
recipe), reducing the parse time by around 50% on some larger
multiconfigs. Prior to the change an extra weak assignemnt was used.
However, the HOST_ARCH is not expected to change anyways, hence the
replacement should be fine.
Signed-off-by: Felix Moessbauer <
felix.mo...@siemens.com>
---
meta/classes-global/base.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes-global/base.bbclass b/meta/classes-global/base.bbclass
index 471442e5..6c788adb 100644
--- a/meta/classes-global/base.bbclass
+++ b/meta/classes-global/base.bbclass
@@ -59,7 +59,8 @@ def get_deb_host_arch():
["dpkg", "--print-architecture"]
).decode('utf-8').strip()
return host_arch
-HOST_ARCH ??= "${@get_deb_host_arch()}"
+# immediately evaluate to avoid costly process call
+HOST_ARCH := "${@get_deb_host_arch()}"
HOST_DISTRO ??= "${DISTRO}"
# Inject the PREFERRED_PROVIDERs for multiarch variants. This corresponds to
--
2.51.0