public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest
@ 2023-10-06 15:34 Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH Jan Kiszka
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

Changes in v2:
 - drop merged revert
 - rename BUILD_HOST_ARCH to BUILD_ARCH
 - add fix for explicit -native build in non-cross setups
 - add missing debian-sid.conf

This tries to resolve the native build issues of the visionfive2, fixing
some remaining corner case of -native usage:

If package A has B-native as build dependency but is then compiled
without cross-building, using qemu-user instead, it will incorrectly
request the build of B:, rather than B:. This
is resolved automatically now, and the solution is used for the
visionfive2.

For that board to build again, we also need to switch from sid-ports to
sid, for riscv64 in general.

Furthermore, this reworks the crossvars logic to also account for the
corner case that a package is still requested as native although
ISAR_CROSS_COMPILE is off. While this is likely irrelvant in practice,
the result is a more consistent logic of the crossvars class.

Jan

Jan Kiszka (9):
  Rename BUILD_HOST_ARCH to BUILD_ARCH
  dpkg: Drop redundant PACKAGE_ARCH initialization
  crossvars: Adjust logic to account for -native package builds in
    non-cross setups
  multiarch: Downgrade native dependencies when building in emulated
    environment
  meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation
  meta-isar: jh7110-u-boot-spl-image: Fix native build
  meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies
  linux-custom: Drop unused template variable
  Move riscv64 from sid-ports to regular sid

 doc/user_manual.md                            |  4 ++--
 kas/distro/Kconfig                            |  6 +++---
 ...{debian-sid-ports.yaml => debian-sid.yaml} |  2 +-
 kas/machine/Kconfig                           |  6 +++---
 meta-isar/conf/mc.conf                        |  6 +++---
 ...64-sid-ports.conf => qemuriscv64-sid.conf} |  2 +-
 ...0-sid-ports.conf => sifive-fu540-sid.conf} |  2 +-
 ...rts.conf => starfive-visionfive2-sid.conf} |  2 +-
 .../jh7110-u-boot-spl-image_0.1.bb            |  6 +++---
 .../jh7110-u-boot-spl-tool_0.1.bb             |  3 ---
 ...-starfive-visionfive2_2021.10+VF2-3.0.4.bb |  4 +---
 meta/classes/crossvars.bbclass                | 19 ++++++++++-------
 meta/classes/dpkg-base.bbclass                |  2 +-
 meta/classes/dpkg.bbclass                     |  4 +---
 meta/classes/multiarch.bbclass                | 12 +++++++++++
 meta/conf/bitbake.conf                        |  2 +-
 meta/conf/distro/debian-sid.conf              | 21 +++++++++++++++++++
 meta/recipes-kernel/linux/linux-custom.inc    |  1 -
 testsuite/citest.py                           |  6 +++---
 19 files changed, 70 insertions(+), 40 deletions(-)
 rename kas/distro/{debian-sid-ports.yaml => debian-sid.yaml} (78%)
 rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf => qemuriscv64-sid.conf} (85%)
 rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.conf => sifive-fu540-sid.conf} (76%)
 rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid-ports.conf => starfive-visionfive2-sid.conf} (78%)
 create mode 100644 meta/conf/distro/debian-sid.conf

-- 
2.35.3


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

* [PATCH v2 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
@ 2023-10-06 15:34 ` Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 2/9] dpkg: Drop redundant PACKAGE_ARCH initialization Jan Kiszka
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

Aligns us also with OE/Yocto and prepares for a potential future
renaming of HOST_ARCH as well.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 doc/user_manual.md             | 4 ++--
 meta/classes/crossvars.bbclass | 4 ++--
 meta/classes/dpkg-base.bbclass | 2 +-
 meta/classes/dpkg.bbclass      | 2 +-
 meta/conf/bitbake.conf         | 2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index be47fdcc..ecb987f4 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -1080,8 +1080,8 @@ to `local.conf`. If some package requires ccache to be always disabled,
 By default, ccache directory is created inside `TMPDIR`, but it can be
 adjusted by `CCACHE_TOP_DIR` variable in `local.conf`. Ccache directory
 `CCACHE_DIR` default value is
-`"${CCACHE_TOP_DIR}/${DISTRO}-${DISTRO_ARCH}-${BUILD_HOST_ARCH}"`,
-that means caches for different distros and architectures are not overlapped.
+`"${CCACHE_TOP_DIR}/${DISTRO}-${DISTRO_ARCH}-${BUILD_ARCH}"`, that means
+caches for different distros and architectures are not overlapped.
 
 The ccache debug mode can be enabled by setting `CCACHE_DEBUG = "1"`
 in the `local.conf`.
diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
index df26f47f..22bc4714 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -17,12 +17,12 @@ python __anonymous() {
 
     distro_arch = d.getVar('DISTRO_ARCH')
     if mode == "0" or d.getVar('HOST_ARCH') == distro_arch or distro_arch == None:
-        d.setVar('BUILD_HOST_ARCH', distro_arch)
+        d.setVar('BUILD_ARCH', distro_arch)
         schroot_dir = d.getVar('SCHROOT_TARGET_DIR', False)
         sbuild_dep = "sbuild-chroot-target" + flavor_suffix + ":do_build"
         sdk_toolchain = "build-essential"
     else:
-        d.setVar('BUILD_HOST_ARCH', d.getVar('HOST_ARCH'))
+        d.setVar('BUILD_ARCH', d.getVar('HOST_ARCH'))
         schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
         sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"
         sdk_toolchain = "crossbuild-essential-" + distro_arch
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index f223fc16..7b054d3f 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -299,7 +299,7 @@ python do_devshell() {
     schroot = d.getVar('SBUILD_CHROOT')
     isar_apt = d.getVar('ISAR_APT_REPO')
     pkg_arch = d.getVar('PACKAGE_ARCH')
-    build_arch = d.getVar('BUILD_HOST_ARCH')
+    build_arch = d.getVar('BUILD_ARCH')
     pp_pps = os.path.join(d.getVar('PP'), d.getVar('PPS'))
     debdistroname = d.getVar('DEBDISTRONAME')
 
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index d896fc91..7bcb4367 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -101,7 +101,7 @@ dpkg_runbuild() {
     DSC_FILE=$(find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -maxdepth 1 -print)
 
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
-        --host=${PACKAGE_ARCH} --build=${BUILD_HOST_ARCH} ${profiles} \
+        --host=${PACKAGE_ARCH} --build=${BUILD_ARCH} ${profiles} \
         --no-run-lintian --no-run-piuparts --no-run-autopkgtest --resolve-alternatives \
         --bd-uninstallable-explainer=apt \
         --no-apt-update \
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 9eb93e2b..80dc01c7 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -163,7 +163,7 @@ INHERIT += "${@'buildstats' if d.getVar('USE_BUILDSTATS') == '1' else ''}"
 # Default values for ccache
 USE_CCACHE ??= "0"
 CCACHE_TOP_DIR ?= "${TMPDIR}/ccache"
-CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${DISTRO}-${DISTRO_ARCH}-${BUILD_HOST_ARCH}"
+CCACHE_DIR ?= "${CCACHE_TOP_DIR}/${DISTRO}-${DISTRO_ARCH}-${BUILD_ARCH}"
 CCACHE_DEBUG ?= "0"
 
 # Variables for tasks marking
-- 
2.35.3


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

* [PATCH v2 2/9] dpkg: Drop redundant PACKAGE_ARCH initialization
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH Jan Kiszka
@ 2023-10-06 15:34 ` Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 3/9] crossvars: Adjust logic to account for -native package builds in non-cross setups Jan Kiszka
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

This is done in bitbake.conf already since 0a18d4c199a4.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/dpkg.bbclass | 2 --
 1 file changed, 2 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 7bcb4367..d89b0fd9 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -4,8 +4,6 @@
 inherit dpkg-base
 inherit dpkg-source
 
-PACKAGE_ARCH ?= "${DISTRO_ARCH}"
-
 DPKG_PREBUILD_ENV_FILE="${WORKDIR}/dpkg_prebuild.env"
 
 # bitbake variables that should be passed into sbuild env
-- 
2.35.3


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

* [PATCH v2 3/9] crossvars: Adjust logic to account for -native package builds in non-cross setups
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 2/9] dpkg: Drop redundant PACKAGE_ARCH initialization Jan Kiszka
@ 2023-10-06 15:34 ` Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 4/9] multiarch: Downgrade native dependencies when building in emulated environment Jan Kiszka
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

When selecting a -native version of a package while cross-building is
disabled for it, we will use the target build env instead. That may
work, just slowly, or even fail miserably.

Extend the build env selection logic to take PACKAGE_ARCH into account
as well. It defaults to DISTRO_ARCH for non-package recipe, thus should
works fine for those as well.

Reported-by: Cedric Hombourger <cedric.hombourger@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/crossvars.bbclass | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
index 22bc4714..87e45417 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -16,16 +16,21 @@ python __anonymous() {
     flavor_suffix = ('-' + flavor) if flavor else ''
 
     distro_arch = d.getVar('DISTRO_ARCH')
-    if mode == "0" or d.getVar('HOST_ARCH') == distro_arch or distro_arch == None:
+    host_arch = d.getVar('HOST_ARCH')
+    package_arch = d.getVar('PACKAGE_ARCH')
+
+    if distro_arch != host_arch and \
+        (package_arch == host_arch or \
+         (package_arch == distro_arch and mode == "1")):
+        d.setVar('BUILD_ARCH', host_arch)
+        schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
+        sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"
+        sdk_toolchain = "crossbuild-essential-" + distro_arch
+    else:
         d.setVar('BUILD_ARCH', distro_arch)
         schroot_dir = d.getVar('SCHROOT_TARGET_DIR', False)
         sbuild_dep = "sbuild-chroot-target" + flavor_suffix + ":do_build"
         sdk_toolchain = "build-essential"
-    else:
-        d.setVar('BUILD_ARCH', d.getVar('HOST_ARCH'))
-        schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
-        sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"
-        sdk_toolchain = "crossbuild-essential-" + distro_arch
     d.setVar('SCHROOT_DIR', schroot_dir + flavor_suffix)
     d.setVar('SCHROOT_DEP', sbuild_dep)
     if isar_can_build_compat(d):
-- 
2.35.3


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

* [PATCH v2 4/9] multiarch: Downgrade native dependencies when building in emulated environment
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (2 preceding siblings ...)
  2023-10-06 15:34 ` [PATCH v2 3/9] crossvars: Adjust logic to account for -native package builds in non-cross setups Jan Kiszka
@ 2023-10-06 15:34 ` Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 5/9] meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation Jan Kiszka
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

When a package that has -native build dependencies is forced into
non-cross building using qemu-user (ie. build arch != distro arch), its
dependency installation will generally fail. That is because
somedep-native will build somedep for the builder arch, not for the
distro arch that is needed during native builds.

Address that automatically by downgrading any such recipe dependency by
stripping for '-native'.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/multiarch.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass
index c1846ab0..48cec9ab 100644
--- a/meta/classes/multiarch.bbclass
+++ b/meta/classes/multiarch.bbclass
@@ -21,6 +21,18 @@ python() {
             d.appendVar('PROVIDES', f' {pn}-native')
     else:
         d.appendVar('BBCLASSEXTEND', ' native')
+
+    # drop own -native build dependencies at recipe level if building natively
+    # and not for the builder architecture
+    depends = d.getVar('DEPENDS')
+    if depends is not None and d.getVar('HOST_ARCH') != d.getVar('DISTRO_ARCH') \
+       and d.getVar('ISAR_CROSS_COMPILE') != '1':
+        new_deps = []
+        for dep in depends.split():
+            if dep.endswith('-native'):
+                dep = dep[:-7]
+            new_deps.append(dep)
+        d.setVar('DEPENDS', ' '.join(new_deps))
 }
 
 python multiarch_virtclass_handler() {
-- 
2.35.3


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

* [PATCH v2 5/9] meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (3 preceding siblings ...)
  2023-10-06 15:34 ` [PATCH v2 4/9] multiarch: Downgrade native dependencies when building in emulated environment Jan Kiszka
@ 2023-10-06 15:34 ` Jan Kiszka
  2023-10-06 15:34 ` [PATCH v2 6/9] meta-isar: jh7110-u-boot-spl-image: Fix native build Jan Kiszka
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

Avoids the need to fiddle with the PACKAGE_ARCH in this recipe.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb    | 4 ++--
 .../jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb      | 3 ---
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
index a3258e42..dbce7c28 100644
--- a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
@@ -8,8 +8,8 @@ inherit dpkg
 SRC_URI = "file://rules file://install"
 
 DESCRIPTION = "StarFive VisionFive 2 u-boot SPL"
-DEPENDS = "jh7110-u-boot-spl-tool u-boot-starfive-visionfive2"
-DEBIAN_BUILD_DEPENDS = "jh7110-u-boot-spl-tool, u-boot-starfive-visionfive2:${DISTRO_ARCH}"
+DEPENDS = "jh7110-u-boot-spl-tool-native u-boot-starfive-visionfive2"
+DEBIAN_BUILD_DEPENDS = "jh7110-u-boot-spl-tool:native, u-boot-starfive-visionfive2:${DISTRO_ARCH}"
 
 # this is a host tool
 PACKAGE_ARCH = "${HOST_ARCH}"
diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb b/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb
index fefcbf66..292334f6 100644
--- a/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-tool/jh7110-u-boot-spl-tool_0.1.bb
@@ -13,9 +13,6 @@ SRCREV = "8c5acc4e5eb7e4ad012463b05a5e3dbbfed1c38d"
 
 S = "${WORKDIR}/tools/spl_tool"
 
-# This is a host tool
-PACKAGE_ARCH = "${HOST_ARCH}"
-
 do_prepare_build[cleandirs] += "${S}/debian"
 do_prepare_build(){
     deb_debianize
-- 
2.35.3


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

* [PATCH v2 6/9] meta-isar: jh7110-u-boot-spl-image: Fix native build
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (4 preceding siblings ...)
  2023-10-06 15:34 ` [PATCH v2 5/9] meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation Jan Kiszka
@ 2023-10-06 15:34 ` Jan Kiszka
  2023-10-06 15:35 ` [PATCH v2 7/9] meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies Jan Kiszka
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:34 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

In general, recipes must not use HOST_ARCH because it does not account
for ISAR_CROSS_COMPILE being enabled or disabled. This is encoded into
BUILD_ARCH, though.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb      | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
index dbce7c28..c004c86c 100644
--- a/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
+++ b/meta-isar/recipes-bsp/jh7110-u-boot-spl-image/jh7110-u-boot-spl-image_0.1.bb
@@ -12,7 +12,7 @@ DEPENDS = "jh7110-u-boot-spl-tool-native u-boot-starfive-visionfive2"
 DEBIAN_BUILD_DEPENDS = "jh7110-u-boot-spl-tool:native, u-boot-starfive-visionfive2:${DISTRO_ARCH}"
 
 # this is a host tool
-PACKAGE_ARCH = "${HOST_ARCH}"
+PACKAGE_ARCH = "${BUILD_ARCH}"
 
 do_prepare_build[cleandirs] += "${S}/debian"
 do_prepare_build(){
-- 
2.35.3


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

* [PATCH v2 7/9] meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (5 preceding siblings ...)
  2023-10-06 15:34 ` [PATCH v2 6/9] meta-isar: jh7110-u-boot-spl-image: Fix native build Jan Kiszka
@ 2023-10-06 15:35 ` Jan Kiszka
  2023-10-06 15:35 ` [PATCH v2 8/9] linux-custom: Drop unused template variable Jan Kiszka
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:35 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

At the risk of adding the same package twice, but apt will be resolve
that, just follow the pattern of others: :native for the build env,
without any suffix for the target.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../u-boot/u-boot-starfive-visionfive2_2021.10+VF2-3.0.4.bb   | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/meta-isar/recipes-bsp/u-boot/u-boot-starfive-visionfive2_2021.10+VF2-3.0.4.bb b/meta-isar/recipes-bsp/u-boot/u-boot-starfive-visionfive2_2021.10+VF2-3.0.4.bb
index 455bee4a..9e1b7251 100644
--- a/meta-isar/recipes-bsp/u-boot/u-boot-starfive-visionfive2_2021.10+VF2-3.0.4.bb
+++ b/meta-isar/recipes-bsp/u-boot/u-boot-starfive-visionfive2_2021.10+VF2-3.0.4.bb
@@ -8,9 +8,7 @@ require recipes-bsp/u-boot/u-boot-custom.inc
 SRC_URI += "git://github.com/starfive-tech/u-boot.git;nobranch=1;protocol=https;destsuffix=u-boot-${PV}"
 SRCREV = "b6e2b0e85c774a18ae668223a6e5f7d335895243"
 
-DEBIAN_BUILD_DEPENDS .= ", libssl-dev:${DISTRO_ARCH}"
-# when cross compiling, we need the library on the host as well, as the signature computation is done locally
-DEBIAN_BUILD_DEPENDS .= "${@ ', libssl-dev:${HOST_ARCH}' if d.getVar('ISAR_CROSS_COMPILE') == '1' else '' }"
+DEBIAN_BUILD_DEPENDS .= ", libssl-dev, libssl-dev:native"
 
 U_BOOT_CONFIG = "starfive_visionfive2_defconfig"
 U_BOOT_BIN = "u-boot.bin"
-- 
2.35.3


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

* [PATCH v2 8/9] linux-custom: Drop unused template variable
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (6 preceding siblings ...)
  2023-10-06 15:35 ` [PATCH v2 7/9] meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies Jan Kiszka
@ 2023-10-06 15:35 ` Jan Kiszka
  2023-10-06 15:35 ` [PATCH v2 9/9] Move riscv64 from sid-ports to regular sid Jan Kiszka
  2023-10-11 10:49 ` [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Uladzimir Bely
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:35 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

This was never used, in fact.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/recipes-kernel/linux/linux-custom.inc | 1 -
 1 file changed, 1 deletion(-)

diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc
index 1897116c..09fb5c85 100644
--- a/meta/recipes-kernel/linux/linux-custom.inc
+++ b/meta/recipes-kernel/linux/linux-custom.inc
@@ -70,7 +70,6 @@ TEMPLATE_FILES += "                  \
 "
 
 TEMPLATE_VARS += "                \
-    HOST_ARCH                     \
     KBUILD_DEPENDS                \
     KERNEL_ARCH                   \
     KERNEL_DEBIAN_DEPENDS         \
-- 
2.35.3


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

* [PATCH v2 9/9] Move riscv64 from sid-ports to regular sid
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (7 preceding siblings ...)
  2023-10-06 15:35 ` [PATCH v2 8/9] linux-custom: Drop unused template variable Jan Kiszka
@ 2023-10-06 15:35 ` Jan Kiszka
  2023-10-11 10:49 ` [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Uladzimir Bely
  9 siblings, 0 replies; 14+ messages in thread
From: Jan Kiszka @ 2023-10-06 15:35 UTC (permalink / raw)
  To: isar-users
  Cc: Adriaan Schmidt, Felix Moessbauer, Uladzimir Bely, Cedric Hombourger

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

Now that riscv64 is an official Debian arch, sid-ports runs out of sync
with sid. It seems that sid is generally building riscv64 fine, but
cross-compilation will remain broken for a longer while.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 kas/distro/Kconfig                            |  6 +++---
 ...{debian-sid-ports.yaml => debian-sid.yaml} |  2 +-
 kas/machine/Kconfig                           |  6 +++---
 meta-isar/conf/mc.conf                        |  6 +++---
 ...64-sid-ports.conf => qemuriscv64-sid.conf} |  2 +-
 ...0-sid-ports.conf => sifive-fu540-sid.conf} |  2 +-
 ...rts.conf => starfive-visionfive2-sid.conf} |  2 +-
 meta/conf/distro/debian-sid.conf              | 21 +++++++++++++++++++
 testsuite/citest.py                           |  6 +++---
 9 files changed, 37 insertions(+), 16 deletions(-)
 rename kas/distro/{debian-sid-ports.yaml => debian-sid.yaml} (78%)
 rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf => qemuriscv64-sid.conf} (85%)
 rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.conf => sifive-fu540-sid.conf} (76%)
 rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid-ports.conf => starfive-visionfive2-sid.conf} (78%)
 create mode 100644 meta/conf/distro/debian-sid.conf

diff --git a/kas/distro/Kconfig b/kas/distro/Kconfig
index bd762a98..5118dff4 100644
--- a/kas/distro/Kconfig
+++ b/kas/distro/Kconfig
@@ -19,8 +19,8 @@ config DEBIAN_BULLSEYE
 config DEBIAN_BOOKWORM
 	bool "Debian Bookworm (12)"
 
-config DEBIAN_SID_PORTS
-	bool "Debian Sid (unstable) with unofficial ports"
+config DEBIAN_SID
+	bool "Debian Sid (unstable)"
 
 config RASPIOS_BULLSEYE
   bool "Raspi OS Bullseye (11)"
@@ -38,7 +38,7 @@ config KAS_INCLUDE_DISTRO
 	default "kas/distro/debian-buster.yaml" if DEBIAN_BUSTER
 	default "kas/distro/debian-bullseye.yaml" if DEBIAN_BULLSEYE
 	default "kas/distro/debian-bookworm.yaml" if DEBIAN_BOOKWORM
-	default "kas/distro/debian-sid-ports.yaml" if DEBIAN_SID_PORTS
+	default "kas/distro/debian-sid.yaml" if DEBIAN_SID
 	default "kas/distro/raspios-bullseye.yaml" if RASPIOS_BULLSEYE
 	default "kas/distro/ubuntu-focal.yaml" if UBUNTU_FOCAL
 	default "kas/distro/ubuntu-jammy.yaml" if UBUNTU_JAMMY
diff --git a/kas/distro/debian-sid-ports.yaml b/kas/distro/debian-sid.yaml
similarity index 78%
rename from kas/distro/debian-sid-ports.yaml
rename to kas/distro/debian-sid.yaml
index 52993646..43f1c696 100644
--- a/kas/distro/debian-sid-ports.yaml
+++ b/kas/distro/debian-sid.yaml
@@ -4,4 +4,4 @@
 header:
   version: 14
 
-distro: debian-sid-ports
+distro: debian-sid
diff --git a/kas/machine/Kconfig b/kas/machine/Kconfig
index 66debfe5..d0e3963a 100644
--- a/kas/machine/Kconfig
+++ b/kas/machine/Kconfig
@@ -68,7 +68,7 @@ config MACHINE_QEMU_MIPSEL
 
 config MACHINE_QEMU_RISCV64
 	bool "qemuriscv64"
-	depends on DEBIAN_SID_PORTS
+	depends on DEBIAN_SID
 
 config MACHINE_RPI_ARM_V7
 	bool "rpi-arm-v7"
@@ -88,11 +88,11 @@ config MACHINE_RPI_ARM64_V8
 
 config MACHINE_SIFIVE_FU540
 	bool "sifive-fu540"
-	depends on DEBIAN_SID_PORTS
+	depends on DEBIAN_SID
 
 config MACHINE_STARFIVE_VISIONFIVE2
 	bool "starfive-visionfive2"
-	depends on DEBIAN_SID_PORTS
+	depends on DEBIAN_SID
 
 config MACHINE_STM32MP15X
 	bool "stm32mp15x"
diff --git a/meta-isar/conf/mc.conf b/meta-isar/conf/mc.conf
index 9637bcb1..d16f54b5 100644
--- a/meta-isar/conf/mc.conf
+++ b/meta-isar/conf/mc.conf
@@ -25,7 +25,7 @@ BBMULTICONFIG = " \
     qemumipsel-buster \
     qemumipsel-bullseye \
     qemumipsel-bookworm \
-    qemuriscv64-sid-ports \
+    qemuriscv64-sid \
     bananapi-buster \
     bananapi-bullseye \
     de0-nano-soc-buster \
@@ -45,8 +45,8 @@ BBMULTICONFIG = " \
     rpi-arm-v7-bullseye \
     rpi-arm-v7l-bullseye \
     rpi-arm64-v8-bullseye \
-    sifive-fu540-sid-ports \
-    starfive-visionfive2-sid-ports \
+    sifive-fu540-sid \
+    starfive-visionfive2-sid \
     qemuarm64-focal \
     qemuarm64-jammy \
     qemuamd64-focal \
diff --git a/meta-isar/conf/multiconfig/qemuriscv64-sid-ports.conf b/meta-isar/conf/multiconfig/qemuriscv64-sid.conf
similarity index 85%
rename from meta-isar/conf/multiconfig/qemuriscv64-sid-ports.conf
rename to meta-isar/conf/multiconfig/qemuriscv64-sid.conf
index 2556cf7f..bc691b5b 100644
--- a/meta-isar/conf/multiconfig/qemuriscv64-sid-ports.conf
+++ b/meta-isar/conf/multiconfig/qemuriscv64-sid.conf
@@ -5,4 +5,4 @@
 # SPDX-License-Identifier: MIT
 
 MACHINE ?= "qemuriscv64"
-DISTRO ?= "debian-sid-ports"
+DISTRO ?= "debian-sid"
diff --git a/meta-isar/conf/multiconfig/sifive-fu540-sid-ports.conf b/meta-isar/conf/multiconfig/sifive-fu540-sid.conf
similarity index 76%
rename from meta-isar/conf/multiconfig/sifive-fu540-sid-ports.conf
rename to meta-isar/conf/multiconfig/sifive-fu540-sid.conf
index 313032ef..99bb7f3e 100644
--- a/meta-isar/conf/multiconfig/sifive-fu540-sid-ports.conf
+++ b/meta-isar/conf/multiconfig/sifive-fu540-sid.conf
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: MIT
 
 MACHINE ?= "sifive-fu540"
-DISTRO ?= "debian-sid-ports"
+DISTRO ?= "debian-sid"
diff --git a/meta-isar/conf/multiconfig/starfive-visionfive2-sid-ports.conf b/meta-isar/conf/multiconfig/starfive-visionfive2-sid.conf
similarity index 78%
rename from meta-isar/conf/multiconfig/starfive-visionfive2-sid-ports.conf
rename to meta-isar/conf/multiconfig/starfive-visionfive2-sid.conf
index ee42ab4d..603e891f 100644
--- a/meta-isar/conf/multiconfig/starfive-visionfive2-sid-ports.conf
+++ b/meta-isar/conf/multiconfig/starfive-visionfive2-sid.conf
@@ -4,4 +4,4 @@
 # SPDX-License-Identifier: MIT
 
 MACHINE ?= "starfive-visionfive2"
-DISTRO ?= "debian-sid-ports"
+DISTRO ?= "debian-sid"
diff --git a/meta/conf/distro/debian-sid.conf b/meta/conf/distro/debian-sid.conf
new file mode 100644
index 00000000..631f9b5a
--- /dev/null
+++ b/meta/conf/distro/debian-sid.conf
@@ -0,0 +1,21 @@
+# This software is a part of ISAR.
+#
+# Copyright (c) Siemens AG, 2020-2023
+#
+# SPDX-License-Identifier: MIT
+
+require debian-common.conf
+
+BASE_DISTRO_CODENAME = "sid"
+
+HOST_DISTRO ?= "debian-${BASE_DISTRO_CODENAME}"
+
+DISTRO_CONFIG_SCRIPT ?= "debian-configscript.sh"
+DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686 alpha-generic alpha-smp \
+	amd64 arm64 armmp-lpae armmp cloud-amd64 cloud-arm64 itanium \
+	loongson-3 m68k marvell mckinley mips32r6 mips32r6el mips64r6 \
+	mips64r6el octeon parisc parisc64 powerpc-smp powerpc powerpc64 \
+	powerpc64le riscv64 rpi rt-686-pae rt-amd64 rt-arm64 rt-armmp \
+	s390x sh7751r sh7785lcr sparc64-smp sparc64"
+
+DISTRO_GCC = "13"
diff --git a/testsuite/citest.py b/testsuite/citest.py
index 7304efe6..81bdeba5 100755
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -227,10 +227,10 @@ class NoCrossTest(CIBaseTest):
         except:
             self.cancel('KFAIL')
 
-    def test_nocross_sidports(self):
+    def test_nocross_sid(self):
         targets = [
-            'mc:qemuriscv64-sid-ports:isar-image-base',
-            'mc:sifive-fu540-sid-ports:isar-image-base',
+            'mc:qemuriscv64-sid:isar-image-base',
+            'mc:sifive-fu540-sid:isar-image-base',
                   ]
 
         self.init()
-- 
2.35.3


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

* Re: [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest
  2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
                   ` (8 preceding siblings ...)
  2023-10-06 15:35 ` [PATCH v2 9/9] Move riscv64 from sid-ports to regular sid Jan Kiszka
@ 2023-10-11 10:49 ` Uladzimir Bely
  2023-10-11 10:51   ` Jan Kiszka
  9 siblings, 1 reply; 14+ messages in thread
From: Uladzimir Bely @ 2023-10-11 10:49 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On Fri, 2023-10-06 at 17:34 +0200, Jan Kiszka wrote:
> Changes in v2:
>  - drop merged revert
>  - rename BUILD_HOST_ARCH to BUILD_ARCH
>  - add fix for explicit -native build in non-cross setups
>  - add missing debian-sid.conf
> 
> This tries to resolve the native build issues of the visionfive2,
> fixing
> some remaining corner case of -native usage:
> 
> If package A has B-native as build dependency but is then compiled
> without cross-building, using qemu-user instead, it will incorrectly
> request the build of B:, rather than B:. This
> is resolved automatically now, and the solution is used for the
> visionfive2.
> 
> For that board to build again, we also need to switch from sid-ports
> to
> sid, for riscv64 in general.
> 
> Furthermore, this reworks the crossvars logic to also account for the
> corner case that a package is still requested as native although
> ISAR_CROSS_COMPILE is off. While this is likely irrelvant in
> practice,
> the result is a more consistent logic of the crossvars class.
> 
> Jan
> 
> Jan Kiszka (9):
>   Rename BUILD_HOST_ARCH to BUILD_ARCH
>   dpkg: Drop redundant PACKAGE_ARCH initialization
>   crossvars: Adjust logic to account for -native package builds in
>     non-cross setups
>   multiarch: Downgrade native dependencies when building in emulated
>     environment
>   meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation
>   meta-isar: jh7110-u-boot-spl-image: Fix native build
>   meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies
>   linux-custom: Drop unused template variable
>   Move riscv64 from sid-ports to regular sid
> 
>  doc/user_manual.md                            |  4 ++--
>  kas/distro/Kconfig                            |  6 +++---
>  ...{debian-sid-ports.yaml => debian-sid.yaml} |  2 +-
>  kas/machine/Kconfig                           |  6 +++---
>  meta-isar/conf/mc.conf                        |  6 +++---
>  ...64-sid-ports.conf => qemuriscv64-sid.conf} |  2 +-
>  ...0-sid-ports.conf => sifive-fu540-sid.conf} |  2 +-
>  ...rts.conf => starfive-visionfive2-sid.conf} |  2 +-
>  .../jh7110-u-boot-spl-image_0.1.bb            |  6 +++---
>  .../jh7110-u-boot-spl-tool_0.1.bb             |  3 ---
>  ...-starfive-visionfive2_2021.10+VF2-3.0.4.bb |  4 +---
>  meta/classes/crossvars.bbclass                | 19 ++++++++++-------
>  meta/classes/dpkg-base.bbclass                |  2 +-
>  meta/classes/dpkg.bbclass                     |  4 +---
>  meta/classes/multiarch.bbclass                | 12 +++++++++++
>  meta/conf/bitbake.conf                        |  2 +-
>  meta/conf/distro/debian-sid.conf              | 21
> +++++++++++++++++++
>  meta/recipes-kernel/linux/linux-custom.inc    |  1 -
>  testsuite/citest.py                           |  6 +++---
>  19 files changed, 70 insertions(+), 40 deletions(-)
>  rename kas/distro/{debian-sid-ports.yaml => debian-sid.yaml} (78%)
>  rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf =>
> qemuriscv64-sid.conf} (85%)
>  rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.conf =>
> sifive-fu540-sid.conf} (76%)
>  rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid-
> ports.conf => starfive-visionfive2-sid.conf} (78%)
>  create mode 100644 meta/conf/distro/debian-sid.conf
> 

While testing the patchset, I noticed that packages with "-compat"
suffix now pull and use "sbuild-chroot-target" instead of "sbuild-
chroot-host".

Conditions:
ISAR_CROSS_COMPILE = "1"
ISAR_ENABLE_COMPAT_ARCH = "1"

Build command: `bitbake -v mc:qemuarm64-bookworm:hello-compat`

On 'next':

```
build$ ls -1 tmp/work/debian-bookworm-arm64/
base-apt
hello-compat
isar-apt
isar-bootstrap-host
sbuild-chroot-host
```

With patchset:

```
build$ ls -1 tmp/work/debian-bookworm-arm64/
base-apt
hello-compat
isar-apt
isar-bootstrap-target
sbuild-chroot-target
```

If talking about CI, it passes except repro tests.

Due to this issue, some 'deb' files from raspios repositories go to
"debian" download subdirectory, and during the second (base-apt cached)
build they go to Debian's `base-apt` and it leads to the conflict when
resolving dependencies.

I'm stil debugging this, but this part of information may be useful.

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

* Re: [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest
  2023-10-11 10:49 ` [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Uladzimir Bely
@ 2023-10-11 10:51   ` Jan Kiszka
  2023-10-12  4:51     ` Jan Kiszka
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2023-10-11 10:51 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 11.10.23 12:49, Uladzimir Bely wrote:
> On Fri, 2023-10-06 at 17:34 +0200, Jan Kiszka wrote:
>> Changes in v2:
>>  - drop merged revert
>>  - rename BUILD_HOST_ARCH to BUILD_ARCH
>>  - add fix for explicit -native build in non-cross setups
>>  - add missing debian-sid.conf
>>
>> This tries to resolve the native build issues of the visionfive2,
>> fixing
>> some remaining corner case of -native usage:
>>
>> If package A has B-native as build dependency but is then compiled
>> without cross-building, using qemu-user instead, it will incorrectly
>> request the build of B:, rather than B:. This
>> is resolved automatically now, and the solution is used for the
>> visionfive2.
>>
>> For that board to build again, we also need to switch from sid-ports
>> to
>> sid, for riscv64 in general.
>>
>> Furthermore, this reworks the crossvars logic to also account for the
>> corner case that a package is still requested as native although
>> ISAR_CROSS_COMPILE is off. While this is likely irrelvant in
>> practice,
>> the result is a more consistent logic of the crossvars class.
>>
>> Jan
>>
>> Jan Kiszka (9):
>>   Rename BUILD_HOST_ARCH to BUILD_ARCH
>>   dpkg: Drop redundant PACKAGE_ARCH initialization
>>   crossvars: Adjust logic to account for -native package builds in
>>     non-cross setups
>>   multiarch: Downgrade native dependencies when building in emulated
>>     environment
>>   meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation
>>   meta-isar: jh7110-u-boot-spl-image: Fix native build
>>   meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies
>>   linux-custom: Drop unused template variable
>>   Move riscv64 from sid-ports to regular sid
>>
>>  doc/user_manual.md                            |  4 ++--
>>  kas/distro/Kconfig                            |  6 +++---
>>  ...{debian-sid-ports.yaml => debian-sid.yaml} |  2 +-
>>  kas/machine/Kconfig                           |  6 +++---
>>  meta-isar/conf/mc.conf                        |  6 +++---
>>  ...64-sid-ports.conf => qemuriscv64-sid.conf} |  2 +-
>>  ...0-sid-ports.conf => sifive-fu540-sid.conf} |  2 +-
>>  ...rts.conf => starfive-visionfive2-sid.conf} |  2 +-
>>  .../jh7110-u-boot-spl-image_0.1.bb            |  6 +++---
>>  .../jh7110-u-boot-spl-tool_0.1.bb             |  3 ---
>>  ...-starfive-visionfive2_2021.10+VF2-3.0.4.bb |  4 +---
>>  meta/classes/crossvars.bbclass                | 19 ++++++++++-------
>>  meta/classes/dpkg-base.bbclass                |  2 +-
>>  meta/classes/dpkg.bbclass                     |  4 +---
>>  meta/classes/multiarch.bbclass                | 12 +++++++++++
>>  meta/conf/bitbake.conf                        |  2 +-
>>  meta/conf/distro/debian-sid.conf              | 21
>> +++++++++++++++++++
>>  meta/recipes-kernel/linux/linux-custom.inc    |  1 -
>>  testsuite/citest.py                           |  6 +++---
>>  19 files changed, 70 insertions(+), 40 deletions(-)
>>  rename kas/distro/{debian-sid-ports.yaml => debian-sid.yaml} (78%)
>>  rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf =>
>> qemuriscv64-sid.conf} (85%)
>>  rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.conf =>
>> sifive-fu540-sid.conf} (76%)
>>  rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid-
>> ports.conf => starfive-visionfive2-sid.conf} (78%)
>>  create mode 100644 meta/conf/distro/debian-sid.conf
>>
> 
> While testing the patchset, I noticed that packages with "-compat"
> suffix now pull and use "sbuild-chroot-target" instead of "sbuild-
> chroot-host".
> 
> Conditions:
> ISAR_CROSS_COMPILE = "1"
> ISAR_ENABLE_COMPAT_ARCH = "1"
> 
> Build command: `bitbake -v mc:qemuarm64-bookworm:hello-compat`
> 
> On 'next':
> 
> ```
> build$ ls -1 tmp/work/debian-bookworm-arm64/
> base-apt
> hello-compat
> isar-apt
> isar-bootstrap-host
> sbuild-chroot-host
> ```
> 
> With patchset:
> 
> ```
> build$ ls -1 tmp/work/debian-bookworm-arm64/
> base-apt
> hello-compat
> isar-apt
> isar-bootstrap-target
> sbuild-chroot-target
> ```
> 
> If talking about CI, it passes except repro tests.
> 
> Due to this issue, some 'deb' files from raspios repositories go to
> "debian" download subdirectory, and during the second (base-apt cached)
> build they go to Debian's `base-apt` and it leads to the conflict when
> resolving dependencies.
> 
> I'm stil debugging this, but this part of information may be useful.

Likely an issue of patch 3. The rest should still work when pulling this
out, though.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest
  2023-10-11 10:51   ` Jan Kiszka
@ 2023-10-12  4:51     ` Jan Kiszka
  2023-10-12  5:06       ` Uladzimir Bely
  0 siblings, 1 reply; 14+ messages in thread
From: Jan Kiszka @ 2023-10-12  4:51 UTC (permalink / raw)
  To: Uladzimir Bely, isar-users

On 11.10.23 12:51, 'Jan Kiszka' via isar-users wrote:
> On 11.10.23 12:49, Uladzimir Bely wrote:
>> On Fri, 2023-10-06 at 17:34 +0200, Jan Kiszka wrote:
>>> Changes in v2:
>>>  - drop merged revert
>>>  - rename BUILD_HOST_ARCH to BUILD_ARCH
>>>  - add fix for explicit -native build in non-cross setups
>>>  - add missing debian-sid.conf
>>>
>>> This tries to resolve the native build issues of the visionfive2,
>>> fixing
>>> some remaining corner case of -native usage:
>>>
>>> If package A has B-native as build dependency but is then compiled
>>> without cross-building, using qemu-user instead, it will incorrectly
>>> request the build of B:, rather than B:. This
>>> is resolved automatically now, and the solution is used for the
>>> visionfive2.
>>>
>>> For that board to build again, we also need to switch from sid-ports
>>> to
>>> sid, for riscv64 in general.
>>>
>>> Furthermore, this reworks the crossvars logic to also account for the
>>> corner case that a package is still requested as native although
>>> ISAR_CROSS_COMPILE is off. While this is likely irrelvant in
>>> practice,
>>> the result is a more consistent logic of the crossvars class.
>>>
>>> Jan
>>>
>>> Jan Kiszka (9):
>>>   Rename BUILD_HOST_ARCH to BUILD_ARCH
>>>   dpkg: Drop redundant PACKAGE_ARCH initialization
>>>   crossvars: Adjust logic to account for -native package builds in
>>>     non-cross setups
>>>   multiarch: Downgrade native dependencies when building in emulated
>>>     environment
>>>   meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation
>>>   meta-isar: jh7110-u-boot-spl-image: Fix native build
>>>   meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies
>>>   linux-custom: Drop unused template variable
>>>   Move riscv64 from sid-ports to regular sid
>>>
>>>  doc/user_manual.md                            |  4 ++--
>>>  kas/distro/Kconfig                            |  6 +++---
>>>  ...{debian-sid-ports.yaml => debian-sid.yaml} |  2 +-
>>>  kas/machine/Kconfig                           |  6 +++---
>>>  meta-isar/conf/mc.conf                        |  6 +++---
>>>  ...64-sid-ports.conf => qemuriscv64-sid.conf} |  2 +-
>>>  ...0-sid-ports.conf => sifive-fu540-sid.conf} |  2 +-
>>>  ...rts.conf => starfive-visionfive2-sid.conf} |  2 +-
>>>  .../jh7110-u-boot-spl-image_0.1.bb            |  6 +++---
>>>  .../jh7110-u-boot-spl-tool_0.1.bb             |  3 ---
>>>  ...-starfive-visionfive2_2021.10+VF2-3.0.4.bb |  4 +---
>>>  meta/classes/crossvars.bbclass                | 19 ++++++++++-------
>>>  meta/classes/dpkg-base.bbclass                |  2 +-
>>>  meta/classes/dpkg.bbclass                     |  4 +---
>>>  meta/classes/multiarch.bbclass                | 12 +++++++++++
>>>  meta/conf/bitbake.conf                        |  2 +-
>>>  meta/conf/distro/debian-sid.conf              | 21
>>> +++++++++++++++++++
>>>  meta/recipes-kernel/linux/linux-custom.inc    |  1 -
>>>  testsuite/citest.py                           |  6 +++---
>>>  19 files changed, 70 insertions(+), 40 deletions(-)
>>>  rename kas/distro/{debian-sid-ports.yaml => debian-sid.yaml} (78%)
>>>  rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf =>
>>> qemuriscv64-sid.conf} (85%)
>>>  rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.conf =>
>>> sifive-fu540-sid.conf} (76%)
>>>  rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid-
>>> ports.conf => starfive-visionfive2-sid.conf} (78%)
>>>  create mode 100644 meta/conf/distro/debian-sid.conf
>>>
>>
>> While testing the patchset, I noticed that packages with "-compat"
>> suffix now pull and use "sbuild-chroot-target" instead of "sbuild-
>> chroot-host".
>>
>> Conditions:
>> ISAR_CROSS_COMPILE = "1"
>> ISAR_ENABLE_COMPAT_ARCH = "1"
>>
>> Build command: `bitbake -v mc:qemuarm64-bookworm:hello-compat`
>>
>> On 'next':
>>
>> ```
>> build$ ls -1 tmp/work/debian-bookworm-arm64/
>> base-apt
>> hello-compat
>> isar-apt
>> isar-bootstrap-host
>> sbuild-chroot-host
>> ```
>>
>> With patchset:
>>
>> ```
>> build$ ls -1 tmp/work/debian-bookworm-arm64/
>> base-apt
>> hello-compat
>> isar-apt
>> isar-bootstrap-target
>> sbuild-chroot-target
>> ```
>>
>> If talking about CI, it passes except repro tests.
>>
>> Due to this issue, some 'deb' files from raspios repositories go to
>> "debian" download subdirectory, and during the second (base-apt cached)
>> build they go to Debian's `base-apt` and it leads to the conflict when
>> resolving dependencies.
>>
>> I'm stil debugging this, but this part of information may be useful.
> 
> Likely an issue of patch 3. The rest should still work when pulling this
> out, though.
> 

Yep, patch 3, and this should fix it:

diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
index 87e45417..a7834b99 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -16,12 +16,13 @@ python __anonymous() {
     flavor_suffix = ('-' + flavor) if flavor else ''

     distro_arch = d.getVar('DISTRO_ARCH')
+    compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
     host_arch = d.getVar('HOST_ARCH')
     package_arch = d.getVar('PACKAGE_ARCH')

     if distro_arch != host_arch and \
         (package_arch == host_arch or \
-         (package_arch == distro_arch and mode == "1")):
+         (package_arch in [distro_arch, compat_arch] and mode == "1")):
         d.setVar('BUILD_ARCH', host_arch)
         schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
         sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"

Should I resent the whole series with this update?

Jan

-- 
Siemens AG, Technology
Linux Expert Center


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

* Re: [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest
  2023-10-12  4:51     ` Jan Kiszka
@ 2023-10-12  5:06       ` Uladzimir Bely
  0 siblings, 0 replies; 14+ messages in thread
From: Uladzimir Bely @ 2023-10-12  5:06 UTC (permalink / raw)
  To: Jan Kiszka, isar-users

On Thu, 2023-10-12 at 06:51 +0200, Jan Kiszka wrote:
> On 11.10.23 12:51, 'Jan Kiszka' via isar-users wrote:
> > On 11.10.23 12:49, Uladzimir Bely wrote:
> > > On Fri, 2023-10-06 at 17:34 +0200, Jan Kiszka wrote:
> > > > Changes in v2:
> > > >  - drop merged revert
> > > >  - rename BUILD_HOST_ARCH to BUILD_ARCH
> > > >  - add fix for explicit -native build in non-cross setups
> > > >  - add missing debian-sid.conf
> > > > 
> > > > This tries to resolve the native build issues of the
> > > > visionfive2,
> > > > fixing
> > > > some remaining corner case of -native usage:
> > > > 
> > > > If package A has B-native as build dependency but is then
> > > > compiled
> > > > without cross-building, using qemu-user instead, it will
> > > > incorrectly
> > > > request the build of B:, rather than B:. This
> > > > is resolved automatically now, and the solution is used for the
> > > > visionfive2.
> > > > 
> > > > For that board to build again, we also need to switch from sid-
> > > > ports
> > > > to
> > > > sid, for riscv64 in general.
> > > > 
> > > > Furthermore, this reworks the crossvars logic to also account
> > > > for the
> > > > corner case that a package is still requested as native
> > > > although
> > > > ISAR_CROSS_COMPILE is off. While this is likely irrelvant in
> > > > practice,
> > > > the result is a more consistent logic of the crossvars class.
> > > > 
> > > > Jan
> > > > 
> > > > Jan Kiszka (9):
> > > >   Rename BUILD_HOST_ARCH to BUILD_ARCH
> > > >   dpkg: Drop redundant PACKAGE_ARCH initialization
> > > >   crossvars: Adjust logic to account for -native package builds
> > > > in
> > > >     non-cross setups
> > > >   multiarch: Downgrade native dependencies when building in
> > > > emulated
> > > >     environment
> > > >   meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation
> > > >   meta-isar: jh7110-u-boot-spl-image: Fix native build
> > > >   meta-isar: u-boot-starfive-visionfive2: Simplify build
> > > > dependencies
> > > >   linux-custom: Drop unused template variable
> > > >   Move riscv64 from sid-ports to regular sid
> > > > 
> > > >  doc/user_manual.md                            |  4 ++--
> > > >  kas/distro/Kconfig                            |  6 +++---
> > > >  ...{debian-sid-ports.yaml => debian-sid.yaml} |  2 +-
> > > >  kas/machine/Kconfig                           |  6 +++---
> > > >  meta-isar/conf/mc.conf                        |  6 +++---
> > > >  ...64-sid-ports.conf => qemuriscv64-sid.conf} |  2 +-
> > > >  ...0-sid-ports.conf => sifive-fu540-sid.conf} |  2 +-
> > > >  ...rts.conf => starfive-visionfive2-sid.conf} |  2 +-
> > > >  .../jh7110-u-boot-spl-image_0.1.bb            |  6 +++---
> > > >  .../jh7110-u-boot-spl-tool_0.1.bb             |  3 ---
> > > >  ...-starfive-visionfive2_2021.10+VF2-3.0.4.bb |  4 +---
> > > >  meta/classes/crossvars.bbclass                | 19 ++++++++++-
> > > > ------
> > > >  meta/classes/dpkg-base.bbclass                |  2 +-
> > > >  meta/classes/dpkg.bbclass                     |  4 +---
> > > >  meta/classes/multiarch.bbclass                | 12 +++++++++++
> > > >  meta/conf/bitbake.conf                        |  2 +-
> > > >  meta/conf/distro/debian-sid.conf              | 21
> > > > +++++++++++++++++++
> > > >  meta/recipes-kernel/linux/linux-custom.inc    |  1 -
> > > >  testsuite/citest.py                           |  6 +++---
> > > >  19 files changed, 70 insertions(+), 40 deletions(-)
> > > >  rename kas/distro/{debian-sid-ports.yaml => debian-sid.yaml}
> > > > (78%)
> > > >  rename meta-isar/conf/multiconfig/{qemuriscv64-sid-ports.conf
> > > > =>
> > > > qemuriscv64-sid.conf} (85%)
> > > >  rename meta-isar/conf/multiconfig/{sifive-fu540-sid-ports.conf
> > > > =>
> > > > sifive-fu540-sid.conf} (76%)
> > > >  rename meta-isar/conf/multiconfig/{starfive-visionfive2-sid-
> > > > ports.conf => starfive-visionfive2-sid.conf} (78%)
> > > >  create mode 100644 meta/conf/distro/debian-sid.conf
> > > > 
> > > 
> > > While testing the patchset, I noticed that packages with "-
> > > compat"
> > > suffix now pull and use "sbuild-chroot-target" instead of
> > > "sbuild-
> > > chroot-host".
> > > 
> > > Conditions:
> > > ISAR_CROSS_COMPILE = "1"
> > > ISAR_ENABLE_COMPAT_ARCH = "1"
> > > 
> > > Build command: `bitbake -v mc:qemuarm64-bookworm:hello-compat`
> > > 
> > > On 'next':
> > > 
> > > ```
> > > build$ ls -1 tmp/work/debian-bookworm-arm64/
> > > base-apt
> > > hello-compat
> > > isar-apt
> > > isar-bootstrap-host
> > > sbuild-chroot-host
> > > ```
> > > 
> > > With patchset:
> > > 
> > > ```
> > > build$ ls -1 tmp/work/debian-bookworm-arm64/
> > > base-apt
> > > hello-compat
> > > isar-apt
> > > isar-bootstrap-target
> > > sbuild-chroot-target
> > > ```
> > > 
> > > If talking about CI, it passes except repro tests.
> > > 
> > > Due to this issue, some 'deb' files from raspios repositories go
> > > to
> > > "debian" download subdirectory, and during the second (base-apt
> > > cached)
> > > build they go to Debian's `base-apt` and it leads to the conflict
> > > when
> > > resolving dependencies.
> > > 
> > > I'm stil debugging this, but this part of information may be
> > > useful.
> > 
> > Likely an issue of patch 3. The rest should still work when pulling
> > this
> > out, though.
> > 
> 
> Yep, patch 3, and this should fix it:
> 
> diff --git a/meta/classes/crossvars.bbclass
> b/meta/classes/crossvars.bbclass
> index 87e45417..a7834b99 100644
> --- a/meta/classes/crossvars.bbclass
> +++ b/meta/classes/crossvars.bbclass
> @@ -16,12 +16,13 @@ python __anonymous() {
>      flavor_suffix = ('-' + flavor) if flavor else ''
> 
>      distro_arch = d.getVar('DISTRO_ARCH')
> +    compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
>      host_arch = d.getVar('HOST_ARCH')
>      package_arch = d.getVar('PACKAGE_ARCH')
> 
>      if distro_arch != host_arch and \
>          (package_arch == host_arch or \
> -         (package_arch == distro_arch and mode == "1")):
> +         (package_arch in [distro_arch, compat_arch] and mode ==
> "1")):
>          d.setVar('BUILD_ARCH', host_arch)
>          schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
>          sbuild_dep = "sbuild-chroot-host" + flavor_suffix +
> ":do_build"
> 
> Should I resent the whole series with this update?
> 

Yes, please.

In my internal experiments I came up to something similar:

diff --git a/meta/classes/crossvars.bbclass
b/meta/classes/crossvars.bbclass
index 87e45417..501dfef2 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -18,9 +18,11 @@ python __anonymous() {
     distro_arch = d.getVar('DISTRO_ARCH')
     host_arch = d.getVar('HOST_ARCH')
     package_arch = d.getVar('PACKAGE_ARCH')
+    compat_distro_arch = d.getVar('COMPAT_DISTRO_ARCH')
 
     if distro_arch != host_arch and \
         (package_arch == host_arch or \
+         (package_arch == compat_distro_arch and mode == "1") or \
          (package_arch == distro_arch and mode == "1")):
         d.setVar('BUILD_ARCH', host_arch)
         schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)

.. and now testing if it fixes the issue.

> Jan
> 


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

end of thread, other threads:[~2023-10-12  5:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 2/9] dpkg: Drop redundant PACKAGE_ARCH initialization Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 3/9] crossvars: Adjust logic to account for -native package builds in non-cross setups Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 4/9] multiarch: Downgrade native dependencies when building in emulated environment Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 5/9] meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 6/9] meta-isar: jh7110-u-boot-spl-image: Fix native build Jan Kiszka
2023-10-06 15:35 ` [PATCH v2 7/9] meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies Jan Kiszka
2023-10-06 15:35 ` [PATCH v2 8/9] linux-custom: Drop unused template variable Jan Kiszka
2023-10-06 15:35 ` [PATCH v2 9/9] Move riscv64 from sid-ports to regular sid Jan Kiszka
2023-10-11 10:49 ` [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Uladzimir Bely
2023-10-11 10:51   ` Jan Kiszka
2023-10-12  4:51     ` Jan Kiszka
2023-10-12  5:06       ` Uladzimir Bely

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