* [PATCH] sdk: Fix build with custom DISTRO when host==target
@ 2024-03-14 7:54 Jan Kiszka
2024-03-15 8:42 ` Florian Bezdeka
2024-04-15 9:21 ` Uladzimir Bely
0 siblings, 2 replies; 6+ messages in thread
From: Jan Kiszka @ 2024-03-14 7:54 UTC (permalink / raw)
To: isar-users; +Cc: Fabian Scheler
From: Jan Kiszka <jan.kiszka@siemens.com>
HOST_DISTRO is not always the right choice for building an SDK. If the
host arch is identical to the target and DISTRO was customized, there is
no HOST_DISTRO to get the bootstrap from. Account for that.
This issue could have been reproduced e.g by xenomai-images when
selecting an x86 target and requesting to build the SDK for it.
Reported-by: Fabian Scheler <fabian.scheler@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/sdk.bbclass | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index 74c0acb9..71db6f3a 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -44,9 +44,17 @@ SDK_PREINSTALL += " \
devscripts \
equivs"
+def get_rootfs_distro(d):
+ host_arch = d.getVar('HOST_ARCH')
+ distro_arch = d.getVar('DISTRO_ARCH')
+ if host_arch == distro_arch:
+ return d.getVar('DISTRO')
+ else:
+ return d.getVar('HOST_DISTRO')
+
# rootfs/image overrides for the SDK
ROOTFS_ARCH:class-sdk = "${HOST_ARCH}"
-ROOTFS_DISTRO:class-sdk = "${HOST_DISTRO}"
+ROOTFS_DISTRO:class-sdk = "${@get_rootfs_distro(d)}"
ROOTFS_PACKAGES:class-sdk = "sdk-files ${SDK_TOOLCHAIN} ${SDK_PREINSTALL} ${@isar_multiarch_packages('SDK_INSTALL', d)}"
ROOTFS_FEATURES:append:class-sdk = " clean-package-cache generate-manifest export-dpkg-status"
ROOTFS_MANIFEST_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}"
--
2.35.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sdk: Fix build with custom DISTRO when host==target
2024-03-14 7:54 [PATCH] sdk: Fix build with custom DISTRO when host==target Jan Kiszka
@ 2024-03-15 8:42 ` Florian Bezdeka
2024-03-22 13:14 ` Uladzimir Bely
2024-04-02 14:58 ` Anton Mikanovich
2024-04-15 9:21 ` Uladzimir Bely
1 sibling, 2 replies; 6+ messages in thread
From: Florian Bezdeka @ 2024-03-15 8:42 UTC (permalink / raw)
To: Jan Kiszka, isar-users; +Cc: Fabian Scheler
On Thu, 2024-03-14 at 08:54 +0100, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> HOST_DISTRO is not always the right choice for building an SDK. If the
> host arch is identical to the target and DISTRO was customized, there is
> no HOST_DISTRO to get the bootstrap from. Account for that.
>
> This issue could have been reproduced e.g by xenomai-images when
> selecting an x86 target and requesting to build the SDK for it.
>
> Reported-by: Fabian Scheler <fabian.scheler@siemens.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
[snip]
Is there no test in place that covers this case? The SDK was broken a
couple of times now. Maybe it's time to increase the test coverage.
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sdk: Fix build with custom DISTRO when host==target
2024-03-15 8:42 ` Florian Bezdeka
@ 2024-03-22 13:14 ` Uladzimir Bely
2024-04-02 14:58 ` Anton Mikanovich
1 sibling, 0 replies; 6+ messages in thread
From: Uladzimir Bely @ 2024-03-22 13:14 UTC (permalink / raw)
To: Florian Bezdeka, Jan Kiszka, isar-users
On Fri, 2024-03-15 at 09:42 +0100, 'Florian Bezdeka' via isar-users
wrote:
> On Thu, 2024-03-14 at 08:54 +0100, 'Jan Kiszka' via isar-users wrote:
> > From: Jan Kiszka <jan.kiszka@siemens.com>
> >
> > HOST_DISTRO is not always the right choice for building an SDK. If
> > the
> > host arch is identical to the target and DISTRO was customized,
> > there is
> > no HOST_DISTRO to get the bootstrap from. Account for that.
> >
> > This issue could have been reproduced e.g by xenomai-images when
> > selecting an x86 target and requesting to build the SDK for it.
> >
> > Reported-by: Fabian Scheler <fabian.scheler@siemens.com>
> > Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> > ---
> [snip]
>
> Is there no test in place that covers this case? The SDK was broken a
> couple of times now. Maybe it's time to increase the test coverage.
>
> Florian
>
Hello everyone.
In order not to delay merging, we are ready to apply this to next.
Possible CI tests for sdk could be added later.
Best regards,
Uladzimir.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sdk: Fix build with custom DISTRO when host==target
2024-03-15 8:42 ` Florian Bezdeka
2024-03-22 13:14 ` Uladzimir Bely
@ 2024-04-02 14:58 ` Anton Mikanovich
2024-04-09 6:13 ` Jan Kiszka
1 sibling, 1 reply; 6+ messages in thread
From: Anton Mikanovich @ 2024-04-02 14:58 UTC (permalink / raw)
To: Florian Bezdeka, Jan Kiszka, isar-users
Cc: Fabian Scheler, Baurzhan Ismagulov
15/03/2024 10:42, 'Florian Bezdeka' via isar-users wrote:
> [snip]
>
> Is there no test in place that covers this case? The SDK was broken a
> couple of times now. Maybe it's time to increase the test coverage.
>
> Florian
>
Is anyone interested in helping create such a test case?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sdk: Fix build with custom DISTRO when host==target
2024-04-02 14:58 ` Anton Mikanovich
@ 2024-04-09 6:13 ` Jan Kiszka
0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2024-04-09 6:13 UTC (permalink / raw)
To: Anton Mikanovich, Florian Bezdeka, isar-users
Cc: Fabian Scheler, Baurzhan Ismagulov
On 02.04.24 16:58, Anton Mikanovich wrote:
> 15/03/2024 10:42, 'Florian Bezdeka' via isar-users wrote:
>> [snip]
>>
>> Is there no test in place that covers this case? The SDK was broken a
>> couple of times now. Maybe it's time to increase the test coverage.
>>
>> Florian
>>
> Is anyone interested in helping create such a test case?
>
This is not a trivial thing, given that we have no pattern yet to model
downstream layers (with custom ) in the testsuite.
In any case, this should not delay merging this fix.
Jan
--
Siemens AG, Technology
Linux Expert Center
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] sdk: Fix build with custom DISTRO when host==target
2024-03-14 7:54 [PATCH] sdk: Fix build with custom DISTRO when host==target Jan Kiszka
2024-03-15 8:42 ` Florian Bezdeka
@ 2024-04-15 9:21 ` Uladzimir Bely
1 sibling, 0 replies; 6+ messages in thread
From: Uladzimir Bely @ 2024-04-15 9:21 UTC (permalink / raw)
To: Jan Kiszka, isar-users
On Thu, 2024-03-14 at 08:54 +0100, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
>
> HOST_DISTRO is not always the right choice for building an SDK. If
> the
> host arch is identical to the target and DISTRO was customized, there
> is
> no HOST_DISTRO to get the bootstrap from. Account for that.
>
> This issue could have been reproduced e.g by xenomai-images when
> selecting an x86 target and requesting to build the SDK for it.
>
> Reported-by: Fabian Scheler <fabian.scheler@siemens.com>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
> meta/classes/sdk.bbclass | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> index 74c0acb9..71db6f3a 100644
> --- a/meta/classes/sdk.bbclass
> +++ b/meta/classes/sdk.bbclass
> @@ -44,9 +44,17 @@ SDK_PREINSTALL += " \
> devscripts \
> equivs"
>
> +def get_rootfs_distro(d):
> + host_arch = d.getVar('HOST_ARCH')
> + distro_arch = d.getVar('DISTRO_ARCH')
> + if host_arch == distro_arch:
> + return d.getVar('DISTRO')
> + else:
> + return d.getVar('HOST_DISTRO')
> +
> # rootfs/image overrides for the SDK
> ROOTFS_ARCH:class-sdk = "${HOST_ARCH}"
> -ROOTFS_DISTRO:class-sdk = "${HOST_DISTRO}"
> +ROOTFS_DISTRO:class-sdk = "${@get_rootfs_distro(d)}"
> ROOTFS_PACKAGES:class-sdk = "sdk-files ${SDK_TOOLCHAIN}
> ${SDK_PREINSTALL} ${@isar_multiarch_packages('SDK_INSTALL', d)}"
> ROOTFS_FEATURES:append:class-sdk = " clean-package-cache generate-
> manifest export-dpkg-status"
> ROOTFS_MANIFEST_DEPLOY_DIR:class-sdk = "${DEPLOY_DIR_SDKCHROOT}"
> --
> 2.35.3
>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-04-15 9:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-14 7:54 [PATCH] sdk: Fix build with custom DISTRO when host==target Jan Kiszka
2024-03-15 8:42 ` Florian Bezdeka
2024-03-22 13:14 ` Uladzimir Bely
2024-04-02 14:58 ` Anton Mikanovich
2024-04-09 6:13 ` Jan Kiszka
2024-04-15 9:21 ` Uladzimir Bely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox