From: Jan Kiszka <jan.kiszka@siemens.com>
To: Uladzimir Bely <ubely@ilbers.de>,
isar-users <isar-users@googlegroups.com>,
Anton Mikanovich <amikan@ilbers.de>
Subject: Re: [PATCH v2] base: Fix HOST_ARCH for native builds
Date: Sun, 1 Oct 2023 10:17:26 +0200 [thread overview]
Message-ID: <61f99bd4-ac5c-47ee-9345-aa1402595be5@siemens.com> (raw)
In-Reply-To: <e7abd4fe2b2e8adb1c9b9ebc21982f1ed6a587ab.camel@ilbers.de>
On 29.09.23 19:33, Uladzimir Bely wrote:
> On Fri, 2023-09-29 at 20:25 +0300, Uladzimir Bely wrote:
>> On Fri, 2023-09-29 at 19:36 +0300, Uladzimir Bely wrote:
>>> On Mon, 2023-09-25 at 13:41 +0200, Jan Kiszka wrote:
>>>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>>>
>>>> HOST_ARCH must be DISTRO_ARCH when we are not cross-building.
>>>> Otherwise,
>>>> recipes that set PACKAGE_ARCH to it will fail in native builds.
>>>>
>>>> Use late expansion for ISAR_CROSS_COMPILE to avoid recursion
>>>> issues.
>>>>
>>>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>>>> ---
>>>>
>>>> That "expand=False" seems to work fine, so let's move forward
>>>> with
>>>> it.
>>>>
>>>> meta/classes/base.bbclass | 6 ++++--
>>>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/meta/classes/base.bbclass
>>>> b/meta/classes/base.bbclass
>>>> index 88004120..8ca089a2 100644
>>>> --- a/meta/classes/base.bbclass
>>>> +++ b/meta/classes/base.bbclass
>>>> @@ -49,13 +49,15 @@ def oe_import(d):
>>>> # We need the oe module name space early (before INHERITs get
>>>> added)
>>>> OE_IMPORTED := "${@oe_import(d)}"
>>>>
>>>> -def get_deb_host_arch():
>>>> +def get_deb_host_arch(d):
>>>> import subprocess
>>>> + if d.getVar("ISAR_CROSS_COMPILE", expand=False) != "1":
>>>> + return d.getVar("DISTRO_ARCH")
>>>> host_arch = subprocess.check_output(
>>>> ["dpkg", "--print-architecture"]
>>>> ).decode('utf-8').strip()
>>>> return host_arch
>>>> -HOST_ARCH ??= "${@get_deb_host_arch()}"
>>>> +HOST_ARCH ??= "${@get_deb_host_arch(d)}"
>>>> HOST_DISTRO ??= "${DISTRO}"
>>>>
>>>> die() {
>>>
>>> For some reason this doesn't properly work for some targets in case
>>> of
>>> cross-compile mode.
>>>
>>> Without patch (default local.conf with ISAR_CROSS_COMPILE set):
>>> ```
>>> bitbake mc:qemuarm64-focal:isar-image-base -e | grep "^HOST_ARCH="
>>> HOST_ARCH="amd64"
>>> bitbake mc:rpi-arm64-v8-bullseye:isar-image-base -e | grep
>>> "^HOST_ARCH="
>>> HOST_ARCH="amd64"
>>> bitbake mc:rpi-arm-v7-bullseye:isar-image-base -e | grep
>>> "^HOST_ARCH="
>>> HOST_ARCH="amd64"
>>> bitbake mc:stm32mp15x-bullseye:isar-image-base -e | grep
>>> "^HOST_ARCH="
>>> HOST_ARCH="amd64"
>>> ```
>>>
>>> With patch:
>>> ```
>>> bitbake mc:qemuarm64-focal:isar-image-base -e | grep "^HOST_ARCH="
>>> HOST_ARCH="amd64"
>>> bitbake mc:rpi-arm64-v8-bullseye:isar-image-base -e | grep
>>> "^HOST_ARCH="
>>> HOST_ARCH="amd64"
>>> bitbake mc:rpi-arm-v7-bullseye:isar-image-base -e | grep
>>> "^HOST_ARCH="
>>> HOST_ARCH="armhf"
>>> bitbake mc:stm32mp15x-bullseye:isar-image-base -e | grep
>>> "^HOST_ARCH="
>>> HOST_ARCH="armhf"
>>> ```
>>>
>>> For some reasons this affects only "armhf" targets...
>>>
>>
>> ... And it looks to be caused by line 69 in "imagetypes.bbclass":
>> ISAR_CROSS_COMPILE:armhf = "${@bb.utils.contains('IMAGE_BASETYPES',
>> 'ubifs', '1', '${THIS_ISAR_CROSS_COMPILE}', d)}"
>>
> ... And it seems extactly this line caused the issue with parsing
> "armhf" multiconfigs in patch v1.
>
OK, good to know this. I have no idea yet how to fix all this.
I just tried to avoid the issue by switching the affected recipes to
-native. Would be cleaner by now anyway. However, that mechanism also
uses the broken HOST_ARCH.
crossvars has BUILD_HOST_ARCH which actually seems to have the correct
values. But why do we have to have two of such vars?
Jan
--
Siemens AG, Technology
Linux Expert Center
prev parent reply other threads:[~2023-10-01 8:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 11:41 Jan Kiszka
2023-09-29 16:36 ` Uladzimir Bely
2023-09-29 17:25 ` Uladzimir Bely
2023-09-29 17:33 ` Uladzimir Bely
2023-10-01 8:17 ` Jan Kiszka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61f99bd4-ac5c-47ee-9345-aa1402595be5@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=amikan@ilbers.de \
--cc=isar-users@googlegroups.com \
--cc=ubely@ilbers.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox