public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] sdk: Avoid parsing errors when DISTRO_ARCH is not yet set
@ 2023-02-22 16:28 Jan Kiszka
  2023-02-27 10:41 ` Jan Kiszka
  2023-02-28  5:50 ` Uladzimir Bely
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kiszka @ 2023-02-22 16:28 UTC (permalink / raw)
  To: isar-users
  Cc: Moessbauer, Felix (T CED SES-DE), Hombourger, Cedric (DI SW MG EPT)

From: Jan Kiszka <jan.kiszka@siemens.com>

In multiconfig setups, it can happen during some parsing steps that a
machine and, thus, a concrete DISTRO_ARCH is not yet set, leading to

The stack trace of python calls that resulted in this exception/failure was:
File: '<code>', lineno: 4, function: <module>
     0001:__anon_158__build____work_isar_meta_classes_base_bbclass(d)
     0002:__anon_162__build____work_isar_meta_classes_sstate_bbclass(d)
     0003:__anon_56__build____work_isar_meta_classes_image_bbclass(d)
 *** 0004:__anon_56__build____work_isar_meta_classes_sdk_bbclass(d)
     0005:__anon_21__build____work_isar_meta_classes_buildchroot_bbclass(d)
     0006:__anon_84__build____work_isar_meta_classes_imagetypes_wic_bbclass(d)
     0007:__anon_24__build____work_isar_meta_classes_imagetypes_container_bbclass(d)
     0008:__anon_305__build____work_isar_meta_classes_image_bbclass(d)
File: '/build/../work/isar/meta/classes/sdk.bbclass', lineno: 52, function: __anon_56__build____work_isar_meta_classes_sdk_bbclass
     0048:    distro_arch = d.getVar('DISTRO_ARCH')
     0049:    if mode == "0" or d.getVar('HOST_ARCH') ==  distro_arch:
     0050:        toolchain = "build-essential"
     0051:    else:
 *** 0052:        toolchain = "crossbuild-essential-" + distro_arch
     0053:    if d.getVar('ISAR_ENABLE_COMPAT_ARCH', True) == "1":
     0054:        toolchain += " crossbuild-essential-" + d.getVar('COMPAT_DISTRO_ARCH')
     0055:    d.setVar('TOOLCHAIN', toolchain)
     0056:}
Exception: TypeError: can only concatenate str (not "NoneType") to str

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

Found in mtda: https://github.com/siemens/mtda/pull/283

 meta/classes/sdk.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 0a98ea04..01eb3a67 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -46,7 +46,7 @@ SDK_PREINSTALL += " \
 python __anonymous() {
     mode = d.getVar('ISAR_CROSS_COMPILE', True)
     distro_arch = d.getVar('DISTRO_ARCH')
-    if mode == "0" or d.getVar('HOST_ARCH') ==  distro_arch:
+    if mode == "0" or d.getVar('HOST_ARCH') == distro_arch or distro_arch == None:
         toolchain = "build-essential"
     else:
         toolchain = "crossbuild-essential-" + distro_arch
-- 
2.35.3

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

end of thread, other threads:[~2023-02-28  5:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-22 16:28 [PATCH] sdk: Avoid parsing errors when DISTRO_ARCH is not yet set Jan Kiszka
2023-02-27 10:41 ` Jan Kiszka
2023-02-27 11:53   ` Uladzimir Bely
2023-02-27 12:13     ` Jan Kiszka
2023-02-28  5:50 ` Uladzimir Bely

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