From: "'MOESSBAUER, Felix' via isar-users" <isar-users@googlegroups.com>
To: "isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Niedermayr, BENEDIKT" <benedikt.niedermayr@siemens.com>,
"Schmidt, Adriaan" <adriaan.schmidt@siemens.com>,
"Kiszka, Jan" <jan.kiszka@siemens.com>,
"Koch, Stefan" <stefan-koch@siemens.com>
Subject: Re: [PATCH v2 1/2] do not add cross profile when building native package
Date: Thu, 6 Nov 2025 08:47:37 +0000 [thread overview]
Message-ID: <4952db34aadf1d2a2471f2dce8c2c28b454abf06.camel@siemens.com> (raw)
In-Reply-To: <20251104154448.2737940-1-felix.moessbauer@siemens.com>
On Tue, 2025-11-04 at 16:44 +0100, Felix Moessbauer wrote:
> When building a -native package, the cross profile must not be added as
> otherwise stricter apt cache checks added in trixie trigger. It anyways
> makes no sense to add the cross profile when BUILD_ARCH equals
> PACKAGE_ARCH. Previously this check was implemented incorrectly, as the
> build arch was compared to the DISTRO_ARCH, which is always the target
> arch in isar terms. This resulted in the following error message in
> sbuild:
>
> E: The package cache was built for different architectures: amd64 vs arm64
> W: You may want to run apt-get update to correct these problems
> E: The package cache file is corrupted
> E: apt-get dist-upgrade failed
>
> On bookworm, the incorrect check remained unnoticed, as apt did not have
> the stricter checks yet.
>
> Fixes: 872ef2e3 ("dpkg-base: Fix enabling of cross build profile")
> Tested-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> meta/classes/dpkg-base.bbclass | 2 +-
> meta/recipes-kernel/linux/linux-custom.inc | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
> index 4468a49a..d8287e8d 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -146,7 +146,7 @@ dpkg_runbuild() {
>
> def isar_deb_build_profiles(d):
> deb_build_profiles = d.getVar('DEB_BUILD_PROFILES')
> - if d.getVar('BUILD_ARCH') != d.getVar('DISTRO_ARCH'):
> + if d.getVar('BUILD_ARCH') != d.getVar('PACKAGE_ARCH'):
> deb_build_profiles += ' cross'
> return deb_build_profiles.strip()
>
> diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
> index f2892921..01398697 100644
> --- a/meta/recipes-kernel/linux/linux-custom.inc
> +++ b/meta/recipes-kernel/linux/linux-custom.inc
> @@ -109,7 +109,7 @@ KERNEL_NAME_PROVIDED ?= "${@ d.getVar('BPN').partition('linux-')[2]}"
>
> # Determine cross-profile override
> python() {
> - if d.getVar("DISTRO_ARCH") != d.getVar("HOST_ARCH") and bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")) and "class-native" not in d.getVar("OVERRIDES").split(":"):
> + if d.getVar('BUILD_ARCH') != d.getVar('PACKAGE_ARCH') and bb.utils.to_boolean(d.getVar("ISAR_CROSS_COMPILE")) and "class-native" not in d.getVar("OVERRIDES").split(":"):
> d.appendVar("OVERRIDES", ":cross-profile")
I again see the same build error as reported by ... in the v1, but I
can only reproduce it in 100% clean CI runs with just that target. To
me it looks like the linux-kbuild-phy:arm64 package is still lingering
around in some cache which hides the error.
Anyways, back to the error:
I'm pretty sure we now model the build-dependency chain of packages
correctly, however it looks like the build of the kbuild-<kernel>
package has logical errors:
Currently, the linux-kbuild-phy is generated from linux-phy-native, but
for the host architecture (instead of the target architecture). This is
correct from bitbake perspective, but incorrect from debian
perspective, as the module needs the kbuild-<> package for the target
architecture.
IOW, currently we have the following situation:
- linux-<name> generates the image and headers for the target arch
(arm64)
- linux-<name>-native generates the kbuild package in the host arch
(amd64)
All that is correct, but not helpful. In the past, we generated an
architecture specific package from a -native recipe - which IMHO is
plain wrong.
To move forward, someone familiar with the linux-custom recipe needs to
have a look and model the overrides correctly. We further need to
clearly state which profile does what in human readable terms.
Felix
> }
>
> --
> 2.51.0
--
Siemens AG
Linux Expert Center
Friedrich-Ludwig-Bauer-Str. 3
85748 Garching, Germany
--
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/4952db34aadf1d2a2471f2dce8c2c28b454abf06.camel%40siemens.com.
prev parent reply other threads:[~2025-11-06 8:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-04 15:44 'Felix Moessbauer' via isar-users
2025-11-04 15:44 ` [PATCH v2 2/2] propagate distro-specific dependencies of arch all packages 'Felix Moessbauer' via isar-users
2025-11-06 11:07 ` 'Andreas Naumann' via isar-users
2025-11-06 12:13 ` 'MOESSBAUER, Felix' via isar-users
2025-11-04 16:19 ` [PATCH v2 1/2] do not add cross profile when building native package 'Jan Kiszka' via isar-users
2025-11-04 18:24 ` 'MOESSBAUER, Felix' via isar-users
2025-11-06 8:47 ` 'MOESSBAUER, Felix' via isar-users [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=4952db34aadf1d2a2471f2dce8c2c28b454abf06.camel@siemens.com \
--to=isar-users@googlegroups.com \
--cc=adriaan.schmidt@siemens.com \
--cc=benedikt.niedermayr@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=stefan-koch@siemens.com \
/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