* [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
* Re: [PATCH] sdk: Avoid parsing errors when DISTRO_ARCH is not yet set
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-28 5:50 ` Uladzimir Bely
1 sibling, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2023-02-27 10:41 UTC (permalink / raw)
To: isar-users, Anton Mikanovich
Cc: Moessbauer, Felix (T CED SES-DE), Hombourger, Cedric (DI SW MG EPT)
On 22.02.23 17:28, Jan Kiszka wrote:
> 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
Hmm, I thought you have fast path for small fixes now?
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sdk: Avoid parsing errors when DISTRO_ARCH is not yet set
2023-02-27 10:41 ` Jan Kiszka
@ 2023-02-27 11:53 ` Uladzimir Bely
2023-02-27 12:13 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Uladzimir Bely @ 2023-02-27 11:53 UTC (permalink / raw)
To: isar-users, Jan Kiszka
In mail from Monday, 27 February 2023 13:41:37 +03 user Jan Kiszka wrote:
> On 22.02.23 17:28, Jan Kiszka wrote:
> > 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_bbclas
> > s(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
>
> Hmm, I thought you have fast path for small fixes now?
>
> Jan
Hello.
Yes, such an obvious thing might have been merged faster than usually. But it
happened to conflict with other patches we were testing at the same time, at
least with "[v2,0/4] Fix ccache issues" that seems to absorb your patch.
That's why merging was delayed, considering both "fast" and "full" CI still
pass OK.
I guess, you have the issue in some downstream that doesn't set distro_arch.
Anyway, ccache patchset will require new version by some other reasons, so we
could merge your patch and consider it in ccache patchset v3.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sdk: Avoid parsing errors when DISTRO_ARCH is not yet set
2023-02-27 11:53 ` Uladzimir Bely
@ 2023-02-27 12:13 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2023-02-27 12:13 UTC (permalink / raw)
To: Uladzimir Bely, isar-users
On 27.02.23 12:53, Uladzimir Bely wrote:
> In mail from Monday, 27 February 2023 13:41:37 +03 user Jan Kiszka wrote:
>> On 22.02.23 17:28, Jan Kiszka wrote:
>>> 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_bbclas
>>> s(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
>>
>> Hmm, I thought you have fast path for small fixes now?
>>
>> Jan
>
> Hello.
>
> Yes, such an obvious thing might have been merged faster than usually. But it
> happened to conflict with other patches we were testing at the same time, at
> least with "[v2,0/4] Fix ccache issues" that seems to absorb your patch.
> That's why merging was delayed, considering both "fast" and "full" CI still
> pass OK.
>
> I guess, you have the issue in some downstream that doesn't set distro_arch.
>
> Anyway, ccache patchset will require new version by some other reasons, so we
> could merge your patch and consider it in ccache patchset v3.
>
>
Ok, thanks for explaining.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] sdk: Avoid parsing errors when DISTRO_ARCH is not yet set
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-28 5:50 ` Uladzimir Bely
1 sibling, 0 replies; 5+ messages in thread
From: Uladzimir Bely @ 2023-02-28 5:50 UTC (permalink / raw)
To: isar-users
In mail from Wednesday, 22 February 2023 19:28:42 +03 user Jan Kiszka wrote:
> 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_bbclas
> s(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
Applied to next, thanks
^ 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