public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v8 00/16] Sbuild/Schroot migration
@ 2022-03-17  4:50 Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 01/16] dpkg-gbp: Use separate command to export tarball Uladzimir Bely
                   ` (17 more replies)
  0 siblings, 18 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

This is a patchset showing how sbuild/schroot tools can be integrated
into Isar build system.

Base schroot images are created with sbuild-chroot-target or, in case
of cross-build, sbuild-chroot-host recipes. These images are based on
isar-bootstrap ones, but include some build-related stuff preinstalled.

To use these changes you need to have sbuild and schroot installed and
configured. User who runs build should be added to sbuild group.

Currently, sbuild-related stuff is supported in latest kas.

If Gilab CI is used, the following configuration changes are required:
- external dir for schroot overlay should be set in the config
/etc/gitlab-runner/config.toml:

volumes = ["/path/to/overlay:/var/lib/schroot/union/overlay"]

The patchset was tested with 'meta-iot2050' and 'xenomai-images'
downstreams in combination with kas image mentioned above.

Current limitations:
- parallel building of several packages requires more free space in
comparison with buildchroot-based architecture. This happens due
the sbuild architecture which uses some basic layer (common for all
packages) and per-package separate layer (where builddeps are downloaded
and installed).


Changes since v8:
- Added patch with support of package versions with epochs

Changes since v7:
- fixed work with proxy by adding some environment filters in sbuild;
- DEB_BUILD_PROFILES support simplified and improved
- Fixed gbp-based recipes rebuilding (get back --git-ignore-new option
previously removed)
- fixed base-apt caching for packages and source packages temporary
installed in sbuild isolated environment
- fixed rare build error related to ccache setup (added locking)

Changes since v6:
- added patch that switches sbuild from using source directory to using
.dsc file. The file is generated before sbuild call by `dpkg-source`.

Changes since v5:
- warning about shell exports in dpkg_runbuild_prepend. This should
avoided be reworked to templates.

Changes since v4:
- consider shell exports done in dpkg_runbuild_prepend and pass them
to sbuild environment;
- fixed ccache work.

Changes since v3:
- dpkg_do_mounts() and dpkg_undo_mounts() are not removed for downstreams
compatibility;
- dpkg_build_export is used for adjusting sbuild environment;
- DEB_BUILD_PROFILES support for sbuild is fixed in case of cross-build.

Changes since v2:
- patches reworked/squashed for easier reading and understanding;
- fixed building foreigh architectures with kas-docker;
- implemented support of ccache;
- fixed devshell and devshell_nodeps.

Changes since v1:
- parallel builds with different BUILD_DIR are supported;
- parallel multiconfig targets in one build are supported;
- per-task schroot configuration in /etc/schroot/ is now used;
- patchset now passes Jenkins CI (so patches changes RFC => PATCH).


Anton Mikanovich (1):
  dpkg: Build packages with sbuild

Felix Moessbauer (1):
  fix: support build of packages with epoch version

Uladzimir Bely (14):
  dpkg-gbp: Use separate command to export tarball
  dpkg-gbp: Use host tools for dsc preparation
  sbuild: Add recipes for host and target rootfs to run sbuild
  sbuild: Introduce a class for another build method
  sbuild: Support of DEB_BUILD_PROFILES
  sbuild: Support of shell exports from dpkg_runbuild_prepend
  dpkg: Remove builddeps install task.
  sbuild: Add ccache support
  dpkg-base: Switch devshell to use schroot
  dpkg-base: Switch apt_fetch and apt_unpack to use schroot
  doc: Add sbuild-related documentation
  sbuild: Use .dsc file instead of source directory.
  sbuild: Fixed proxy support
  sbuild: Fix debsrc_download for packages dependencies

 doc/user_manual.md                            |  22 +-
 meta/classes/deb-dl-dir.bbclass               |   4 +
 meta/classes/dpkg-base.bbclass                |  78 ++++---
 meta/classes/dpkg-gbp.bbclass                 |  26 +--
 meta/classes/dpkg.bbclass                     | 106 ++++++---
 meta/classes/sbuild.bbclass                   | 211 ++++++++++++++++++
 meta/conf/bitbake.conf                        |   2 +
 .../sbuild-chroot/sbuild-chroot-host.bb       |  13 ++
 .../sbuild-chroot/sbuild-chroot-target.bb     |  10 +
 .../sbuild-chroot/sbuild-chroot.inc           |  39 ++++
 10 files changed, 430 insertions(+), 81 deletions(-)
 create mode 100644 meta/classes/sbuild.bbclass
 create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
 create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
 create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc

-- 
2.20.1


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

* [PATCH v8 01/16] dpkg-gbp: Use separate command to export tarball
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 02/16] dpkg-gbp: Use host tools for dsc preparation Uladzimir Bely
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

We don't actually build the package with gbp, but only prepare it for
the building with external dpkg-buildpackage command. In case there is
no need in real build we can perform only export which will produce
upstream tarball to pass for later building.
This allows to use any build tool for later processing.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg-gbp.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg-gbp.bbclass b/meta/classes/dpkg-gbp.bbclass
index d956e8c3..6129d734 100644
--- a/meta/classes/dpkg-gbp.bbclass
+++ b/meta/classes/dpkg-gbp.bbclass
@@ -30,5 +30,9 @@ do_install_builddeps_append() {
 }
 
 dpkg_runbuild_prepend() {
-    export GBP_PREFIX="gbp buildpackage --git-ignore-new ${GBP_EXTRA_OPTIONS} --git-builder="
+    sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
+        sh -c "cd ${PP}/${PPS} && gbp buildpackage --git-ignore-new --git-builder=/bin/true ${GBP_EXTRA_OPTIONS}"
+    # NOTE: `buildpackage --git-builder=/bin/true --git-pristine-tar` is used
+    # for compatibility with gbp version froms debian-stretch. In newer distros
+    # it's possible to use a subcommand `export-orig --pristine-tar`
 }
-- 
2.20.1


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

* [PATCH v8 02/16] dpkg-gbp: Use host tools for dsc preparation
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 01/16] dpkg-gbp: Use separate command to export tarball Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 03/16] sbuild: Add recipes for host and target rootfs to run sbuild Uladzimir Bely
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

Instead of preinstalling gbp-related packages in sbuild chroot
we will use their host versions in order to keep sbuild environment
as clean as possible.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 doc/user_manual.md            |  4 +++-
 meta/classes/dpkg-gbp.bbclass | 24 ++++--------------------
 2 files changed, 7 insertions(+), 21 deletions(-)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index 466bf8ed..f1e3a83c 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -81,7 +81,9 @@ apt install \
   qemu \
   qemu-user-static \
   reprepro \
-  sudo
+  sudo \
+  git-buildpackage \
+  pristine-tar
 ```
 
 If your host is >= buster, also install the following package.
diff --git a/meta/classes/dpkg-gbp.bbclass b/meta/classes/dpkg-gbp.bbclass
index 6129d734..2b0b8184 100644
--- a/meta/classes/dpkg-gbp.bbclass
+++ b/meta/classes/dpkg-gbp.bbclass
@@ -9,29 +9,13 @@ S = "${WORKDIR}/git"
 
 PATCHTOOL ?= "git"
 
-GBP_DEPENDS ?= "git-buildpackage pristine-tar"
 GBP_EXTRA_OPTIONS ?= "--git-pristine-tar"
 
-do_install_builddeps_append() {
-    dpkg_do_mounts
-    distro="${DISTRO}"
-    if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
-       distro="${HOST_DISTRO}"
-    fi
-    deb_dl_dir_import "${BUILDCHROOT_DIR}" "${distro}"
-    sudo -E chroot ${BUILDCHROOT_DIR} \
-        apt-get install -y -o Debug::pkgProblemResolver=yes \
-                        --no-install-recommends --download-only ${GBP_DEPENDS}
-    deb_dl_dir_export "${BUILDCHROOT_DIR}" "${distro}"
-    sudo -E chroot ${BUILDCHROOT_DIR} \
-        apt-get install -y -o Debug::pkgProblemResolver=yes \
-                        --no-install-recommends ${GBP_DEPENDS}
-    dpkg_undo_mounts
-}
-
 dpkg_runbuild_prepend() {
-    sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
-        sh -c "cd ${PP}/${PPS} && gbp buildpackage --git-ignore-new --git-builder=/bin/true ${GBP_EXTRA_OPTIONS}"
+    sh -c "
+        cd ${WORKDIR}/${PPS}
+        gbp buildpackage --git-ignore-new --git-builder=/bin/true ${GBP_EXTRA_OPTIONS}
+    "
     # NOTE: `buildpackage --git-builder=/bin/true --git-pristine-tar` is used
     # for compatibility with gbp version froms debian-stretch. In newer distros
     # it's possible to use a subcommand `export-orig --pristine-tar`
-- 
2.20.1


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

* [PATCH v8 03/16] sbuild: Add recipes for host and target rootfs to run sbuild
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 01/16] dpkg-gbp: Use separate command to export tarball Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 02/16] dpkg-gbp: Use host tools for dsc preparation Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 04/16] sbuild: Introduce a class for another build method Uladzimir Bely
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

Similar to buildchroot, we need a separate rootfs to be used
for schroot.

It's based on bootstrapped rootfs, but includes several
common build-related packages.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 .../sbuild-chroot/sbuild-chroot-host.bb       | 13 +++++++
 .../sbuild-chroot/sbuild-chroot-target.bb     | 10 ++++++
 .../sbuild-chroot/sbuild-chroot.inc           | 36 +++++++++++++++++++
 3 files changed, 59 insertions(+)
 create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
 create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
 create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc

diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
new file mode 100644
index 00000000..aa82846b
--- /dev/null
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
@@ -0,0 +1,13 @@
+# Root filesystem for packages building
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2021 ilbers GmbH
+
+DESCRIPTION = "Isar sbuild/schroot filesystem for host"
+
+SBUILD_VARIANT = "host"
+
+require sbuild-chroot.inc
+
+ROOTFS_ARCH = "${HOST_ARCH}"
+ROOTFS_DISTRO = "${HOST_DISTRO}"
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
new file mode 100644
index 00000000..d75d783b
--- /dev/null
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
@@ -0,0 +1,10 @@
+# Root filesystem for packages building
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2021 ilbers GmbH
+
+DESCRIPTION = "Isar sbuild/schroot filesystem for target"
+
+SBUILD_VARIANT = "target"
+
+require sbuild-chroot.inc
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
new file mode 100644
index 00000000..177a8a6d
--- /dev/null
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -0,0 +1,36 @@
+# Common part for build chroot filesystem.
+#
+# This software is a part of ISAR.
+# Copyright (C) 2015-2021 ilbers GmbH
+
+LICENSE = "gpl-2.0"
+LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe"
+
+PV = "1.0"
+
+inherit rootfs
+
+SBUILD_CHROOT_PREINSTALL_COMMON = " \
+    fakeroot \
+    build-essential \
+    debhelper \
+"
+
+SBUILD_CHROOT_PREINSTALL ?= " \
+    ${SBUILD_CHROOT_PREINSTALL_COMMON} \
+"
+
+SBUILD_CHROOT_DIR = "${WORKDIR}/rootfs"
+ROOTFSDIR = "${SBUILD_CHROOT_DIR}"
+ROOTFS_PACKAGES = "${SBUILD_CHROOT_PREINSTALL}"
+
+# We don't need /etc/apt/sources.list.d/isar-apt.list' while it's handled by sbuild
+ROOTFS_CONFIGURE_COMMAND_remove = "rootfs_configure_isar_apt"
+
+DEPLOY_SCHROOT = "${@d.getVar('SCHROOT_' + d.getVar('SBUILD_VARIANT').upper() + '_DIR')}"
+
+do_sbuildchroot_deploy[dirs] = "${DEPLOY_DIR}/schroot-${SBUILD_VARIANT}"
+do_sbuildchroot_deploy() {
+    ln -Tfsr "${ROOTFSDIR}" "${DEPLOY_SCHROOT}"
+}
+addtask sbuildchroot_deploy before do_build after do_rootfs
-- 
2.20.1


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

* [PATCH v8 04/16] sbuild: Introduce a class for another build method
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (2 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 03/16] sbuild: Add recipes for host and target rootfs to run sbuild Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17 15:31   ` Moessbauer, Felix
  2022-03-17  4:50 ` [PATCH v8 05/16] dpkg: Build packages with sbuild Uladzimir Bely
                   ` (13 subsequent siblings)
  17 siblings, 1 reply; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

This also adds mounts for base-apt inside schroot and adds import/export
deb files to/from schroot. So that it becomes possible to run second
 `cached` build from local base-apt repo.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/sbuild.bbclass | 160 ++++++++++++++++++++++++++++++++++++
 meta/conf/bitbake.conf      |   2 +
 2 files changed, 162 insertions(+)
 create mode 100644 meta/classes/sbuild.bbclass

diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
new file mode 100644
index 00000000..e4341a6f
--- /dev/null
+++ b/meta/classes/sbuild.bbclass
@@ -0,0 +1,160 @@
+# This software is a part of ISAR.
+# Copyright (C) 2021 ilbers GmbH
+
+SCHROOT_CONF ?= "/etc/schroot"
+
+SCHROOT_MOUNTS ?= ""
+
+python __anonymous() {
+    import pwd
+    d.setVar('SCHROOT_USER', pwd.getpwuid(os.geteuid()).pw_name)
+    d.setVar('SCHROOT_USER_HOME', pwd.getpwuid(os.geteuid()).pw_dir)
+
+    mode = d.getVar('ISAR_CROSS_COMPILE', True)
+    distro_arch = d.getVar('DISTRO_ARCH')
+    if mode == "0" or d.getVar('HOST_ARCH') ==  distro_arch or \
+       (d.getVar('HOST_DISTRO') == "debian-stretch" and distro_arch == "i386"):
+        d.setVar('SBUILD_HOST_ARCH', distro_arch)
+        d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_TARGET_DIR'))
+        dep = "sbuild-chroot-target:do_build"
+    else:
+        d.setVar('SBUILD_HOST_ARCH', d.getVar('HOST_ARCH'))
+        d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_HOST_DIR'))
+        dep = "sbuild-chroot-host:do_build"
+    d.setVar('SCHROOT_DEP', dep)
+}
+
+SBUILD_CHROOT ?= "${DEBDISTRONAME}-${SCHROOT_USER}-${@os.getpid()}"
+SBUILD_CHROOT_RW ?= "${SBUILD_CHROOT}-rw"
+
+SBUILD_CONF_DIR ?= "${SCHROOT_CONF}/${SBUILD_CHROOT}"
+SCHROOT_CONF_FILE ?= "${SCHROOT_CONF}/chroot.d/${SBUILD_CHROOT}"
+SCHROOT_CONF_FILE_RW ?= "${SCHROOT_CONF}/chroot.d/${SBUILD_CHROOT}-rw"
+
+schroot_create_configs() {
+    sudo -s <<'EOSUDO'
+        set -e
+
+        cat << EOF > "${SCHROOT_CONF_FILE}"
+[${SBUILD_CHROOT}]
+type=directory
+directory=${SCHROOT_DIR}
+profile=${SBUILD_CHROOT}
+users=${SCHROOT_USER}
+groups=root,sbuild
+root-users=${SCHROOT_USER}
+root-groups=root,sbuild
+source-root-users=${SCHROOT_USER}
+source-root-groups=root,sbuild
+union-type=overlay
+preserve-environment=true
+EOF
+
+        cat << EOF > "${SCHROOT_CONF_FILE_RW}"
+[${SBUILD_CHROOT_RW}]
+type=directory
+directory=${SCHROOT_DIR}
+profile=${SBUILD_CHROOT}
+users=${SCHROOT_USER}
+groups=root,sbuild
+root-users=${SCHROOT_USER}
+root-groups=root,sbuild
+preserve-environment=true
+EOF
+
+        mkdir -p "${SCHROOT_DIR}/etc/apt/preferences.d"
+        cat << EOF > "${SCHROOT_DIR}/etc/apt/preferences.d/isar-apt"
+Package: *
+Pin: release n=${DEBDISTRONAME}
+Pin-Priority: 1000
+EOF
+
+        # Prepare mount points
+        cp -rf "${SCHROOT_CONF}/sbuild" "${SBUILD_CONF_DIR}"
+        sbuild_fstab="${SBUILD_CONF_DIR}/fstab"
+
+        fstab_baseapt="${REPO_BASE_DIR} /base-apt none rw,bind 0 0"
+        grep -qxF "${fstab_baseapt}" ${sbuild_fstab} || echo "${fstab_baseapt}" >> ${sbuild_fstab}
+
+        if [ -d ${DL_DIR} ]; then
+            fstab_downloads="${DL_DIR} /downloads none rw,bind 0 0"
+            grep -qxF "${fstab_downloads}" ${sbuild_fstab} || echo "${fstab_downloads}" >> ${sbuild_fstab}
+        fi
+EOSUDO
+}
+
+schroot_delete_configs() {
+    sudo -s <<'EOSUDO'
+        set -e
+        if [ -d "${SBUILD_CONF_DIR}" ]; then
+            rm -rf "${SBUILD_CONF_DIR}"
+        fi
+        rm -f "${SCHROOT_DIR}/etc/apt/preferences.d/isar-apt"
+        rm -f "${SCHROOT_CONF_FILE}"
+        rm -f "${SCHROOT_CONF_FILE_RW}"
+EOSUDO
+}
+
+sbuild_export() {
+    SBUILD_CONFIG="${WORKDIR}/sbuild.conf"
+    VAR=${1}; shift
+    VAR_LINE="'${VAR}' => '${@}',"
+    if [ -s "${SBUILD_CONFIG}" ]; then
+        sed -i -e "\$i\\" -e "${VAR_LINE}" ${SBUILD_CONFIG}
+    else
+        echo "\$build_environment = {" > ${SBUILD_CONFIG}
+        echo "${VAR_LINE}" >> ${SBUILD_CONFIG}
+        echo "};" >> ${SBUILD_CONFIG}
+    fi
+    export SBUILD_CONFIG="${SBUILD_CONFIG}"
+}
+
+schroot_install() {
+    schroot_create_configs
+    APTS="$1"
+
+    distro="${DISTRO}"
+    if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
+       distro="${HOST_DISTRO}"
+    fi
+
+    deb_dl_dir_import ${SCHROOT_DIR} ${distro}
+    schroot -d / -c ${SBUILD_CHROOT_RW} -u root -- \
+        apt install -y -o Debug::pkgProblemResolver=yes \
+                    --no-install-recommends --download-only ${APTS}
+    deb_dl_dir_export ${SCHROOT_DIR} ${distro}
+
+    schroot -d / -c ${SBUILD_CHROOT_RW} -u root -- \
+        apt install -y -o Debug::pkgProblemResolver=yes \
+                    --no-install-recommends ${APTS}
+    schroot_delete_configs
+}
+
+insert_mounts() {
+    sudo -s <<'EOSUDO'
+        set -e
+        for mp in ${SCHROOT_MOUNTS}; do
+            FSTAB_LINE="${mp%%:*} ${mp#*:} none rw,bind 0 0"
+            grep -qxF "${FSTAB_LINE}" ${SBUILD_CONF_DIR}/fstab || \
+                echo "${FSTAB_LINE}" >> ${SBUILD_CONF_DIR}/fstab
+        done
+EOSUDO
+}
+
+remove_mounts() {
+    sudo -s <<'EOSUDO'
+        set -e
+        for mp in ${SCHROOT_MOUNTS}; do
+            FSTAB_LINE="${mp%%:*} ${mp#*:} none rw,bind 0 0"
+            sed -i "\|${FSTAB_LINE}|d" ${SBUILD_CONF_DIR}/fstab
+        done
+EOSUDO
+}
+
+schroot_run() {
+    schroot_create_configs
+    insert_mounts
+    schroot $@
+    remove_mounts
+    schroot_delete_configs
+}
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index cd1c4a64..c1458f05 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -58,6 +58,8 @@ SSTATE_DIR ?= "${TOPDIR}/sstate-cache"
 SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${DISTRO}-${DISTRO_ARCH}"
 BUILDCHROOT_HOST_DIR = "${DEPLOY_DIR_BUILDCHROOT}-host/${HOST_DISTRO}-${HOST_ARCH}_${DISTRO}-${DISTRO_ARCH}"
 BUILDCHROOT_TARGET_DIR = "${DEPLOY_DIR_BUILDCHROOT}-target/${DISTRO}-${DISTRO_ARCH}"
+SCHROOT_HOST_DIR = "${DEPLOY_DIR}/schroot-host/${HOST_DISTRO}-${HOST_ARCH}_${DISTRO}-${DISTRO_ARCH}"
+SCHROOT_TARGET_DIR = "${DEPLOY_DIR}/schroot-target/${DISTRO}-${DISTRO_ARCH}"
 SDKCHROOT_DIR = "${DEPLOY_DIR_SDKCHROOT}/${DISTRO}-${DISTRO_ARCH}"
 CACHE = "${TMPDIR}/cache"
 KERNEL_FILE ?= "vmlinuz"
-- 
2.20.1


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

* [PATCH v8 05/16] dpkg: Build packages with sbuild
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (3 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 04/16] sbuild: Introduce a class for another build method Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 06/16] sbuild: Support of DEB_BUILD_PROFILES Uladzimir Bely
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

From: Anton Mikanovich <amikan@ilbers.de>

Use previously exported to schroot rootfs to build the package with
sbuild tool. Provide isar-apt as extra repository to be automatically
add to apt sources.

Also added /home/.git-downloads mount while it's used
as git alternates location.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg-base.bbclass | 31 ++++++++++++++++---------------
 meta/classes/dpkg-gbp.bbclass  |  2 ++
 meta/classes/dpkg.bbclass      | 10 ++++++++--
 meta/classes/sbuild.bbclass    |  4 ++--
 4 files changed, 28 insertions(+), 19 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 86933c57..c60052d3 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -4,6 +4,7 @@
 #
 # SPDX-License-Identifier: MIT
 
+inherit sbuild
 inherit buildchroot
 inherit debianize
 inherit terminal
@@ -16,6 +17,8 @@ DEPENDS_append_riscv64 = "${@' crossbuild-essential-riscv64' if d.getVar('ISAR_C
 DEB_BUILD_PROFILES ?= ""
 DEB_BUILD_OPTIONS ?= ""
 
+ISAR_APT_REPO ?= "deb [trusted=yes] file:///home/builder/${PN}/isar-apt/${DISTRO}-${DISTRO_ARCH}/apt/${DISTRO} ${DEBDISTRONAME} main"
+
 python do_adjust_git() {
     import subprocess
 
@@ -177,6 +180,7 @@ addtask prepare_build after do_patch do_transform_template before do_dpkg_build
 # If Isar recipes depend on each other, they typically need the package
 # deployed to isar-apt
 do_prepare_build[deptask] = "do_deploy_deb"
+do_prepare_build[depends] = "${SCHROOT_DEP}"
 
 BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
 
@@ -202,6 +206,15 @@ dpkg_undo_mounts() {
     sudo rmdir ${BUILDROOT}
 }
 
+do_prepare_build_append() {
+    # Make a local copy of isar-apt repo that is not affected by other parallel builds
+    mkdir -p ${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}
+    rm -rf ${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}/*
+    cp -Rl ${REPO_ISAR_DIR} ${WORKDIR}/isar-apt/${DISTRO}-${DISTRO_ARCH}
+}
+
+do_prepare_build[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
+
 # Placeholder for actual dpkg_runbuild() implementation
 dpkg_runbuild() {
     die "This should never be called, overwrite it in your derived class"
@@ -224,14 +237,11 @@ def isar_export_build_settings(d):
     os.environ['DEB_BUILD_PROFILES'] = isar_deb_build_profiles(d)
 
 python do_dpkg_build() {
-    lock = bb.utils.lockfile(d.getVar("REPO_ISAR_DIR") + "/isar.lock",
-                             shared=True)
-    bb.build.exec_func("dpkg_do_mounts", d)
+    bb.build.exec_func('schroot_create_configs', d)
     try:
         bb.build.exec_func("dpkg_runbuild", d)
     finally:
-        bb.build.exec_func("dpkg_undo_mounts", d)
-        bb.utils.unlockfile(lock)
+        bb.build.exec_func('schroot_delete_configs', d)
 }
 
 addtask dpkg_build
@@ -261,7 +271,7 @@ python do_dpkg_build_setscene() {
 addtask dpkg_build_setscene
 do_dpkg_build_setscene[dirs] += "${S}/.."
 
-KEEP_INSTALLED_ON_CLEAN ?= "0"
+do_dpkg_build[depends] = "${SCHROOT_DEP}"
 
 CLEANFUNCS += "deb_clean"
 
@@ -271,15 +281,6 @@ deb_clean() {
         for d in ${DEBS}; do
             repo_del_package "${REPO_ISAR_DIR}"/"${DISTRO}" \
                 "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${d}"
-            if [ "${KEEP_INSTALLED_ON_CLEAN}" = "1" ]; then
-                continue;
-            fi
-            package=$(basename "${d}")
-            package_remove="/usr/bin/apt-get remove -y ${package%%_*}"
-            sudo -E chroot ${BUILDCHROOT_DIR} ${package_remove} || true
-            if [ "${BUILDCHROOT_DIR}" != "${BUILDCHROOT_TARGET_DIR}" ]; then
-                    sudo -E chroot ${BUILDCHROOT_TARGET_DIR} ${package_remove} || true
-            fi
         done
     fi
 }
diff --git a/meta/classes/dpkg-gbp.bbclass b/meta/classes/dpkg-gbp.bbclass
index 2b0b8184..68172b3f 100644
--- a/meta/classes/dpkg-gbp.bbclass
+++ b/meta/classes/dpkg-gbp.bbclass
@@ -11,6 +11,8 @@ PATCHTOOL ?= "git"
 
 GBP_EXTRA_OPTIONS ?= "--git-pristine-tar"
 
+SCHROOT_MOUNTS = "${WORKDIR}:${PP} ${GITDIR}:/home/.git-downloads"
+
 dpkg_runbuild_prepend() {
     sh -c "
         cd ${WORKDIR}/${PPS}
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 320102ba..848ffad1 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -39,6 +39,12 @@ dpkg_runbuild() {
     export DEB_BUILD_OPTIONS="${@ isar_deb_build_options(d)}"
     export DEB_BUILD_PROFILES="${@ isar_deb_build_profiles(d)}"
     export PARALLEL_MAKE="${PARALLEL_MAKE}"
-    sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
-         /isar/build.sh ${PP}/${PPS} ${PACKAGE_ARCH}
+
+    export SBUILD_CONFIG="${SBUILD_CONFIG}"
+
+    sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
+        --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} \
+        --no-run-lintian --no-run-piuparts --no-run-autopkgtest \
+        --debbuildopts="--source-option=-I" \
+        --build-dir=${WORKDIR} ${WORKDIR}/${PPS}
 }
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index e4341a6f..6fff664f 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -31,6 +31,8 @@ SBUILD_CONF_DIR ?= "${SCHROOT_CONF}/${SBUILD_CHROOT}"
 SCHROOT_CONF_FILE ?= "${SCHROOT_CONF}/chroot.d/${SBUILD_CHROOT}"
 SCHROOT_CONF_FILE_RW ?= "${SCHROOT_CONF}/chroot.d/${SBUILD_CHROOT}-rw"
 
+SBUILD_CONFIG="${WORKDIR}/sbuild.conf"
+
 schroot_create_configs() {
     sudo -s <<'EOSUDO'
         set -e
@@ -96,7 +98,6 @@ EOSUDO
 }
 
 sbuild_export() {
-    SBUILD_CONFIG="${WORKDIR}/sbuild.conf"
     VAR=${1}; shift
     VAR_LINE="'${VAR}' => '${@}',"
     if [ -s "${SBUILD_CONFIG}" ]; then
@@ -106,7 +107,6 @@ sbuild_export() {
         echo "${VAR_LINE}" >> ${SBUILD_CONFIG}
         echo "};" >> ${SBUILD_CONFIG}
     fi
-    export SBUILD_CONFIG="${SBUILD_CONFIG}"
 }
 
 schroot_install() {
-- 
2.20.1


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

* [PATCH v8 06/16] sbuild: Support of DEB_BUILD_PROFILES
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (4 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 05/16] dpkg: Build packages with sbuild Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 07/16] sbuild: Support of shell exports from dpkg_runbuild_prepend Uladzimir Bely
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

In Isar packages may use their own profiles. For example, linux-custom.inc
introduces 'nolibcdev' profile that should be passed to dpkg-buildpackage
in both cross and native builds.

By default, sbuild for cross-building uses passes "cross,nocheck" options
to dpkg-buildpackage and ignores DEB_BUILD_PROFILES environment variable.

This change makes sbuild use custom profiles even in cross-build mode.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 848ffad1..1f795c75 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -37,13 +37,17 @@ dpkg_runbuild() {
     E="${@ isar_export_proxies(d)}"
     E="${@ isar_export_ccache(d)}"
     export DEB_BUILD_OPTIONS="${@ isar_deb_build_options(d)}"
-    export DEB_BUILD_PROFILES="${@ isar_deb_build_profiles(d)}"
     export PARALLEL_MAKE="${PARALLEL_MAKE}"
 
+    profiles="${@ isar_deb_build_profiles(d)}"
+    if [ ! -z "$profiles" ]; then
+        profiles=$(echo --profiles="$profiles" | sed -e 's/ \+/,/g')
+    fi
+
     export SBUILD_CONFIG="${SBUILD_CONFIG}"
 
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
-        --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} \
+        --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
         --no-run-lintian --no-run-piuparts --no-run-autopkgtest \
         --debbuildopts="--source-option=-I" \
         --build-dir=${WORKDIR} ${WORKDIR}/${PPS}
-- 
2.20.1


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

* [PATCH v8 07/16] sbuild: Support of shell exports from dpkg_runbuild_prepend
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (5 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 06/16] sbuild: Support of DEB_BUILD_PROFILES Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 08/16] dpkg: Remove builddeps install task Uladzimir Bely
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

Many of recipes often use shell exports done in dpkg_run_prepend.

While sbuild is performed in isolated environment, we need a way to pass
these exported variables to it. This is done by storing environment just
before dpkg_runbuild (after prepare_build) and finding just before
the actual build what has been changed or added.

This patch allows using shell exports, but warning will be produced.
It's recommended to modify the code (in downstreams) and replace shell
exports by other methods, like using templates.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg.bbclass | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 1f795c75..b61d182d 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -32,6 +32,12 @@ do_install_builddeps[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
 
 addtask devshell after do_install_builddeps
 
+DPKG_PREBUILD_ENV_FILE="${WORKDIR}/dpkg_prebuild.env"
+
+do_prepare_build_append() {
+    env > ${DPKG_PREBUILD_ENV_FILE}
+}
+
 # Build package from sources using build script
 dpkg_runbuild() {
     E="${@ isar_export_proxies(d)}"
@@ -39,6 +45,26 @@ dpkg_runbuild() {
     export DEB_BUILD_OPTIONS="${@ isar_deb_build_options(d)}"
     export PARALLEL_MAKE="${PARALLEL_MAKE}"
 
+    env | while read -r line; do
+        # Filter the same lines
+        grep -q "^${line}" ${DPKG_PREBUILD_ENV_FILE} && continue
+        # Filter some standard variables
+        echo ${line} | grep -q "^HOME=" && continue
+        echo ${line} | grep -q "^PWD=" && continue
+
+        var=$(echo "${line}" | cut -d '=' -f1)
+        value=$(echo "${line}" | cut -d '=' -f2-)
+        sbuild_export $var "$value"
+
+        # Don't warn some variables
+        [ "${var}" = "PARALLEL_MAKE" ] && continue
+        [ "${var}" = "CCACHE_DIR" ] && continue
+        [ "${var}" = "PATH_PREPEND" ] && continue
+        [ "${var}" = "DEB_BUILD_OPTIONS" ] && continue
+
+        bbwarn "Export of '${line}' detected, please migrate to templates"
+    done
+
     profiles="${@ isar_deb_build_profiles(d)}"
     if [ ! -z "$profiles" ]; then
         profiles=$(echo --profiles="$profiles" | sed -e 's/ \+/,/g')
-- 
2.20.1


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

* [PATCH v8 08/16] dpkg: Remove builddeps install task.
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (6 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 07/16] sbuild: Support of shell exports from dpkg_runbuild_prepend Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-04-08  9:11   ` Moessbauer, Felix
  2022-03-17  4:50 ` [PATCH v8 09/16] sbuild: Add ccache support Uladzimir Bely
                   ` (9 subsequent siblings)
  17 siblings, 1 reply; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

While builddeps are now handled interlnally by sbuild, we don't need
a task to preinstall them in buildchroot.

But for the second local (base-apt) build we need a way to keep
all dependencies in form of .deb files in DL_DIR. This is done
by executing additional commands in sbuild that copy them to/from
an externally mounted folder.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg.bbclass   | 44 ++++++++++++++-----------------------
 meta/classes/sbuild.bbclass |  1 -
 2 files changed, 17 insertions(+), 28 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index b61d182d..b3931850 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -5,33 +5,6 @@ inherit dpkg-base
 
 PACKAGE_ARCH ?= "${DISTRO_ARCH}"
 
-# Install build dependencies for package
-do_install_builddeps() {
-    dpkg_do_mounts
-    E="${@ isar_export_proxies(d)}"
-    export DEB_BUILD_OPTIONS="${@ isar_deb_build_options(d)}"
-    export DEB_BUILD_PROFILES="${@ isar_deb_build_profiles(d)}"
-    distro="${DISTRO}"
-    if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
-        distro="${HOST_DISTRO}"
-    fi
-
-    deb_dl_dir_import "${BUILDCHROOT_DIR}" "${distro}"
-    sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh \
-        ${PP}/${PPS} ${PACKAGE_ARCH} --download-only
-    deb_dl_dir_export "${BUILDCHROOT_DIR}" "${distro}"
-    sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh \
-        ${PP}/${PPS} ${PACKAGE_ARCH}
-    dpkg_undo_mounts
-}
-
-addtask install_builddeps after do_prepare_build before do_dpkg_build
-do_install_builddeps[depends] += "isar-apt:do_cache_config"
-# apt and reprepro may not run in parallel, acquire the Isar lock
-do_install_builddeps[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
-
-addtask devshell after do_install_builddeps
-
 DPKG_PREBUILD_ENV_FILE="${WORKDIR}/dpkg_prebuild.env"
 
 do_prepare_build_append() {
@@ -65,6 +38,16 @@ dpkg_runbuild() {
         bbwarn "Export of '${line}' detected, please migrate to templates"
     done
 
+    distro="${DISTRO}"
+    if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
+        distro="${HOST_DISTRO}"
+    fi
+
+    deb_dl_dir_import "${WORKDIR}/rootfs" "${distro}"
+
+    deb_dir="/var/cache/apt/archives/"
+    ext_deb_dir="/home/builder/${PN}/rootfs/${deb_dir}"
+
     profiles="${@ isar_deb_build_profiles(d)}"
     if [ ! -z "$profiles" ]; then
         profiles=$(echo --profiles="$profiles" | sed -e 's/ \+/,/g')
@@ -72,9 +55,16 @@ dpkg_runbuild() {
 
     export SBUILD_CONFIG="${SBUILD_CONFIG}"
 
+    echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG}
+
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
         --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
         --no-run-lintian --no-run-piuparts --no-run-autopkgtest \
+        --chroot-setup-commands="cp -n --no-preserve=owner ${ext_deb_dir}/*.deb -t ${deb_dir}/ || :" \
+        --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
+        --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
         --debbuildopts="--source-option=-I" \
         --build-dir=${WORKDIR} ${WORKDIR}/${PPS}
+
+    deb_dl_dir_export "${WORKDIR}/rootfs" "${distro}"
 }
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index 6fff664f..cfd0acd5 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -8,7 +8,6 @@ SCHROOT_MOUNTS ?= ""
 python __anonymous() {
     import pwd
     d.setVar('SCHROOT_USER', pwd.getpwuid(os.geteuid()).pw_name)
-    d.setVar('SCHROOT_USER_HOME', pwd.getpwuid(os.geteuid()).pw_dir)
 
     mode = d.getVar('ISAR_CROSS_COMPILE', True)
     distro_arch = d.getVar('DISTRO_ARCH')
-- 
2.20.1


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

* [PATCH v8 09/16] sbuild: Add ccache support
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (7 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 08/16] dpkg: Remove builddeps install task Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 10/16] dpkg-base: Switch devshell to use schroot Uladzimir Bely
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

This adds ccache support for custom packages in the same manner
as it was done previously for buildchroot-based build, by using
USE_CCACHE variable in local.conf or per-recipe.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg.bbclass                     |  4 ++++
 meta/classes/sbuild.bbclass                   | 23 +++++++++++++++++++
 .../sbuild-chroot/sbuild-chroot.inc           |  1 +
 3 files changed, 28 insertions(+)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index b3931850..2392d894 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -48,6 +48,10 @@ dpkg_runbuild() {
     deb_dir="/var/cache/apt/archives/"
     ext_deb_dir="/home/builder/${PN}/rootfs/${deb_dir}"
 
+    if [ ${USE_CCACHE} -eq 1 ]; then
+        schroot_configure_ccache
+    fi
+
     profiles="${@ isar_deb_build_profiles(d)}"
     if [ ! -z "$profiles" ]; then
         profiles=$(echo --profiles="$profiles" | sed -e 's/ \+/,/g')
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index cfd0acd5..63820793 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -157,3 +157,26 @@ schroot_run() {
     remove_mounts
     schroot_delete_configs
 }
+
+schroot_configure_ccache() {
+    sudo -s <<'EOSUDO'
+        set -e
+
+        sbuild_fstab="${SBUILD_CONF_DIR}/fstab"
+
+        install --group=sbuild --mode=2775 -d ${CCACHE_DIR}
+        fstab_ccachedir="${CCACHE_DIR} /ccache none rw,bind 0 0"
+        grep -qxF "${fstab_ccachedir}" ${sbuild_fstab} || echo "${fstab_ccachedir}" >> ${sbuild_fstab}
+
+        (flock 9
+        [ -w ${CCACHE_DIR}/sbuild-setup ] || cat << END > ${CCACHE_DIR}/sbuild-setup
+#!/bin/sh
+export PATH="\$PATH_PREPEND:\$PATH"
+exec "\$@"
+END
+        chmod a+rx ${CCACHE_DIR}/sbuild-setup
+        ) 9>"${CCACHE_DIR}/sbuild-setup.lock"
+
+        echo "command-prefix=/ccache/sbuild-setup" >> "${SCHROOT_CONF_FILE}"
+EOSUDO
+}
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index 177a8a6d..74811e22 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -14,6 +14,7 @@ SBUILD_CHROOT_PREINSTALL_COMMON = " \
     fakeroot \
     build-essential \
     debhelper \
+    ccache \
 "
 
 SBUILD_CHROOT_PREINSTALL ?= " \
-- 
2.20.1


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

* [PATCH v8 10/16] dpkg-base: Switch devshell to use schroot
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (8 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 09/16] sbuild: Add ccache support Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 11/16] dpkg-base: Switch apt_fetch and apt_unpack " Uladzimir Bely
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

While packages are now build in schroot with sbuild, devshell
task should make terminal open inside sbuild environment.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg-base.bbclass                | 23 ++++++++++++++-----
 meta/classes/sbuild.bbclass                   |  3 +++
 .../sbuild-chroot/sbuild-chroot.inc           |  2 ++
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index c60052d3..df42e417 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -298,19 +298,30 @@ do_deploy_deb[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
 do_deploy_deb[dirs] = "${S}"
 
 python do_devshell() {
-    bb.build.exec_func('dpkg_do_mounts', d)
+    bb.build.exec_func('schroot_create_configs', d)
 
     isar_export_proxies(d)
     isar_export_ccache(d)
     isar_export_build_settings(d)
 
-    buildchroot = d.getVar('BUILDCHROOT_DIR')
+    schroot = d.getVar('SBUILD_CHROOT')
+    isar_apt = d.getVar('ISAR_APT_REPO')
     pp_pps = os.path.join(d.getVar('PP'), d.getVar('PPS'))
-    # the PATH variable is not forwarded by sudo -E.
-    termcmd = "sudo -E chroot {0} sh -c 'cd {1}; export PATH=$PATH_PREPEND:$PATH; $SHELL -i'"
-    oe_terminal(termcmd.format(buildchroot, pp_pps), "Isar devshell", d)
 
-    bb.build.exec_func('dpkg_undo_mounts', d)
+    install_deps = ":" if d.getVar('BB_CURRENTTASK') == "devshell_nodeps" else "mk-build-deps -i -t \
+        \"apt-get -y -q -o Debug::pkgProblemResolver=yes --no-install-recommends --allow-downgrades\" \
+        debian/control"
+
+    termcmd = "schroot -d / -c {0} -u root -- sh -c ' \
+        cd {1}; \
+        echo {2} > /etc/apt/sources.list.d/isar_apt.list; \
+        apt-get -y -q update; \
+        {3}; \
+        $SHELL -i \
+    '"
+    oe_terminal(termcmd.format(schroot, pp_pps, isar_apt, install_deps), "Isar devshell", d)
+
+    bb.build.exec_func('schroot_delete_configs', d)
 }
 
 addtask devshell after do_prepare_build
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index 63820793..f7c93bbe 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -77,6 +77,9 @@ EOF
         fstab_baseapt="${REPO_BASE_DIR} /base-apt none rw,bind 0 0"
         grep -qxF "${fstab_baseapt}" ${sbuild_fstab} || echo "${fstab_baseapt}" >> ${sbuild_fstab}
 
+        fstab_pkgdir="${WORKDIR} /home/builder/${PN} none rw,bind 0 0"
+        grep -qxF "${fstab_pkgdir}" ${sbuild_fstab} || echo "${fstab_pkgdir}" >> ${sbuild_fstab}
+
         if [ -d ${DL_DIR} ]; then
             fstab_downloads="${DL_DIR} /downloads none rw,bind 0 0"
             grep -qxF "${fstab_downloads}" ${sbuild_fstab} || echo "${fstab_downloads}" >> ${sbuild_fstab}
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index 74811e22..4688da1d 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -15,6 +15,8 @@ SBUILD_CHROOT_PREINSTALL_COMMON = " \
     build-essential \
     debhelper \
     ccache \
+    devscripts \
+    equivs \
 "
 
 SBUILD_CHROOT_PREINSTALL ?= " \
-- 
2.20.1


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

* [PATCH v8 11/16] dpkg-base: Switch apt_fetch and apt_unpack to use schroot
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (9 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 10/16] dpkg-base: Switch devshell to use schroot Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 12/16] doc: Add sbuild-related documentation Uladzimir Bely
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

This moves downloading and unpacking deb-src to schroot environment.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg-base.bbclass | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index df42e417..01676f5e 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -105,19 +105,12 @@ python() {
 }
 
 do_apt_fetch() {
-    dpkg_do_mounts
-    E="${@ isar_export_proxies(d)}"
-    sudo -E chroot ${BUILDCHROOT_DIR} /usr/bin/apt-get update \
-        -o Dir::Etc::SourceList="sources.list.d/isar-apt.list" \
-        -o Dir::Etc::SourceParts="-" \
-        -o APT::Get::List-Cleanup="0"
-
+    schroot_create_configs
     for uri in "${SRC_APT}"; do
-        sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
+        schroot -d / -c ${SBUILD_CHROOT} -- \
             sh -c 'mkdir -p /downloads/deb-src/"$1"/"$2" && cd /downloads/deb-src/"$1"/"$2" && apt-get -y --download-only --only-source source "$2"' my_script "${DISTRO}" "${uri}"
     done
-
-    dpkg_undo_mounts
+    schroot_delete_configs
 }
 
 addtask apt_fetch after do_unpack before do_apt_unpack
@@ -126,13 +119,14 @@ do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
 # Add dependency from the correct buildchroot: host or target
 do_apt_fetch[depends] = "${BUILDCHROOT_DEP}"
 
+# Add dependency from the correct schroot: host or target
+do_apt_fetch[depends] += "${SCHROOT_DEP}"
+
 do_apt_unpack() {
     rm -rf ${S}
-    dpkg_do_mounts
-    E="${@ isar_export_proxies(d)}"
-
+    schroot_create_configs
     for uri in "${SRC_APT}"; do
-        sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
+        schroot -d / -c ${SBUILD_CHROOT} -- \
             sh -c ' \
                 set -e
                 dscfile="$(apt-get -y -qq --print-uris --only-source source "${2}" | cut -d " " -f2 | grep -E "*.dsc")"
@@ -141,8 +135,7 @@ do_apt_unpack() {
                 dpkg-source -x "${dscfile}" "${PPS}"' \
                     my_script "${DISTRO}" "${uri}"
     done
-
-    dpkg_undo_mounts
+    schroot_delete_configs
 }
 
 addtask apt_unpack after do_apt_fetch before do_patch
-- 
2.20.1


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

* [PATCH v8 12/16] doc: Add sbuild-related documentation
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (10 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 11/16] dpkg-base: Switch apt_fetch and apt_unpack " Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 13/16] sbuild: Use .dsc file instead of source directory Uladzimir Bely
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 doc/user_manual.md | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/doc/user_manual.md b/doc/user_manual.md
index f1e3a83c..25987857 100644
--- a/doc/user_manual.md
+++ b/doc/user_manual.md
@@ -86,6 +86,24 @@ apt install \
   pristine-tar
 ```
 
+Additional setup is required since `sbuild` is now used for package build.
+Install the following packages:
+```
+apt install \
+  sbuild \
+  schroot
+```
+Also, user who runs isar should be added to `sbuild` group.
+
+**NOTE:** sbuild version (<=0.78.1) packaged in Debian Buster doesn't support
+`$apt_keep_downloaded_packages` option which is required in Isar for
+populating `${DL_DIR}/deb`. So, host `sbuild` in this case should be manually
+upgraded to >=0.81.2 version from Debian Bullseye.
+
+```
+sudo gpasswd -a <username> sbuild
+```
+
 If your host is >= buster, also install the following package.
 ```
 apt install python3-distutils
-- 
2.20.1


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

* [PATCH v8 13/16] sbuild: Use .dsc file instead of source directory.
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (11 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 12/16] doc: Add sbuild-related documentation Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 14/16] sbuild: Fixed proxy support Uladzimir Bely
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

This makes build more Debian-like and avoids additional execution of
"dh clean" by sbuild before dependencies resolved and build started.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 2392d894..da3b3ede 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -61,6 +61,10 @@ dpkg_runbuild() {
 
     echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG}
 
+    # Create a .dsc file from source directory to use it with sbuild
+    sh -c "cd ${WORKDIR}; dpkg-source -q -b ${PPS}"
+    DSC=$(head -n1 ${WORKDIR}/${PPS}/debian/changelog | awk '{gsub(/[()]/,""); printf "%s_%s.dsc", $1, $2}')
+
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
         --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
         --no-run-lintian --no-run-piuparts --no-run-autopkgtest \
@@ -68,7 +72,7 @@ dpkg_runbuild() {
         --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
         --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
         --debbuildopts="--source-option=-I" \
-        --build-dir=${WORKDIR} ${WORKDIR}/${PPS}
+        --build-dir=${WORKDIR} --dist="isar" ${WORKDIR}/${DSC}
 
     deb_dl_dir_export "${WORKDIR}/rootfs" "${distro}"
 }
-- 
2.20.1


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

* [PATCH v8 14/16] sbuild: Fixed proxy support
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (12 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 13/16] sbuild: Use .dsc file instead of source directory Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 15/16] sbuild: Fix debsrc_download for packages dependencies Uladzimir Bely
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

This makes sbuild able to work via proxy.

Proxy settings passed via 'sbuild_export' seem to work only for build
stage in sbuild. Previous stages (like schroot setup, downloading deps)
don't use this values.

To work via proxy in this stages there should be environment filter
for sbuild set via sbuild.conf.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/dpkg-base.bbclass |  1 +
 meta/classes/dpkg.bbclass      | 14 ++++++++++++++
 meta/classes/sbuild.bbclass    | 31 ++++++++++++++++++++++++-------
 3 files changed, 39 insertions(+), 7 deletions(-)

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 01676f5e..e879bf9c 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -105,6 +105,7 @@ python() {
 }
 
 do_apt_fetch() {
+    E="${@ isar_export_proxies(d)}"
     schroot_create_configs
     for uri in "${SRC_APT}"; do
         schroot -d / -c ${SBUILD_CHROOT} -- \
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index da3b3ede..126a4ee4 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -35,6 +35,15 @@ dpkg_runbuild() {
         [ "${var}" = "PATH_PREPEND" ] && continue
         [ "${var}" = "DEB_BUILD_OPTIONS" ] && continue
 
+        [ "${var}" = "http_proxy" ] && continue
+        [ "${var}" = "HTTP_PROXY" ] && continue
+        [ "${var}" = "https_proxy" ] && continue
+        [ "${var}" = "HTTPS_PROXY" ] && continue
+        [ "${var}" = "ftp_proxy" ] && continue
+        [ "${var}" = "FTP_PROXY" ] && continue
+        [ "${var}" = "no_proxy" ] && continue
+        [ "${var}" = "NO_PROXY" ] && continue
+
         bbwarn "Export of '${line}' detected, please migrate to templates"
     done
 
@@ -59,6 +68,11 @@ dpkg_runbuild() {
 
     export SBUILD_CONFIG="${SBUILD_CONFIG}"
 
+    for envvar in http_proxy HTTP_PROXY https_proxy HTTPS_PROXY \
+        ftp_proxy FTP_PROXY no_proxy NO_PROXY; do
+        sbuild_add_env_filter "$envvar"
+    done
+
     echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG}
 
     # Create a .dsc file from source directory to use it with sbuild
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index f7c93bbe..7a732da5 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -99,16 +99,33 @@ schroot_delete_configs() {
 EOSUDO
 }
 
+sbuild_add_env_filter() {
+    [ -w ${SBUILD_CONFIG} ] || touch ${SBUILD_CONFIG}
+
+    if ! grep -q "^\$environment_filter =" ${SBUILD_CONFIG}; then
+        echo "\$environment_filter = [" >> ${SBUILD_CONFIG}
+        echo "];" >> ${SBUILD_CONFIG}
+    fi
+
+    FILTER=${1}
+
+    sed -i -e "/'\^${FILTER}\\$/d" \
+        -e "/^\$environment_filter =.*/a '^${FILTER}\$'," ${SBUILD_CONFIG}
+}
+
 sbuild_export() {
-    VAR=${1}; shift
-    VAR_LINE="'${VAR}' => '${@}',"
-    if [ -s "${SBUILD_CONFIG}" ]; then
-        sed -i -e "\$i\\" -e "${VAR_LINE}" ${SBUILD_CONFIG}
-    else
-        echo "\$build_environment = {" > ${SBUILD_CONFIG}
-        echo "${VAR_LINE}" >> ${SBUILD_CONFIG}
+    [ -w ${SBUILD_CONFIG} ] || touch ${SBUILD_CONFIG}
+
+    if ! grep -q "^\$build_environment =" ${SBUILD_CONFIG}; then
+        echo "\$build_environment = {" >> ${SBUILD_CONFIG}
         echo "};" >> ${SBUILD_CONFIG}
     fi
+
+    VAR=${1}; shift
+    VAR_LINE="'${VAR}' => '${@}',"
+
+    sed -i -e "/^'${VAR}' =>/d" ${SBUILD_CONFIG} \
+        -e "/^\$build_environment =.*/a ${VAR_LINE}" ${SBUILD_CONFIG}
 }
 
 schroot_install() {
-- 
2.20.1


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

* [PATCH v8 15/16] sbuild: Fix debsrc_download for packages dependencies
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (13 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 14/16] sbuild: Fixed proxy support Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-03-17  4:50 ` [PATCH v8 16/16] fix: support build of packages with epoch version Uladzimir Bely
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

With sbuild, build deps are internally installed in temporary sbuild
environment,so they don't appear in any external dpkg.log files.

With "cache-deb-src" base repo feature enabled, these such packages
are considered not to belong to current build, so their src packages
are not downloaded at image postprocess stage.

The patch fixes this by extracting dpkg.log files from the sbuild
environment to one common log file. This consolidated log is then
used at rootfs_postprocess to get source packages.

Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
---
 meta/classes/deb-dl-dir.bbclass | 4 ++++
 meta/classes/dpkg.bbclass       | 6 +++++-
 meta/classes/sbuild.bbclass     | 9 +++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index f49f1c2a..484fda69 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -14,6 +14,10 @@ is_not_part_of_current_build() {
     # build using the below method.
     local output="$( grep -hs "status installed ${package}:${arch} ${version}" \
             "${IMAGE_ROOTFS}"/var/log/dpkg.log \
+            "${SCHROOT_HOST_DIR}"/var/log/dpkg.log \
+            "${SCHROOT_TARGET_DIR}"/var/log/dpkg.log \
+            "${SCHROOT_HOST_DIR}"/tmp/dpkg_common.log \
+            "${SCHROOT_TARGET_DIR}"/tmp/dpkg_common.log \
             "${BUILDCHROOT_HOST_DIR}"/var/log/dpkg.log \
             "${BUILDCHROOT_TARGET_DIR}"/var/log/dpkg.log | head -1 )"
 
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 126a4ee4..9b9de236 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -55,7 +55,8 @@ dpkg_runbuild() {
     deb_dl_dir_import "${WORKDIR}/rootfs" "${distro}"
 
     deb_dir="/var/cache/apt/archives/"
-    ext_deb_dir="/home/builder/${PN}/rootfs/${deb_dir}"
+    ext_root="/home/builder/${PN}/rootfs"
+    ext_deb_dir="${ext_root}/${deb_dir}"
 
     if [ ${USE_CCACHE} -eq 1 ]; then
         schroot_configure_ccache
@@ -82,11 +83,14 @@ dpkg_runbuild() {
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
         --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
         --no-run-lintian --no-run-piuparts --no-run-autopkgtest \
+        --chroot-setup-commands="rm -f /var/log/dpkg.log" \
         --chroot-setup-commands="cp -n --no-preserve=owner ${ext_deb_dir}/*.deb -t ${deb_dir}/ || :" \
         --finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
         --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
+        --finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \
         --debbuildopts="--source-option=-I" \
         --build-dir=${WORKDIR} --dist="isar" ${WORKDIR}/${DSC}
 
+    sbuild_dpkg_log_export "${WORKDIR}/rootfs/dpkg_partial.log"
     deb_dl_dir_export "${WORKDIR}/rootfs" "${distro}"
 }
diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass
index 7a732da5..760a0203 100644
--- a/meta/classes/sbuild.bbclass
+++ b/meta/classes/sbuild.bbclass
@@ -200,3 +200,12 @@ END
         echo "command-prefix=/ccache/sbuild-setup" >> "${SCHROOT_CONF_FILE}"
 EOSUDO
 }
+
+sbuild_dpkg_log_export() {
+    export dpkg_partial_log="${1}"
+
+    ( flock 9
+    set -e
+    cat ${dpkg_partial_log} >> ${SCHROOT_DIR}/tmp/dpkg_common.log
+    )  9>"${SCHROOT_DIR}/tmp/dpkg_common.log.lock"
+}
-- 
2.20.1


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

* [PATCH v8 16/16] fix: support build of packages with epoch version
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (14 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 15/16] sbuild: Fix debsrc_download for packages dependencies Uladzimir Bely
@ 2022-03-17  4:50 ` Uladzimir Bely
  2022-04-07  9:32 ` [PATCH v8 00/16] Sbuild/Schroot migration Anton Mikanovich
  2022-05-04  8:56 ` Anton Mikanovich
  17 siblings, 0 replies; 22+ messages in thread
From: Uladzimir Bely @ 2022-03-17  4:50 UTC (permalink / raw)
  To: isar-users

From: Felix Moessbauer <felix.moessbauer@siemens.com>

This patch reworks the logic how the DSC file for building
with sbuild is located.
By that, we do not rely on implementation details of dpkg-source
regarding the name of the generated .dsc file.
Instead, we remove all <package>*.dsc files in advance, let dpkg-source
generate the file and use a find to locate the generated one.

By that, package versions with epochs (e.g. "1:1.0.0") are
supported.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes/dpkg.bbclass | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 9b9de236..e4d9519f 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -77,8 +77,10 @@ dpkg_runbuild() {
     echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG}
 
     # Create a .dsc file from source directory to use it with sbuild
+    DEB_SOURCE_NAME=$(dpkg-parsechangelog --show-field Source --file ${WORKDIR}/${PPS}/debian/changelog)
+    find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -delete
     sh -c "cd ${WORKDIR}; dpkg-source -q -b ${PPS}"
-    DSC=$(head -n1 ${WORKDIR}/${PPS}/debian/changelog | awk '{gsub(/[()]/,""); printf "%s_%s.dsc", $1, $2}')
+    DSC_FILE=$(find ${WORKDIR} -name "${DEB_SOURCE_NAME}*.dsc" -print)
 
     sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \
         --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} ${profiles} \
@@ -89,7 +91,7 @@ dpkg_runbuild() {
         --finished-build-commands="cp -n --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
         --finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \
         --debbuildopts="--source-option=-I" \
-        --build-dir=${WORKDIR} --dist="isar" ${WORKDIR}/${DSC}
+        --build-dir=${WORKDIR} --dist="isar" ${DSC_FILE}
 
     sbuild_dpkg_log_export "${WORKDIR}/rootfs/dpkg_partial.log"
     deb_dl_dir_export "${WORKDIR}/rootfs" "${distro}"
-- 
2.20.1


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

* RE: [PATCH v8 04/16] sbuild: Introduce a class for another build method
  2022-03-17  4:50 ` [PATCH v8 04/16] sbuild: Introduce a class for another build method Uladzimir Bely
@ 2022-03-17 15:31   ` Moessbauer, Felix
  0 siblings, 0 replies; 22+ messages in thread
From: Moessbauer, Felix @ 2022-03-17 15:31 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users, jan.kiszka

Hi,

> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Uladzimir Bely
> Sent: Thursday, March 17, 2022 5:50 AM
> To: isar-users@googlegroups.com
> Subject: [PATCH v8 04/16] sbuild: Introduce a class for another build method
> 
> This also adds mounts for base-apt inside schroot and adds import/export deb
> files to/from schroot. So that it becomes possible to run second  `cached` build
> from local base-apt repo.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  meta/classes/sbuild.bbclass | 160 ++++++++++++++++++++++++++++++++++++
>  meta/conf/bitbake.conf      |   2 +
>  2 files changed, 162 insertions(+)
>  create mode 100644 meta/classes/sbuild.bbclass
> 
> diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass new file
> mode 100644 index 00000000..e4341a6f
> --- /dev/null
> +++ b/meta/classes/sbuild.bbclass
> @@ -0,0 +1,160 @@
> +# This software is a part of ISAR.
> +# Copyright (C) 2021 ilbers GmbH
> +
> +SCHROOT_CONF ?= "/etc/schroot"
> +
> +SCHROOT_MOUNTS ?= ""
> +
> +python __anonymous() {
> +    import pwd
> +    d.setVar('SCHROOT_USER', pwd.getpwuid(os.geteuid()).pw_name)
> +    d.setVar('SCHROOT_USER_HOME', pwd.getpwuid(os.geteuid()).pw_dir)
> +
> +    mode = d.getVar('ISAR_CROSS_COMPILE', True)
> +    distro_arch = d.getVar('DISTRO_ARCH')
> +    if mode == "0" or d.getVar('HOST_ARCH') ==  distro_arch or \
> +       (d.getVar('HOST_DISTRO') == "debian-stretch" and distro_arch == "i386"):
> +        d.setVar('SBUILD_HOST_ARCH', distro_arch)
> +        d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_TARGET_DIR'))
> +        dep = "sbuild-chroot-target:do_build"
> +    else:
> +        d.setVar('SBUILD_HOST_ARCH', d.getVar('HOST_ARCH'))
> +        d.setVar('SCHROOT_DIR', d.getVar('SCHROOT_HOST_DIR'))
> +        dep = "sbuild-chroot-host:do_build"
> +    d.setVar('SCHROOT_DEP', dep)
> +}
> +
> +SBUILD_CHROOT ?= "${DEBDISTRONAME}-${SCHROOT_USER}-
> ${@os.getpid()}"
> +SBUILD_CHROOT_RW ?= "${SBUILD_CHROOT}-rw"
> +
> +SBUILD_CONF_DIR ?= "${SCHROOT_CONF}/${SBUILD_CHROOT}"
> +SCHROOT_CONF_FILE ?= "${SCHROOT_CONF}/chroot.d/${SBUILD_CHROOT}"
> +SCHROOT_CONF_FILE_RW ?=
> "${SCHROOT_CONF}/chroot.d/${SBUILD_CHROOT}-rw"
> +
> +schroot_create_configs() {

Can we split this function into at least one per target file?
Having this large "cat" here is hard to maintain.

> +    sudo -s <<'EOSUDO'
> +        set -e
> +
> +        cat << EOF > "${SCHROOT_CONF_FILE}"
> +[${SBUILD_CHROOT}]
> +type=directory
> +directory=${SCHROOT_DIR}
> +profile=${SBUILD_CHROOT}
> +users=${SCHROOT_USER}
> +groups=root,sbuild
> +root-users=${SCHROOT_USER}
> +root-groups=root,sbuild
> +source-root-users=${SCHROOT_USER}
> +source-root-groups=root,sbuild
> +union-type=overlay
> +preserve-environment=true
> +EOF
> +
> +        cat << EOF > "${SCHROOT_CONF_FILE_RW}"
> +[${SBUILD_CHROOT_RW}]
> +type=directory
> +directory=${SCHROOT_DIR}
> +profile=${SBUILD_CHROOT}
> +users=${SCHROOT_USER}
> +groups=root,sbuild
> +root-users=${SCHROOT_USER}
> +root-groups=root,sbuild
> +preserve-environment=true
> +EOF
> +
> +        mkdir -p "${SCHROOT_DIR}/etc/apt/preferences.d"
> +        cat << EOF > "${SCHROOT_DIR}/etc/apt/preferences.d/isar-apt"

Outside sbuild, we have some other apt preferences that are relevant as well.
An example is the apt-retry patch, added in d349b76140482997a595ef33da6407e041113a8f

We should either duplicate them here, or better copy from buildchroot.

Felix

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

* Re: [PATCH v8 00/16] Sbuild/Schroot migration
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (15 preceding siblings ...)
  2022-03-17  4:50 ` [PATCH v8 16/16] fix: support build of packages with epoch version Uladzimir Bely
@ 2022-04-07  9:32 ` Anton Mikanovich
  2022-04-07 10:15   ` Moessbauer, Felix
  2022-05-04  8:56 ` Anton Mikanovich
  17 siblings, 1 reply; 22+ messages in thread
From: Anton Mikanovich @ 2022-04-07  9:32 UTC (permalink / raw)
  To: isar-users, Uladzimir Bely

17.03.2022 07:50, Uladzimir Bely wrote:
> This is a patchset showing how sbuild/schroot tools can be integrated
> into Isar build system.
>
> Base schroot images are created with sbuild-chroot-target or, in case
> of cross-build, sbuild-chroot-host recipes. These images are based on
> isar-bootstrap ones, but include some build-related stuff preinstalled.
>
> To use these changes you need to have sbuild and schroot installed and
> configured. User who runs build should be added to sbuild group.
>
> Currently, sbuild-related stuff is supported in latest kas.
>
> If Gilab CI is used, the following configuration changes are required:
> - external dir for schroot overlay should be set in the config
> /etc/gitlab-runner/config.toml:
>
> volumes = ["/path/to/overlay:/var/lib/schroot/union/overlay"]
>
> The patchset was tested with 'meta-iot2050' and 'xenomai-images'
> downstreams in combination with kas image mentioned above.
>
> Current limitations:
> - parallel building of several packages requires more free space in
> comparison with buildchroot-based architecture. This happens due
> the sbuild architecture which uses some basic layer (common for all
> packages) and per-package separate layer (where builddeps are downloaded
> and installed).
>
>
> Changes since v8:
> - Added patch with support of package versions with epochs
>
> Changes since v7:
> - fixed work with proxy by adding some environment filters in sbuild;
> - DEB_BUILD_PROFILES support simplified and improved
> - Fixed gbp-based recipes rebuilding (get back --git-ignore-new option
> previously removed)
> - fixed base-apt caching for packages and source packages temporary
> installed in sbuild isolated environment
> - fixed rare build error related to ccache setup (added locking)
>
> Changes since v6:
> - added patch that switches sbuild from using source directory to using
> .dsc file. The file is generated before sbuild call by `dpkg-source`.
>
> Changes since v5:
> - warning about shell exports in dpkg_runbuild_prepend. This should
> avoided be reworked to templates.
>
> Changes since v4:
> - consider shell exports done in dpkg_runbuild_prepend and pass them
> to sbuild environment;
> - fixed ccache work.
>
> Changes since v3:
> - dpkg_do_mounts() and dpkg_undo_mounts() are not removed for downstreams
> compatibility;
> - dpkg_build_export is used for adjusting sbuild environment;
> - DEB_BUILD_PROFILES support for sbuild is fixed in case of cross-build.
>
> Changes since v2:
> - patches reworked/squashed for easier reading and understanding;
> - fixed building foreigh architectures with kas-docker;
> - implemented support of ccache;
> - fixed devshell and devshell_nodeps.
>
> Changes since v1:
> - parallel builds with different BUILD_DIR are supported;
> - parallel multiconfig targets in one build are supported;
> - per-task schroot configuration in /etc/schroot/ is now used;
> - patchset now passes Jenkins CI (so patches changes RFC => PATCH).
>
>
> Anton Mikanovich (1):
>    dpkg: Build packages with sbuild
>
> Felix Moessbauer (1):
>    fix: support build of packages with epoch version
>
> Uladzimir Bely (14):
>    dpkg-gbp: Use separate command to export tarball
>    dpkg-gbp: Use host tools for dsc preparation
>    sbuild: Add recipes for host and target rootfs to run sbuild
>    sbuild: Introduce a class for another build method
>    sbuild: Support of DEB_BUILD_PROFILES
>    sbuild: Support of shell exports from dpkg_runbuild_prepend
>    dpkg: Remove builddeps install task.
>    sbuild: Add ccache support
>    dpkg-base: Switch devshell to use schroot
>    dpkg-base: Switch apt_fetch and apt_unpack to use schroot
>    doc: Add sbuild-related documentation
>    sbuild: Use .dsc file instead of source directory.
>    sbuild: Fixed proxy support
>    sbuild: Fix debsrc_download for packages dependencies
>
>   doc/user_manual.md                            |  22 +-
>   meta/classes/deb-dl-dir.bbclass               |   4 +
>   meta/classes/dpkg-base.bbclass                |  78 ++++---
>   meta/classes/dpkg-gbp.bbclass                 |  26 +--
>   meta/classes/dpkg.bbclass                     | 106 ++++++---
>   meta/classes/sbuild.bbclass                   | 211 ++++++++++++++++++
>   meta/conf/bitbake.conf                        |   2 +
>   .../sbuild-chroot/sbuild-chroot-host.bb       |  13 ++
>   .../sbuild-chroot/sbuild-chroot-target.bb     |  10 +
>   .../sbuild-chroot/sbuild-chroot.inc           |  39 ++++
>   10 files changed, 430 insertions(+), 81 deletions(-)
>   create mode 100644 meta/classes/sbuild.bbclass
>   create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
>   create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
>   create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc

Just remind we are going to merge Sbuild implementation in new weeks.
Please prepare and check downstreams.


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

* RE: [PATCH v8 00/16] Sbuild/Schroot migration
  2022-04-07  9:32 ` [PATCH v8 00/16] Sbuild/Schroot migration Anton Mikanovich
@ 2022-04-07 10:15   ` Moessbauer, Felix
  0 siblings, 0 replies; 22+ messages in thread
From: Moessbauer, Felix @ 2022-04-07 10:15 UTC (permalink / raw)
  To: Anton Mikanovich; +Cc: jan.kiszka, isar-users

[-- Attachment #1: Type: text/plain, Size: 6020 bytes --]

> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Anton Mikanovich
> Sent: Thursday, April 7, 2022 11:32 AM
> To: isar-users@googlegroups.com; Uladzimir Bely <ubely@ilbers.de>
> Subject: Re: [PATCH v8 00/16] Sbuild/Schroot migration
> 
> 17.03.2022 07:50, Uladzimir Bely wrote:
> > This is a patchset showing how sbuild/schroot tools can be integrated
> > into Isar build system.
> >
> > Base schroot images are created with sbuild-chroot-target or, in case
> > of cross-build, sbuild-chroot-host recipes. These images are based on
> > isar-bootstrap ones, but include some build-related stuff preinstalled.
> >
> > To use these changes you need to have sbuild and schroot installed and
> > configured. User who runs build should be added to sbuild group.
> >
> > Currently, sbuild-related stuff is supported in latest kas.
> >
> > If Gilab CI is used, the following configuration changes are required:
> > - external dir for schroot overlay should be set in the config
> > /etc/gitlab-runner/config.toml:
> >
> > volumes = ["/path/to/overlay:/var/lib/schroot/union/overlay"]
> >
> > The patchset was tested with 'meta-iot2050' and 'xenomai-images'
> > downstreams in combination with kas image mentioned above.
> >
> > Current limitations:
> > - parallel building of several packages requires more free space in
> > comparison with buildchroot-based architecture. This happens due the
> > sbuild architecture which uses some basic layer (common for all
> > packages) and per-package separate layer (where builddeps are
> > downloaded and installed).
> >
> >
> > Changes since v8:
> > - Added patch with support of package versions with epochs
> >
> > Changes since v7:
> > - fixed work with proxy by adding some environment filters in sbuild;
> > - DEB_BUILD_PROFILES support simplified and improved
> > - Fixed gbp-based recipes rebuilding (get back --git-ignore-new option
> > previously removed)
> > - fixed base-apt caching for packages and source packages temporary
> > installed in sbuild isolated environment
> > - fixed rare build error related to ccache setup (added locking)
> >
> > Changes since v6:
> > - added patch that switches sbuild from using source directory to
> > using .dsc file. The file is generated before sbuild call by `dpkg-source`.
> >
> > Changes since v5:
> > - warning about shell exports in dpkg_runbuild_prepend. This should
> > avoided be reworked to templates.
> >
> > Changes since v4:
> > - consider shell exports done in dpkg_runbuild_prepend and pass them
> > to sbuild environment;
> > - fixed ccache work.
> >
> > Changes since v3:
> > - dpkg_do_mounts() and dpkg_undo_mounts() are not removed for
> > downstreams compatibility;
> > - dpkg_build_export is used for adjusting sbuild environment;
> > - DEB_BUILD_PROFILES support for sbuild is fixed in case of cross-build.
> >
> > Changes since v2:
> > - patches reworked/squashed for easier reading and understanding;
> > - fixed building foreigh architectures with kas-docker;
> > - implemented support of ccache;
> > - fixed devshell and devshell_nodeps.
> >
> > Changes since v1:
> > - parallel builds with different BUILD_DIR are supported;
> > - parallel multiconfig targets in one build are supported;
> > - per-task schroot configuration in /etc/schroot/ is now used;
> > - patchset now passes Jenkins CI (so patches changes RFC => PATCH).
> >
> >
> > Anton Mikanovich (1):
> >    dpkg: Build packages with sbuild
> >
> > Felix Moessbauer (1):
> >    fix: support build of packages with epoch version
> >
> > Uladzimir Bely (14):
> >    dpkg-gbp: Use separate command to export tarball
> >    dpkg-gbp: Use host tools for dsc preparation
> >    sbuild: Add recipes for host and target rootfs to run sbuild
> >    sbuild: Introduce a class for another build method
> >    sbuild: Support of DEB_BUILD_PROFILES
> >    sbuild: Support of shell exports from dpkg_runbuild_prepend
> >    dpkg: Remove builddeps install task.
> >    sbuild: Add ccache support
> >    dpkg-base: Switch devshell to use schroot
> >    dpkg-base: Switch apt_fetch and apt_unpack to use schroot
> >    doc: Add sbuild-related documentation
> >    sbuild: Use .dsc file instead of source directory.
> >    sbuild: Fixed proxy support
> >    sbuild: Fix debsrc_download for packages dependencies
> >
> >   doc/user_manual.md                            |  22 +-
> >   meta/classes/deb-dl-dir.bbclass               |   4 +
> >   meta/classes/dpkg-base.bbclass                |  78 ++++---
> >   meta/classes/dpkg-gbp.bbclass                 |  26 +--
> >   meta/classes/dpkg.bbclass                     | 106 ++++++---
> >   meta/classes/sbuild.bbclass                   | 211 ++++++++++++++++++
> >   meta/conf/bitbake.conf                        |   2 +
> >   .../sbuild-chroot/sbuild-chroot-host.bb       |  13 ++
> >   .../sbuild-chroot/sbuild-chroot-target.bb     |  10 +
> >   .../sbuild-chroot/sbuild-chroot.inc           |  39 ++++
> >   10 files changed, 430 insertions(+), 81 deletions(-)
> >   create mode 100644 meta/classes/sbuild.bbclass
> >   create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-
> host.bb
> >   create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-
> target.bb
> >   create mode 100644
> > meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> 
> Just remind we are going to merge Sbuild implementation in new weeks.
> Please prepare and check downstreams.

We are still hunting a nasty bug which happens when you combine sbuild and sstate cache.
In some scenarios we observe that the $PN/rootfs mountpoint is lost during the sbuild process.

This is likely a race condition, but I was not able to find it (yet).
Help would be appreciated.

Attached you will find a log.

Felix

> 
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.

[-- Attachment #2: log.do_dpkg_build.1656 --]
[-- Type: application/octet-stream, Size: 52398 bytes --]

DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing python function do_dpkg_build
DEBUG: Executing shell function schroot_create_configs
DEBUG: Shell function schroot_create_configs finished
DEBUG: Executing shell function dpkg_runbuild
gbp:info: Performing the build
sbuild (Debian sbuild) 0.81.2 (31 January 2021) on runner-mupgttyp-project-130787-concurrent-0qnh4s

+==============================================================================+
| linux-base 4.9 (amd64)                       Wed, 06 Apr 2022 12:46:25 +0000 |
+==============================================================================+

Package: linux-base
Version: 4.9
Source Version: 4.9
Distribution: isar
Machine Architecture: amd64
Host Architecture: amd64
Build Architecture: amd64
Build Type: binary

I: NOTICE: Log filtering will replace 'var/run/schroot/mount/isar-builder-1656-60aab342-3e22-4d01-a838-54067fb6e98d' with '<<CHROOT>>'

+------------------------------------------------------------------------------+
| Chroot Setup Commands                                                        |
+------------------------------------------------------------------------------+


rm -f /var/log/dpkg.log
-----------------------


I: Finished running 'rm -f /var/log/dpkg.log'.

cp -n --no-preserve=owner /home/builder/linux-base/rootfs//var/cache/apt/archives//*.deb -t /var/cache/apt/archives// || :
--------------------------------------------------------------------------------------------------------------------------

cp: cannot stat '/home/builder/linux-base/rootfs//var/cache/apt/archives//*.deb': No such file or directory

I: Finished running 'cp -n --no-preserve=owner /home/builder/linux-base/rootfs//var/cache/apt/archives//*.deb -t /var/cache/apt/archives// || :'.

Finished processing commands.
--------------------------------------------------------------------------------
I: NOTICE: Log filtering will replace 'build/linux-base-Dj4POm/resolver-4CLslP' with '<<RESOLVERDIR>>'

+------------------------------------------------------------------------------+
| Update chroot                                                                |
+------------------------------------------------------------------------------+

Get:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Ign:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Ign:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Hit:4 https://debian.inf.tu-dresden.de/debian bullseye InRelease
Hit:5 https://debian.inf.tu-dresden.de/debian-security bullseye-security InRelease
Get:6 https://debian.inf.tu-dresden.de/debian bullseye-updates InRelease [39.4 kB]
Get:7 https://debian.inf.tu-dresden.de/debian bullseye-backports InRelease [44.2 kB]
Get:8 https://debian.inf.tu-dresden.de/debian bullseye-backports/main Sources.diff/Index [63.3 kB]
Get:9 https://debian.inf.tu-dresden.de/debian bullseye-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:10 https://debian.inf.tu-dresden.de/debian bullseye-backports/main Sources T-2022-04-05-0207.37-F-2022-04-04-2007.19.pdiff [95 B]
Get:10 https://debian.inf.tu-dresden.de/debian bullseye-backports/main Sources T-2022-04-05-0207.37-F-2022-04-04-2007.19.pdiff [95 B]
Get:11 https://debian.inf.tu-dresden.de/debian bullseye-backports/main amd64 Packages T-2022-04-04-2007.19-F-2022-04-04-2007.19.pdiff [541 B]
Get:11 https://debian.inf.tu-dresden.de/debian bullseye-backports/main amd64 Packages T-2022-04-04-2007.19-F-2022-04-04-2007.19.pdiff [541 B]
Fetched 211 kB in 1s (281 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

+------------------------------------------------------------------------------+
| Fetch source files                                                           |
+------------------------------------------------------------------------------+


Local sources
-------------

/builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0/linux-base_4.9.dsc exists in /builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0; copying to chroot
I: NOTICE: Log filtering will replace 'build/linux-base-Dj4POm/linux-base-4.9' with '<<PKGBUILDDIR>>'
I: NOTICE: Log filtering will replace 'build/linux-base-Dj4POm' with '<<BUILDDIR>>'

+------------------------------------------------------------------------------+
| Install package build dependencies                                           |
+------------------------------------------------------------------------------+


Setup apt archive
-----------------

Merged Build-Depends: debhelper-compat (= 13), bash-completion, libtext-glob-perl, po4a, build-essential, fakeroot
Filtered Build-Depends: debhelper-compat (= 13), bash-completion, libtext-glob-perl, po4a, build-essential, fakeroot
dpkg-deb: building package 'sbuild-build-depends-main-dummy' in '/<<RESOLVERDIR>>/apt_archive/sbuild-build-depends-main-dummy.deb'.
Ign:1 copy:/<<RESOLVERDIR>>/apt_archive ./ InRelease
Get:2 copy:/<<RESOLVERDIR>>/apt_archive ./ Release [957 B]
Ign:3 copy:/<<RESOLVERDIR>>/apt_archive ./ Release.gpg
Get:4 copy:/<<RESOLVERDIR>>/apt_archive ./ Sources [403 B]
Get:5 copy:/<<RESOLVERDIR>>/apt_archive ./ Packages [477 B]
Fetched 1837 B in 0s (0 B/s)
Reading package lists...
Get:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Ign:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Ign:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Reading package lists...
Reading package lists...

Install main build dependencies (apt-based resolver)
----------------------------------------------------

Installing build dependencies
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  bash-completion libosp5 libpod-parser-perl libsgmls-perl libtext-glob-perl
  libyaml-tiny-perl opensp po4a sgml-base
Suggested packages:
  sgmlspl sgmls-doc doc-base sgml-data sgml-base-doc
Recommended packages:
  liblocale-gettext-perl libterm-readkey-perl libtext-wrapi18n-perl
  libunicode-linebreak-perl
The following NEW packages will be installed:
  bash-completion libosp5 libpod-parser-perl libsgmls-perl libtext-glob-perl
  libyaml-tiny-perl opensp po4a sbuild-build-depends-main-dummy sgml-base
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 3565 kB of archives.
After this operation, 8490 kB of additional disk space will be used.
Get:1 copy:/<<RESOLVERDIR>>/apt_archive ./ sbuild-build-depends-main-dummy 0.invalid.0 [904 B]
Get:2 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 sgml-base all 1.30 [15.1 kB]
Get:3 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 bash-completion all 1:2.11-2 [234 kB]
Get:4 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libosp5 amd64 1.5.2-13+b2 [934 kB]
Get:5 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libpod-parser-perl all 1.63-2 [96.1 kB]
Get:6 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libsgmls-perl all 1.03ii-36 [26.5 kB]
Get:7 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libtext-glob-perl all 0.11-1 [8888 B]
Get:8 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libyaml-tiny-perl all 1.73-1 [32.3 kB]
Get:9 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 opensp amd64 1.5.2-13+b2 [421 kB]
Get:10 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 po4a all 0.62-1 [1796 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 3565 kB in 0s (10.4 MB/s)
Selecting previously unselected package sgml-base.
(Reading database ... 17618 files and directories currently installed.)
Preparing to unpack .../0-sgml-base_1.30_all.deb ...
Unpacking sgml-base (1.30) ...
Selecting previously unselected package bash-completion.
Preparing to unpack .../1-bash-completion_1%3a2.11-2_all.deb ...
Unpacking bash-completion (1:2.11-2) ...
Selecting previously unselected package libosp5.
Preparing to unpack .../2-libosp5_1.5.2-13+b2_amd64.deb ...
Unpacking libosp5 (1.5.2-13+b2) ...
Selecting previously unselected package libpod-parser-perl.
Preparing to unpack .../3-libpod-parser-perl_1.63-2_all.deb ...
Adding 'diversion of /usr/bin/podselect to /usr/bin/podselect.bundled by libpod-parser-perl'
Adding 'diversion of /usr/share/man/man1/podselect.1.gz to /usr/share/man/man1/podselect.bundled.1.gz by libpod-parser-perl'
Unpacking libpod-parser-perl (1.63-2) ...
Selecting previously unselected package libsgmls-perl.
Preparing to unpack .../4-libsgmls-perl_1.03ii-36_all.deb ...
Unpacking libsgmls-perl (1.03ii-36) ...
Selecting previously unselected package libtext-glob-perl.
Preparing to unpack .../5-libtext-glob-perl_0.11-1_all.deb ...
Unpacking libtext-glob-perl (0.11-1) ...
Selecting previously unselected package libyaml-tiny-perl.
Preparing to unpack .../6-libyaml-tiny-perl_1.73-1_all.deb ...
Unpacking libyaml-tiny-perl (1.73-1) ...
Selecting previously unselected package opensp.
Preparing to unpack .../7-opensp_1.5.2-13+b2_amd64.deb ...
Unpacking opensp (1.5.2-13+b2) ...
Selecting previously unselected package po4a.
Preparing to unpack .../8-po4a_0.62-1_all.deb ...
Unpacking po4a (0.62-1) ...
Selecting previously unselected package sbuild-build-depends-main-dummy.
Preparing to unpack .../9-sbuild-build-depends-main-dummy_0.invalid.0_amd64.deb ...
Unpacking sbuild-build-depends-main-dummy (0.invalid.0) ...
Setting up libsgmls-perl (1.03ii-36) ...
Setting up libtext-glob-perl (0.11-1) ...
Setting up libyaml-tiny-perl (1.73-1) ...
Setting up libosp5 (1.5.2-13+b2) ...
Setting up bash-completion (1:2.11-2) ...
Setting up libpod-parser-perl (1.63-2) ...
Setting up sgml-base (1.30) ...
Setting up opensp (1.5.2-13+b2) ...
Setting up po4a (0.62-1) ...
Setting up sbuild-build-depends-main-dummy (0.invalid.0) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...

+------------------------------------------------------------------------------+
| Check architectures                                                          |
+------------------------------------------------------------------------------+

Arch check ok (amd64 included in all)

+------------------------------------------------------------------------------+
| Build environment                                                            |
+------------------------------------------------------------------------------+

Kernel: Linux 5.11.0-1028-aws #31~20.04.1-Ubuntu SMP Fri Jan 14 14:37:50 UTC 2022 amd64 (x86_64)
Toolchain package versions: binutils_2.35.2-2 dpkg-dev_1.20.9 g++-10_10.2.1-6 gcc-10_10.2.1-6 libc6-dev_2.31-13+deb11u3 libstdc++-10-dev_10.2.1-6 libstdc++6_10.2.1-6 linux-libc-dev_5.10.106-1
Package versions: adduser_3.118 apt_2.2.4 autoconf_2.69-14 automake_1:1.16.3-2 autopoint_0.21-4 autotools-dev_20180224.1+nmu1 base-files_11.1+deb11u3 base-passwd_3.5.51 bash_5.1-2+b3 bash-completion_1:2.11-2 binutils_2.35.2-2 binutils-common_2.35.2-2 binutils-x86-64-linux-gnu_2.35.2-2 bsdextrautils_2.36.1-8+deb11u1 bsdutils_1:2.36.1-8+deb11u1 build-essential_12.9 bzip2_1.0.8-4 ca-certificates_20210119 ccache_4.2-1 coreutils_8.32-4+b1 cpp_4:10.2.1-1 cpp-10_10.2.1-6 dash_0.5.11+git20200708+dd9ef66-5 debconf_1.5.77 debhelper_13.3.4 debian-archive-keyring_2021.1.1 debianutils_4.11.2 devscripts_2.21.3+deb11u1 dh-autoreconf_20 dh-strip-nondeterminism_1.12.0-1 diffutils_1:3.7-5 dirmngr_2.2.27-2+deb11u1 dpkg_1.20.9 dpkg-dev_1.20.9 dwz_0.13+20210201-1 e2fsprogs_1.46.2-2 equivs_2.3.1 fakeroot_1.25.3-1.1 file_1:5.39-3 findutils_4.8.0-1 g++_4:10.2.1-1 g++-10_10.2.1-6 gcc_4:10.2.1-1 gcc-10_10.2.1-6 gcc-10-base_10.2.1-6 gcc-9-base_9.3.0-22 gettext_0.21-4 gettext-base_0.21-4 gnupg_2.2.27-2+deb11u1 gnupg-l10n_2.2.27-2+deb11u1 gnupg-utils_2.2.27-2+deb11u1 gpg_2.2.27-2+deb11u1 gpg-agent_2.2.27-2+deb11u1 gpg-wks-client_2.2.27-2+deb11u1 gpg-wks-server_2.2.27-2+deb11u1 gpgconf_2.2.27-2+deb11u1 gpgsm_2.2.27-2+deb11u1 gpgv_2.2.27-2+deb11u1 grep_3.6-1 groff-base_1.22.4-6 gzip_1.10-4 hostname_3.23 init-system-helpers_1.60 intltool-debian_0.35.0+20060710.5 libacl1_2.2.53-10 libapt-pkg6.0_2.2.4 libarchive-zip-perl_1.68-1 libasan6_10.2.1-6 libassuan0_2.5.3-7.1 libatomic1_10.2.1-6 libattr1_1:2.4.48-6 libaudit-common_1:3.0-2 libaudit1_1:3.0-2 libb-hooks-op-check-perl_0.22-1+b3 libbinutils_2.35.2-2 libblkid1_2.36.1-8+deb11u1 libbz2-1.0_1.0.8-4 libc-bin_2.31-13+deb11u3 libc-dev-bin_2.31-13+deb11u3 libc-l10n_2.31-13+deb11u3 libc6_2.31-13+deb11u3 libc6-dev_2.31-13+deb11u3 libcap-ng0_0.7.9-2.2+b1 libcc1-0_10.2.1-6 libclass-method-modifiers-perl_2.13-1 libcom-err2_1.46.2-2 libcrypt-dev_1:4.4.18-4 libcrypt1_1:4.4.18-4 libctf-nobfd0_2.35.2-2 libctf0_2.35.2-2 libdb5.3_5.3.28+dfsg1-0.8 libdebconfclient0_0.260 libdebhelper-perl_13.3.4 libdevel-callchecker-perl_0.008-1+b2 libdpkg-perl_1.20.9 libdynaloader-functions-perl_0.003-1.1 libelf1_0.183-1 libencode-locale-perl_1.05-1.1 libexpat1_2.2.10-2+deb11u3 libext2fs2_1.46.2-2 libfakeroot_1.25.3-1.1 libffi7_3.3-6 libfile-dirlist-perl_0.05-2 libfile-homedir-perl_1.006-1 libfile-listing-perl_6.14-1 libfile-stripnondeterminism-perl_1.12.0-1 libfile-touch-perl_0.11-1 libfile-which-perl_1.23-1 libgcc-10-dev_10.2.1-6 libgcc-s1_10.2.1-6 libgcrypt20_1.8.7-6 libgdbm-compat4_1.19-2 libgdbm6_1.19-2 libgmp10_2:6.2.1+dfsg-1+deb11u1 libgnutls30_3.7.1-5 libgomp1_10.2.1-6 libgpg-error0_1.38-2 libgssapi-krb5-2_1.18.3-6+deb11u1 libhogweed6_3.7.3-1 libhtml-parser-perl_3.75-1+b1 libhtml-tagset-perl_3.20-4 libhtml-tree-perl_5.07-2 libhttp-cookies-perl_6.10-1 libhttp-date-perl_6.05-1 libhttp-message-perl_6.28-1 libhttp-negotiate-perl_6.01-1 libicu67_67.1-7 libidn2-0_2.3.0-5 libimport-into-perl_1.002005-1 libio-html-perl_1.004-2 libio-pty-perl_1:1.15-2 libio-socket-ssl-perl_2.069-1 libipc-run-perl_20200505.0-1 libisl23_0.23-1 libitm1_10.2.1-6 libk5crypto3_1.18.3-6+deb11u1 libkeyutils1_1.6.1-2 libkrb5-3_1.18.3-6+deb11u1 libkrb5support0_1.18.3-6+deb11u1 libksba8_1.5.0-3 libldap-2.4-2_2.4.57+dfsg-3 liblsan0_10.2.1-6 liblwp-mediatypes-perl_6.04-1 liblwp-protocol-https-perl_6.10-1 liblz4-1_1.9.3-2 liblzma5_5.2.5-2 libmagic-mgc_1:5.39-3 libmagic1_1:5.39-3 libmodule-runtime-perl_0.016-1 libmoo-perl_2.004004-1 libmount1_2.36.1-8+deb11u1 libmpc3_1.2.0-1 libmpdec3_2.5.1-1 libmpfr6_4.1.0-3 libncursesw6_6.2+20201114-2 libnet-http-perl_6.20-1 libnet-ssleay-perl_1.88-3+b1 libnettle8_3.7.3-1 libnpth0_1.6-3 libnsl-dev_1.3.0-2 libnsl2_1.3.0-2 libosp5_1.5.2-13+b2 libp11-kit0_0.23.22-1 libpam-modules_1.4.0-9+deb11u1 libpam-modules-bin_1.4.0-9+deb11u1 libpam-runtime_1.4.0-9+deb11u1 libpam0g_1.4.0-9+deb11u1 libparams-classify-perl_0.015-1+b3 libpcre2-8-0_10.36-2 libpcre3_2:8.39-13 libperl5.32_5.32.1-4+deb11u2 libpipeline1_1.5.3-1 libpod-parser-perl_1.63-2 libpython3-stdlib_3.9.2-3 libpython3.9-minimal_3.9.2-1 libpython3.9-stdlib_3.9.2-1 libquadmath0_10.2.1-6 libreadline8_8.1-1 librole-tiny-perl_2.002004-1 libsasl2-2_2.1.27+dfsg-2.1+deb11u1 libsasl2-modules-db_2.1.27+dfsg-2.1+deb11u1 libseccomp2_2.5.1-1+deb11u1 libselinux1_3.1-3 libsemanage-common_3.1-1 libsemanage1_3.1-1+b2 libsepol1_3.1-1 libsgmls-perl_1.03ii-36 libsigsegv2_2.13-1 libsmartcols1_2.36.1-8+deb11u1 libsqlite3-0_3.34.1-3 libss2_1.46.2-2 libssl1.1_1.1.1n-0+deb11u1 libstdc++-10-dev_10.2.1-6 libstdc++6_10.2.1-6 libstrictures-perl_2.000006-1 libsub-override-perl_0.09-2 libsub-quote-perl_2.006006-1 libsystemd0_247.3-7 libtasn1-6_4.16.0-2 libtext-glob-perl_0.11-1 libtimedate-perl_2.3300-2 libtinfo6_6.2+20201114-2 libtirpc-common_1.3.1-1 libtirpc-dev_1.3.1-1 libtirpc3_1.3.1-1 libtool_2.4.6-15 libtry-tiny-perl_0.30-1 libtsan0_10.2.1-6 libubsan1_10.2.1-6 libuchardet0_0.0.7-1 libudev1_247.3-7 libunistring2_0.9.10-4 liburi-perl_5.08-1 libuuid1_2.36.1-8+deb11u1 libwww-perl_6.52-1 libwww-robotrules-perl_6.02-1 libxml2_2.9.10+dfsg-6.7+deb11u1 libxxhash0_0.8.0-2 libyaml-tiny-perl_1.73-1 libzstd1_1.4.8+dfsg-2.1 linux-libc-dev_5.10.106-1 locales_2.31-13+deb11u3 login_1:4.8.1-1 logsave_1.46.2-2 lsb-base_11.1.0 m4_1.4.18-5 make_4.3-4.1 man-db_2.9.4-2 mawk_1.3.4.20200120-2 media-types_4.0.0 mount_2.36.1-8+deb11u1 ncurses-base_6.2+20201114-2 ncurses-bin_6.2+20201114-2 netbase_6.3 opensp_1.5.2-13+b2 openssl_1.1.1n-0+deb11u1 passwd_1:4.8.1-1 patch_2.7.6-7 patchutils_0.4.2-1 perl_5.32.1-4+deb11u2 perl-base_5.32.1-4+deb11u2 perl-modules-5.32_5.32.1-4+deb11u2 perl-openssl-defaults_5 pinentry-curses_1.1.0-4 po-debconf_1.0.21+nmu1 po4a_0.62-1 python3_3.9.2-3 python3-minimal_3.9.2-3 python3.9_3.9.2-1 python3.9-minimal_3.9.2-1 readline-common_8.1-1 sbuild-build-depends-main-dummy_0.invalid.0 sed_4.7-1 sensible-utils_0.0.14 sgml-base_1.30 sysvinit-utils_2.96-7+deb11u1 tar_1.34+dfsg-1 tzdata_2021a-1+deb11u3 util-linux_2.36.1-8+deb11u1 wdiff_1.2.2-2+b1 xz-utils_5.2.5-2 zlib1g_1:1.2.11.dfsg-2+deb11u1

+------------------------------------------------------------------------------+
| Build                                                                        |
+------------------------------------------------------------------------------+


Unpack source
-------------

Format: 3.0 (native)
Source: linux-base
Binary: linux-base
Architecture: all
Version: 4.9
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Uploaders: Ben Hutchings <benh@debian.org>, Salvatore Bonaccorso <carnil@debian.org>
Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/kernel-team/linux-base
Vcs-Git: https://salsa.debian.org/kernel-team/linux-base.git
Build-Depends: debhelper-compat (= 13), bash-completion, libtext-glob-perl <!nocheck>, po4a
Package-List:
 linux-base deb kernel optional arch=all
Checksums-Sha1:
 78a3cced863e40925ac0ab3312d33e027ba8cdb3 33512 linux-base_4.9.tar.xz
Checksums-Sha256:
 14f24f92a5db33db3f92dd12337ea282d48d532f78ac20a10292208aadf65e0b 33512 linux-base_4.9.tar.xz
Files:
 faa96a5e1c5b0e5667e1059cce603ac3 33512 linux-base_4.9.tar.xz

dpkg-source: warning: extracting unsigned source package (linux-base_4.9.dsc)
dpkg-source: info: extracting linux-base in /<<PKGBUILDDIR>>
dpkg-source: info: unpacking linux-base_4.9.tar.xz

Check disk space
----------------

Sufficient free space for build

User Environment
----------------

APT_CONFIG=/var/lib/sbuild/apt.conf
CCACHE_DIR=/ccache
HOME=/sbuild-nonexistent
LC_ALL=C.UTF-8
LOGNAME=builder
PARALLEL_MAKE=-j 16
PATH=/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PATH_PREPEND=/usr/lib/ccache
PWD=/<<PKGBUILDDIR>>
SCHROOT_ALIAS_NAME=isar-builder-1656
SCHROOT_CHROOT_NAME=isar-builder-1656
SCHROOT_COMMAND=env
SCHROOT_GID=30000
SCHROOT_GROUP=builder
SCHROOT_SESSION_ID=isar-builder-1656-60aab342-3e22-4d01-a838-54067fb6e98d
SCHROOT_UID=30000
SCHROOT_USER=builder
SHELL=/bin/sh
USER=builder

dpkg-buildpackage
-----------------

Command: dpkg-buildpackage --sanitize-env -us -uc -b -rfakeroot --source-option=-I
dpkg-buildpackage: info: source package linux-base
dpkg-buildpackage: info: source version 4.9
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Ben Hutchings <benh@debian.org>
 dpkg-source -I --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --with bash-completion
   dh_auto_clean
	make -j16 clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -f man/*.??.[1-9]
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_clean
 debian/rules binary
dh binary --with bash-completion
   dh_update_autotools_config
   dh_autoreconf
   dh_auto_configure
   dh_auto_build
	make -j16 "INSTALL=install --strip-program=true"
make[1]: Entering directory '/<<PKGBUILDDIR>>'
po4a --previous po/po4a.conf
 (67 entries)
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
perl -Ilib -MTest::Harness -e 'runtests(@ARGV)' lib/t/*.t
Smartmatch is experimental at lib/t/DebianLinux.t line 92.
Smartmatch is experimental at lib/t/DebianLinux.t line 208.
Smartmatch is experimental at lib/t/DebianLinux.t line 224.
Smartmatch is experimental at lib/t/DebianLinux.t line 235.
/tmp/Fs5yB_Yy_H:1: W: ignoring excess values for image_dest
/tmp/Fs5yB_Yy_H: W: ignoring no_symlinks; only symlinks are supported
/tmp/DDOntJSUFf:1: W: ignoring invalid value for do_symlinks
/tmp/DDOntJSUFf:2: W: ignoring line with syntax error
/tmp/DDOntJSUFf:3: W: ignoring line with syntax error
lib/t/DebianLinux.t .. ok
All tests successful.
Files=1, Tests=44,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.03 cusr  0.00 csys =  0.05 CPU)
Result: PASS
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   create-stamp debian/debhelper-build-stamp
   dh_prep
   dh_auto_install
   dh_install
   dh_installdocs
   dh_installchangelogs
   dh_installman
   dh_installdebconf
   dh_lintian
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_missing
   dh_installdeb
   dh_gencontrol
dpkg-gencontrol: warning: package linux-base: substitution variable ${perl:Depends} unused, but is defined
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'linux-base' in '../linux-base_4.9_all.deb'.
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../linux-base_4.9_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source -I --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)
--------------------------------------------------------------------------------
Build finished at 2022-04-06T12:47:06Z

+------------------------------------------------------------------------------+
| Finished Timed Build Commands                                                |
+------------------------------------------------------------------------------+


rm -f /var/cache/apt/archives//sbuild-build-depends-main-dummy_*.deb
--------------------------------------------------------------------


I: Finished running 'rm -f /var/cache/apt/archives//sbuild-build-depends-main-dummy_*.deb'.

cp -n --no-preserve=owner /var/cache/apt/archives//*.deb -t /home/builder/linux-base/rootfs//var/cache/apt/archives// || :
--------------------------------------------------------------------------------------------------------------------------

cp: failed to access '/home/builder/linux-base/rootfs//var/cache/apt/archives//': No such file or directory

I: Finished running 'cp -n --no-preserve=owner /var/cache/apt/archives//*.deb -t /home/builder/linux-base/rootfs//var/cache/apt/archives// || :'.

cp /var/log/dpkg.log /home/builder/linux-base/rootfs/dpkg_partial.log
---------------------------------------------------------------------

cp: cannot create regular file '/home/builder/linux-base/rootfs/dpkg_partial.log': No such file or directory

E: Command 'cp /var/log/dpkg.log /home/builder/linux-base/rootfs/dpkg_partial.log' failed to run.

Finished processing commands.
--------------------------------------------------------------------------------

+------------------------------------------------------------------------------+
| Cleanup                                                                      |
+------------------------------------------------------------------------------+

Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Failed to execute finished-build-commands

+------------------------------------------------------------------------------+
| Summary                                                                      |
+------------------------------------------------------------------------------+

Build Architecture: amd64
Build Type: binary
Build-Space: 584
Build-Time: 3
Distribution: isar
Fail-Stage: run-finished-build-commands
Host Architecture: amd64
Install-Time: 33
Job: /builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0/linux-base_4.9.dsc
Machine Architecture: amd64
Package: linux-base
Package-Time: 41
Source-Version: 4.9
Space: 584
Status: failed
Version: 4.9
--------------------------------------------------------------------------------
Finished at 2022-04-06T12:47:06Z
Build needed 00:00:41, 584k disk space
E: Failed to execute finished-build-commands
WARNING: exit code 1 from a shell command.
DEBUG: Executing shell function schroot_delete_configs
DEBUG: Shell function schroot_delete_configs finished
ERROR: Error executing a python function in exec_python_func() autogenerated:

The stack trace of python calls that resulted in this exception/failure was:
File: 'exec_python_func() autogenerated', lineno: 2, function: <module>
     0001:
 *** 0002:do_dpkg_build(d)
     0003:
File: '/builds/MUPgTtYp/0/FOO/isar/meta/classes/dpkg-base.bbclass', lineno: 239, function: do_dpkg_build
     0235:
     0236:python do_dpkg_build() {
     0237:    bb.build.exec_func('schroot_create_configs', d)
     0238:    try:
 *** 0239:        bb.build.exec_func("dpkg_runbuild", d)
     0240:    finally:
     0241:        bb.build.exec_func('schroot_delete_configs', d)
     0242:}
     0243:
File: '/builds/MUPgTtYp/0/FOO/isar/bitbake/lib/bb/build.py', lineno: 251, function: exec_func
     0247:    with bb.utils.fileslocked(lockfiles):
     0248:        if ispython:
     0249:            exec_func_python(func, d, runfile, cwd=adir)
     0250:        else:
 *** 0251:            exec_func_shell(func, d, runfile, cwd=adir)
     0252:
     0253:    try:
     0254:        curcwd = os.getcwd()
     0255:    except:
File: '/builds/MUPgTtYp/0/FOO/isar/bitbake/lib/bb/build.py', lineno: 452, function: exec_func_shell
     0448:    with open(fifopath, 'r+b', buffering=0) as fifo:
     0449:        try:
     0450:            bb.debug(2, "Executing shell function %s" % func)
     0451:            with open(os.devnull, 'r+') as stdin, logfile:
 *** 0452:                bb.process.run(cmd, shell=False, stdin=stdin, log=logfile, extrafiles=[(fifo,readfifo)])
     0453:        finally:
     0454:            os.unlink(fifopath)
     0455:
     0456:    bb.debug(2, "Shell function %s finished" % func)
File: '/builds/MUPgTtYp/0/FOO/isar/bitbake/lib/bb/process.py', lineno: 182, function: run
     0178:        if not stderr is None:
     0179:            stderr = stderr.decode("utf-8")
     0180:
     0181:    if pipe.returncode != 0:
 *** 0182:        raise ExecutionError(cmd, pipe.returncode, stdout, stderr)
     0183:    return stdout, stderr
Exception: bb.process.ExecutionError: Execution of '/builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0/temp/run.dpkg_runbuild.1656' failed with exit code 1:
gbp:info: Performing the build
sbuild (Debian sbuild) 0.81.2 (31 January 2021) on runner-mupgttyp-project-130787-concurrent-0qnh4s

+==============================================================================+
| linux-base 4.9 (amd64)                       Wed, 06 Apr 2022 12:46:25 +0000 |
+==============================================================================+

Package: linux-base
Version: 4.9
Source Version: 4.9
Distribution: isar
Machine Architecture: amd64
Host Architecture: amd64
Build Architecture: amd64
Build Type: binary

I: NOTICE: Log filtering will replace 'var/run/schroot/mount/isar-builder-1656-60aab342-3e22-4d01-a838-54067fb6e98d' with '<<CHROOT>>'

+------------------------------------------------------------------------------+
| Chroot Setup Commands                                                        |
+------------------------------------------------------------------------------+


rm -f /var/log/dpkg.log
-----------------------


I: Finished running 'rm -f /var/log/dpkg.log'.

cp -n --no-preserve=owner /home/builder/linux-base/rootfs//var/cache/apt/archives//*.deb -t /var/cache/apt/archives// || :
--------------------------------------------------------------------------------------------------------------------------

cp: cannot stat '/home/builder/linux-base/rootfs//var/cache/apt/archives//*.deb': No such file or directory

I: Finished running 'cp -n --no-preserve=owner /home/builder/linux-base/rootfs//var/cache/apt/archives//*.deb -t /var/cache/apt/archives// || :'.

Finished processing commands.
--------------------------------------------------------------------------------
I: NOTICE: Log filtering will replace 'build/linux-base-Dj4POm/resolver-4CLslP' with '<<RESOLVERDIR>>'

+------------------------------------------------------------------------------+
| Update chroot                                                                |
+------------------------------------------------------------------------------+

Get:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Ign:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Ign:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Hit:4 https://debian.inf.tu-dresden.de/debian bullseye InRelease
Hit:5 https://debian.inf.tu-dresden.de/debian-security bullseye-security InRelease
Get:6 https://debian.inf.tu-dresden.de/debian bullseye-updates InRelease [39.4 kB]
Get:7 https://debian.inf.tu-dresden.de/debian bullseye-backports InRelease [44.2 kB]
Get:8 https://debian.inf.tu-dresden.de/debian bullseye-backports/main Sources.diff/Index [63.3 kB]
Get:9 https://debian.inf.tu-dresden.de/debian bullseye-backports/main amd64 Packages.diff/Index [63.3 kB]
Get:10 https://debian.inf.tu-dresden.de/debian bullseye-backports/main Sources T-2022-04-05-0207.37-F-2022-04-04-2007.19.pdiff [95 B]
Get:10 https://debian.inf.tu-dresden.de/debian bullseye-backports/main Sources T-2022-04-05-0207.37-F-2022-04-04-2007.19.pdiff [95 B]
Get:11 https://debian.inf.tu-dresden.de/debian bullseye-backports/main amd64 Packages T-2022-04-04-2007.19-F-2022-04-04-2007.19.pdiff [541 B]
Get:11 https://debian.inf.tu-dresden.de/debian bullseye-backports/main amd64 Packages T-2022-04-04-2007.19-F-2022-04-04-2007.19.pdiff [541 B]
Fetched 211 kB in 1s (281 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

+------------------------------------------------------------------------------+
| Fetch source files                                                           |
+------------------------------------------------------------------------------+


Local sources
-------------

/builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0/linux-base_4.9.dsc exists in /builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0; copying to chroot
I: NOTICE: Log filtering will replace 'build/linux-base-Dj4POm/linux-base-4.9' with '<<PKGBUILDDIR>>'
I: NOTICE: Log filtering will replace 'build/linux-base-Dj4POm' with '<<BUILDDIR>>'

+------------------------------------------------------------------------------+
| Install package build dependencies                                           |
+------------------------------------------------------------------------------+


Setup apt archive
-----------------

Merged Build-Depends: debhelper-compat (= 13), bash-completion, libtext-glob-perl, po4a, build-essential, fakeroot
Filtered Build-Depends: debhelper-compat (= 13), bash-completion, libtext-glob-perl, po4a, build-essential, fakeroot
dpkg-deb: building package 'sbuild-build-depends-main-dummy' in '/<<RESOLVERDIR>>/apt_archive/sbuild-build-depends-main-dummy.deb'.
Ign:1 copy:/<<RESOLVERDIR>>/apt_archive ./ InRelease
Get:2 copy:/<<RESOLVERDIR>>/apt_archive ./ Release [957 B]
Ign:3 copy:/<<RESOLVERDIR>>/apt_archive ./ Release.gpg
Get:4 copy:/<<RESOLVERDIR>>/apt_archive ./ Sources [403 B]
Get:5 copy:/<<RESOLVERDIR>>/apt_archive ./ Packages [477 B]
Fetched 1837 B in 0s (0 B/s)
Reading package lists...
Get:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Ign:1 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar InRelease
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:2 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release [4994 B]
Get:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Ign:3 file:/home/builder/linux-base/isar-apt/debian-bullseye-amd64/apt/debian-bullseye isar Release.gpg
Reading package lists...
Reading package lists...

Install main build dependencies (apt-based resolver)
----------------------------------------------------

Installing build dependencies
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
  bash-completion libosp5 libpod-parser-perl libsgmls-perl libtext-glob-perl
  libyaml-tiny-perl opensp po4a sgml-base
Suggested packages:
  sgmlspl sgmls-doc doc-base sgml-data sgml-base-doc
Recommended packages:
  liblocale-gettext-perl libterm-readkey-perl libtext-wrapi18n-perl
  libunicode-linebreak-perl
The following NEW packages will be installed:
  bash-completion libosp5 libpod-parser-perl libsgmls-perl libtext-glob-perl
  libyaml-tiny-perl opensp po4a sbuild-build-depends-main-dummy sgml-base
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 3565 kB of archives.
After this operation, 8490 kB of additional disk space will be used.
Get:1 copy:/<<RESOLVERDIR>>/apt_archive ./ sbuild-build-depends-main-dummy 0.invalid.0 [904 B]
Get:2 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 sgml-base all 1.30 [15.1 kB]
Get:3 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 bash-completion all 1:2.11-2 [234 kB]
Get:4 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libosp5 amd64 1.5.2-13+b2 [934 kB]
Get:5 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libpod-parser-perl all 1.63-2 [96.1 kB]
Get:6 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libsgmls-perl all 1.03ii-36 [26.5 kB]
Get:7 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libtext-glob-perl all 0.11-1 [8888 B]
Get:8 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 libyaml-tiny-perl all 1.73-1 [32.3 kB]
Get:9 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 opensp amd64 1.5.2-13+b2 [421 kB]
Get:10 https://debian.inf.tu-dresden.de/debian bullseye/main amd64 po4a all 0.62-1 [1796 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 3565 kB in 0s (10.4 MB/s)
Selecting previously unselected package sgml-base.
(Reading database ... 17618 files and directories currently installed.)
Preparing to unpack .../0-sgml-base_1.30_all.deb ...
Unpacking sgml-base (1.30) ...
Selecting previously unselected package bash-completion.
Preparing to unpack .../1-bash-completion_1%3a2.11-2_all.deb ...
Unpacking bash-completion (1:2.11-2) ...
Selecting previously unselected package libosp5.
Preparing to unpack .../2-libosp5_1.5.2-13+b2_amd64.deb ...
Unpacking libosp5 (1.5.2-13+b2) ...
Selecting previously unselected package libpod-parser-perl.
Preparing to unpack .../3-libpod-parser-perl_1.63-2_all.deb ...
Adding 'diversion of /usr/bin/podselect to /usr/bin/podselect.bundled by libpod-parser-perl'
Adding 'diversion of /usr/share/man/man1/podselect.1.gz to /usr/share/man/man1/podselect.bundled.1.gz by libpod-parser-perl'
Unpacking libpod-parser-perl (1.63-2) ...
Selecting previously unselected package libsgmls-perl.
Preparing to unpack .../4-libsgmls-perl_1.03ii-36_all.deb ...
Unpacking libsgmls-perl (1.03ii-36) ...
Selecting previously unselected package libtext-glob-perl.
Preparing to unpack .../5-libtext-glob-perl_0.11-1_all.deb ...
Unpacking libtext-glob-perl (0.11-1) ...
Selecting previously unselected package libyaml-tiny-perl.
Preparing to unpack .../6-libyaml-tiny-perl_1.73-1_all.deb ...
Unpacking libyaml-tiny-perl (1.73-1) ...
Selecting previously unselected package opensp.
Preparing to unpack .../7-opensp_1.5.2-13+b2_amd64.deb ...
Unpacking opensp (1.5.2-13+b2) ...
Selecting previously unselected package po4a.
Preparing to unpack .../8-po4a_0.62-1_all.deb ...
Unpacking po4a (0.62-1) ...
Selecting previously unselected package sbuild-build-depends-main-dummy.
Preparing to unpack .../9-sbuild-build-depends-main-dummy_0.invalid.0_amd64.deb ...
Unpacking sbuild-build-depends-main-dummy (0.invalid.0) ...
Setting up libsgmls-perl (1.03ii-36) ...
Setting up libtext-glob-perl (0.11-1) ...
Setting up libyaml-tiny-perl (1.73-1) ...
Setting up libosp5 (1.5.2-13+b2) ...
Setting up bash-completion (1:2.11-2) ...
Setting up libpod-parser-perl (1.63-2) ...
Setting up sgml-base (1.30) ...
Setting up opensp (1.5.2-13+b2) ...
Setting up po4a (0.62-1) ...
Setting up sbuild-build-depends-main-dummy (0.invalid.0) ...
Processing triggers for man-db (2.9.4-2) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...

+------------------------------------------------------------------------------+
| Check architectures                                                          |
+------------------------------------------------------------------------------+

Arch check ok (amd64 included in all)

+------------------------------------------------------------------------------+
| Build environment                                                            |
+------------------------------------------------------------------------------+

Kernel: Linux 5.11.0-1028-aws #31~20.04.1-Ubuntu SMP Fri Jan 14 14:37:50 UTC 2022 amd64 (x86_64)
Toolchain package versions: binutils_2.35.2-2 dpkg-dev_1.20.9 g++-10_10.2.1-6 gcc-10_10.2.1-6 libc6-dev_2.31-13+deb11u3 libstdc++-10-dev_10.2.1-6 libstdc++6_10.2.1-6 linux-libc-dev_5.10.106-1
Package versions: adduser_3.118 apt_2.2.4 autoconf_2.69-14 automake_1:1.16.3-2 autopoint_0.21-4 autotools-dev_20180224.1+nmu1 base-files_11.1+deb11u3 base-passwd_3.5.51 bash_5.1-2+b3 bash-completion_1:2.11-2 binutils_2.35.2-2 binutils-common_2.35.2-2 binutils-x86-64-linux-gnu_2.35.2-2 bsdextrautils_2.36.1-8+deb11u1 bsdutils_1:2.36.1-8+deb11u1 build-essential_12.9 bzip2_1.0.8-4 ca-certificates_20210119 ccache_4.2-1 coreutils_8.32-4+b1 cpp_4:10.2.1-1 cpp-10_10.2.1-6 dash_0.5.11+git20200708+dd9ef66-5 debconf_1.5.77 debhelper_13.3.4 debian-archive-keyring_2021.1.1 debianutils_4.11.2 devscripts_2.21.3+deb11u1 dh-autoreconf_20 dh-strip-nondeterminism_1.12.0-1 diffutils_1:3.7-5 dirmngr_2.2.27-2+deb11u1 dpkg_1.20.9 dpkg-dev_1.20.9 dwz_0.13+20210201-1 e2fsprogs_1.46.2-2 equivs_2.3.1 fakeroot_1.25.3-1.1 file_1:5.39-3 findutils_4.8.0-1 g++_4:10.2.1-1 g++-10_10.2.1-6 gcc_4:10.2.1-1 gcc-10_10.2.1-6 gcc-10-base_10.2.1-6 gcc-9-base_9.3.0-22 gettext_0.21-4 gettext-base_0.21-4 gnupg_2.2.27-2+deb11u1 gnupg-l10n_2.2.27-2+deb11u1 gnupg-utils_2.2.27-2+deb11u1 gpg_2.2.27-2+deb11u1 gpg-agent_2.2.27-2+deb11u1 gpg-wks-client_2.2.27-2+deb11u1 gpg-wks-server_2.2.27-2+deb11u1 gpgconf_2.2.27-2+deb11u1 gpgsm_2.2.27-2+deb11u1 gpgv_2.2.27-2+deb11u1 grep_3.6-1 groff-base_1.22.4-6 gzip_1.10-4 hostname_3.23 init-system-helpers_1.60 intltool-debian_0.35.0+20060710.5 libacl1_2.2.53-10 libapt-pkg6.0_2.2.4 libarchive-zip-perl_1.68-1 libasan6_10.2.1-6 libassuan0_2.5.3-7.1 libatomic1_10.2.1-6 libattr1_1:2.4.48-6 libaudit-common_1:3.0-2 libaudit1_1:3.0-2 libb-hooks-op-check-perl_0.22-1+b3 libbinutils_2.35.2-2 libblkid1_2.36.1-8+deb11u1 libbz2-1.0_1.0.8-4 libc-bin_2.31-13+deb11u3 libc-dev-bin_2.31-13+deb11u3 libc-l10n_2.31-13+deb11u3 libc6_2.31-13+deb11u3 libc6-dev_2.31-13+deb11u3 libcap-ng0_0.7.9-2.2+b1 libcc1-0_10.2.1-6 libclass-method-modifiers-perl_2.13-1 libcom-err2_1.46.2-2 libcrypt-dev_1:4.4.18-4 libcrypt1_1:4.4.18-4 libctf-nobfd0_2.35.2-2 libctf0_2.35.2-2 libdb5.3_5.3.28+dfsg1-0.8 libdebconfclient0_0.260 libdebhelper-perl_13.3.4 libdevel-callchecker-perl_0.008-1+b2 libdpkg-perl_1.20.9 libdynaloader-functions-perl_0.003-1.1 libelf1_0.183-1 libencode-locale-perl_1.05-1.1 libexpat1_2.2.10-2+deb11u3 libext2fs2_1.46.2-2 libfakeroot_1.25.3-1.1 libffi7_3.3-6 libfile-dirlist-perl_0.05-2 libfile-homedir-perl_1.006-1 libfile-listing-perl_6.14-1 libfile-stripnondeterminism-perl_1.12.0-1 libfile-touch-perl_0.11-1 libfile-which-perl_1.23-1 libgcc-10-dev_10.2.1-6 libgcc-s1_10.2.1-6 libgcrypt20_1.8.7-6 libgdbm-compat4_1.19-2 libgdbm6_1.19-2 libgmp10_2:6.2.1+dfsg-1+deb11u1 libgnutls30_3.7.1-5 libgomp1_10.2.1-6 libgpg-error0_1.38-2 libgssapi-krb5-2_1.18.3-6+deb11u1 libhogweed6_3.7.3-1 libhtml-parser-perl_3.75-1+b1 libhtml-tagset-perl_3.20-4 libhtml-tree-perl_5.07-2 libhttp-cookies-perl_6.10-1 libhttp-date-perl_6.05-1 libhttp-message-perl_6.28-1 libhttp-negotiate-perl_6.01-1 libicu67_67.1-7 libidn2-0_2.3.0-5 libimport-into-perl_1.002005-1 libio-html-perl_1.004-2 libio-pty-perl_1:1.15-2 libio-socket-ssl-perl_2.069-1 libipc-run-perl_20200505.0-1 libisl23_0.23-1 libitm1_10.2.1-6 libk5crypto3_1.18.3-6+deb11u1 libkeyutils1_1.6.1-2 libkrb5-3_1.18.3-6+deb11u1 libkrb5support0_1.18.3-6+deb11u1 libksba8_1.5.0-3 libldap-2.4-2_2.4.57+dfsg-3 liblsan0_10.2.1-6 liblwp-mediatypes-perl_6.04-1 liblwp-protocol-https-perl_6.10-1 liblz4-1_1.9.3-2 liblzma5_5.2.5-2 libmagic-mgc_1:5.39-3 libmagic1_1:5.39-3 libmodule-runtime-perl_0.016-1 libmoo-perl_2.004004-1 libmount1_2.36.1-8+deb11u1 libmpc3_1.2.0-1 libmpdec3_2.5.1-1 libmpfr6_4.1.0-3 libncursesw6_6.2+20201114-2 libnet-http-perl_6.20-1 libnet-ssleay-perl_1.88-3+b1 libnettle8_3.7.3-1 libnpth0_1.6-3 libnsl-dev_1.3.0-2 libnsl2_1.3.0-2 libosp5_1.5.2-13+b2 libp11-kit0_0.23.22-1 libpam-modules_1.4.0-9+deb11u1 libpam-modules-bin_1.4.0-9+deb11u1 libpam-runtime_1.4.0-9+deb11u1 libpam0g_1.4.0-9+deb11u1 libparams-classify-perl_0.015-1+b3 libpcre2-8-0_10.36-2 libpcre3_2:8.39-13 libperl5.32_5.32.1-4+deb11u2 libpipeline1_1.5.3-1 libpod-parser-perl_1.63-2 libpython3-stdlib_3.9.2-3 libpython3.9-minimal_3.9.2-1 libpython3.9-stdlib_3.9.2-1 libquadmath0_10.2.1-6 libreadline8_8.1-1 librole-tiny-perl_2.002004-1 libsasl2-2_2.1.27+dfsg-2.1+deb11u1 libsasl2-modules-db_2.1.27+dfsg-2.1+deb11u1 libseccomp2_2.5.1-1+deb11u1 libselinux1_3.1-3 libsemanage-common_3.1-1 libsemanage1_3.1-1+b2 libsepol1_3.1-1 libsgmls-perl_1.03ii-36 libsigsegv2_2.13-1 libsmartcols1_2.36.1-8+deb11u1 libsqlite3-0_3.34.1-3 libss2_1.46.2-2 libssl1.1_1.1.1n-0+deb11u1 libstdc++-10-dev_10.2.1-6 libstdc++6_10.2.1-6 libstrictures-perl_2.000006-1 libsub-override-perl_0.09-2 libsub-quote-perl_2.006006-1 libsystemd0_247.3-7 libtasn1-6_4.16.0-2 libtext-glob-perl_0.11-1 libtimedate-perl_2.3300-2 libtinfo6_6.2+20201114-2 libtirpc-common_1.3.1-1 libtirpc-dev_1.3.1-1 libtirpc3_1.3.1-1 libtool_2.4.6-15 libtry-tiny-perl_0.30-1 libtsan0_10.2.1-6 libubsan1_10.2.1-6 libuchardet0_0.0.7-1 libudev1_247.3-7 libunistring2_0.9.10-4 liburi-perl_5.08-1 libuuid1_2.36.1-8+deb11u1 libwww-perl_6.52-1 libwww-robotrules-perl_6.02-1 libxml2_2.9.10+dfsg-6.7+deb11u1 libxxhash0_0.8.0-2 libyaml-tiny-perl_1.73-1 libzstd1_1.4.8+dfsg-2.1 linux-libc-dev_5.10.106-1 locales_2.31-13+deb11u3 login_1:4.8.1-1 logsave_1.46.2-2 lsb-base_11.1.0 m4_1.4.18-5 make_4.3-4.1 man-db_2.9.4-2 mawk_1.3.4.20200120-2 media-types_4.0.0 mount_2.36.1-8+deb11u1 ncurses-base_6.2+20201114-2 ncurses-bin_6.2+20201114-2 netbase_6.3 opensp_1.5.2-13+b2 openssl_1.1.1n-0+deb11u1 passwd_1:4.8.1-1 patch_2.7.6-7 patchutils_0.4.2-1 perl_5.32.1-4+deb11u2 perl-base_5.32.1-4+deb11u2 perl-modules-5.32_5.32.1-4+deb11u2 perl-openssl-defaults_5 pinentry-curses_1.1.0-4 po-debconf_1.0.21+nmu1 po4a_0.62-1 python3_3.9.2-3 python3-minimal_3.9.2-3 python3.9_3.9.2-1 python3.9-minimal_3.9.2-1 readline-common_8.1-1 sbuild-build-depends-main-dummy_0.invalid.0 sed_4.7-1 sensible-utils_0.0.14 sgml-base_1.30 sysvinit-utils_2.96-7+deb11u1 tar_1.34+dfsg-1 tzdata_2021a-1+deb11u3 util-linux_2.36.1-8+deb11u1 wdiff_1.2.2-2+b1 xz-utils_5.2.5-2 zlib1g_1:1.2.11.dfsg-2+deb11u1

+------------------------------------------------------------------------------+
| Build                                                                        |
+------------------------------------------------------------------------------+


Unpack source
-------------

Format: 3.0 (native)
Source: linux-base
Binary: linux-base
Architecture: all
Version: 4.9
Maintainer: Debian Kernel Team <debian-kernel@lists.debian.org>
Uploaders: Ben Hutchings <benh@debian.org>, Salvatore Bonaccorso <carnil@debian.org>
Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/kernel-team/linux-base
Vcs-Git: https://salsa.debian.org/kernel-team/linux-base.git
Build-Depends: debhelper-compat (= 13), bash-completion, libtext-glob-perl <!nocheck>, po4a
Package-List:
 linux-base deb kernel optional arch=all
Checksums-Sha1:
 78a3cced863e40925ac0ab3312d33e027ba8cdb3 33512 linux-base_4.9.tar.xz
Checksums-Sha256:
 14f24f92a5db33db3f92dd12337ea282d48d532f78ac20a10292208aadf65e0b 33512 linux-base_4.9.tar.xz
Files:
 faa96a5e1c5b0e5667e1059cce603ac3 33512 linux-base_4.9.tar.xz

dpkg-source: warning: extracting unsigned source package (linux-base_4.9.dsc)
dpkg-source: info: extracting linux-base in /<<PKGBUILDDIR>>
dpkg-source: info: unpacking linux-base_4.9.tar.xz

Check disk space
----------------

Sufficient free space for build

User Environment
----------------

APT_CONFIG=/var/lib/sbuild/apt.conf
CCACHE_DIR=/ccache
HOME=/sbuild-nonexistent
LC_ALL=C.UTF-8
LOGNAME=builder
PARALLEL_MAKE=-j 16
PATH=/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
PATH_PREPEND=/usr/lib/ccache
PWD=/<<PKGBUILDDIR>>
SCHROOT_ALIAS_NAME=isar-builder-1656
SCHROOT_CHROOT_NAME=isar-builder-1656
SCHROOT_COMMAND=env
SCHROOT_GID=30000
SCHROOT_GROUP=builder
SCHROOT_SESSION_ID=isar-builder-1656-60aab342-3e22-4d01-a838-54067fb6e98d
SCHROOT_UID=30000
SCHROOT_USER=builder
SHELL=/bin/sh
USER=builder

dpkg-buildpackage
-----------------

Command: dpkg-buildpackage --sanitize-env -us -uc -b -rfakeroot --source-option=-I
dpkg-buildpackage: info: source package linux-base
dpkg-buildpackage: info: source version 4.9
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Ben Hutchings <benh@debian.org>
 dpkg-source -I --before-build .
dpkg-buildpackage: info: host architecture amd64
 debian/rules clean
dh clean --with bash-completion
   dh_auto_clean
	make -j16 clean
make[1]: Entering directory '/<<PKGBUILDDIR>>'
rm -f man/*.??.[1-9]
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   dh_clean
 debian/rules binary
dh binary --with bash-completion
   dh_update_autotools_config
   dh_autoreconf
   dh_auto_configure
   dh_auto_build
	make -j16 "INSTALL=install --strip-program=true"
make[1]: Entering directory '/<<PKGBUILDDIR>>'
po4a --previous po/po4a.conf
 (67 entries)
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
perl -Ilib -MTest::Harness -e 'runtests(@ARGV)' lib/t/*.t
Smartmatch is experimental at lib/t/DebianLinux.t line 92.
Smartmatch is experimental at lib/t/DebianLinux.t line 208.
Smartmatch is experimental at lib/t/DebianLinux.t line 224.
Smartmatch is experimental at lib/t/DebianLinux.t line 235.
/tmp/Fs5yB_Yy_H:1: W: ignoring excess values for image_dest
/tmp/Fs5yB_Yy_H: W: ignoring no_symlinks; only symlinks are supported
/tmp/DDOntJSUFf:1: W: ignoring invalid value for do_symlinks
/tmp/DDOntJSUFf:2: W: ignoring line with syntax error
/tmp/DDOntJSUFf:3: W: ignoring line with syntax error
lib/t/DebianLinux.t .. ok
All tests successful.
Files=1, Tests=44,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.03 cusr  0.00 csys =  0.05 CPU)
Result: PASS
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
   create-stamp debian/debhelper-build-stamp
   dh_prep
   dh_auto_install
   dh_install
   dh_installdocs
   dh_installchangelogs
   dh_installman
   dh_installdebconf
   dh_lintian
   dh_perl
   dh_link
   dh_strip_nondeterminism
   dh_compress
   dh_fixperms
   dh_missing
   dh_installdeb
   dh_gencontrol
dpkg-gencontrol: warning: package linux-base: substitution variable ${perl:Depends} unused, but is defined
   dh_md5sums
   dh_builddeb
dpkg-deb: building package 'linux-base' in '../linux-base_4.9_all.deb'.
 dpkg-genbuildinfo --build=binary
 dpkg-genchanges --build=binary >../linux-base_4.9_amd64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
 dpkg-source -I --after-build .
dpkg-buildpackage: info: binary-only upload (no source included)
--------------------------------------------------------------------------------
Build finished at 2022-04-06T12:47:06Z

+------------------------------------------------------------------------------+
| Finished Timed Build Commands                                                |
+------------------------------------------------------------------------------+


rm -f /var/cache/apt/archives//sbuild-build-depends-main-dummy_*.deb
--------------------------------------------------------------------


I: Finished running 'rm -f /var/cache/apt/archives//sbuild-build-depends-main-dummy_*.deb'.

cp -n --no-preserve=owner /var/cache/apt/archives//*.deb -t /home/builder/linux-base/rootfs//var/cache/apt/archives// || :
--------------------------------------------------------------------------------------------------------------------------

cp: failed to access '/home/builder/linux-base/rootfs//var/cache/apt/archives//': No such file or directory

I: Finished running 'cp -n --no-preserve=owner /var/cache/apt/archives//*.deb -t /home/builder/linux-base/rootfs//var/cache/apt/archives// || :'.

cp /var/log/dpkg.log /home/builder/linux-base/rootfs/dpkg_partial.log
---------------------------------------------------------------------

cp: cannot create regular file '/home/builder/linux-base/rootfs/dpkg_partial.log': No such file or directory

E: Command 'cp /var/log/dpkg.log /home/builder/linux-base/rootfs/dpkg_partial.log' failed to run.

Finished processing commands.
--------------------------------------------------------------------------------

+------------------------------------------------------------------------------+
| Cleanup                                                                      |
+------------------------------------------------------------------------------+

Purging /<<BUILDDIR>>
Not cleaning session: cloned chroot in use
E: Failed to execute finished-build-commands

+------------------------------------------------------------------------------+
| Summary                                                                      |
+------------------------------------------------------------------------------+

Build Architecture: amd64
Build Type: binary
Build-Space: 584
Build-Time: 3
Distribution: isar
Fail-Stage: run-finished-build-commands
Host Architecture: amd64
Install-Time: 33
Job: /builds/MUPgTtYp/0/FOO/build/tmp/work/debian-bullseye-amd64/linux-base/4.9-r0/linux-base_4.9.dsc
Machine Architecture: amd64
Package: linux-base
Package-Time: 41
Source-Version: 4.9
Space: 584
Status: failed
Version: 4.9
--------------------------------------------------------------------------------
Finished at 2022-04-06T12:47:06Z
Build needed 00:00:41, 584k disk space
E: Failed to execute finished-build-commands
WARNING: exit code 1 from a shell command.


DEBUG: Python function do_dpkg_build finished

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

* RE: [PATCH v8 08/16] dpkg: Remove builddeps install task.
  2022-03-17  4:50 ` [PATCH v8 08/16] dpkg: Remove builddeps install task Uladzimir Bely
@ 2022-04-08  9:11   ` Moessbauer, Felix
  0 siblings, 0 replies; 22+ messages in thread
From: Moessbauer, Felix @ 2022-04-08  9:11 UTC (permalink / raw)
  To: Uladzimir Bely; +Cc: isar-users

> -----Original Message-----
> From: isar-users@googlegroups.com <isar-users@googlegroups.com> On
> Behalf Of Uladzimir Bely
> Sent: Thursday, March 17, 2022 5:50 AM
> To: isar-users@googlegroups.com
> Subject: [PATCH v8 08/16] dpkg: Remove builddeps install task.
> 
> While builddeps are now handled interlnally by sbuild, we don't need a task to
> preinstall them in buildchroot.
> 
> But for the second local (base-apt) build we need a way to keep all dependencies
> in form of .deb files in DL_DIR. This is done by executing additional commands in
> sbuild that copy them to/from an externally mounted folder.
> 
> Signed-off-by: Uladzimir Bely <ubely@ilbers.de>
> ---
>  meta/classes/dpkg.bbclass   | 44 ++++++++++++++-----------------------
>  meta/classes/sbuild.bbclass |  1 -
>  2 files changed, 17 insertions(+), 28 deletions(-)
> 
> diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index
> b61d182d..b3931850 100644
> --- a/meta/classes/dpkg.bbclass
> +++ b/meta/classes/dpkg.bbclass
> @@ -5,33 +5,6 @@ inherit dpkg-base
> 
>  PACKAGE_ARCH ?= "${DISTRO_ARCH}"
> 
> -# Install build dependencies for package
> -do_install_builddeps() {
> -    dpkg_do_mounts
> -    E="${@ isar_export_proxies(d)}"
> -    export DEB_BUILD_OPTIONS="${@ isar_deb_build_options(d)}"
> -    export DEB_BUILD_PROFILES="${@ isar_deb_build_profiles(d)}"
> -    distro="${DISTRO}"
> -    if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
> -        distro="${HOST_DISTRO}"
> -    fi
> -
> -    deb_dl_dir_import "${BUILDCHROOT_DIR}" "${distro}"
> -    sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh \
> -        ${PP}/${PPS} ${PACKAGE_ARCH} --download-only
> -    deb_dl_dir_export "${BUILDCHROOT_DIR}" "${distro}"
> -    sudo -E chroot ${BUILDCHROOT_DIR} /isar/deps.sh \
> -        ${PP}/${PPS} ${PACKAGE_ARCH}
> -    dpkg_undo_mounts
> -}
> -
> -addtask install_builddeps after do_prepare_build before do_dpkg_build -
> do_install_builddeps[depends] += "isar-apt:do_cache_config"
> -# apt and reprepro may not run in parallel, acquire the Isar lock -
> do_install_builddeps[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
> -
> -addtask devshell after do_install_builddeps
> -
>  DPKG_PREBUILD_ENV_FILE="${WORKDIR}/dpkg_prebuild.env"
> 
>  do_prepare_build_append() {
> @@ -65,6 +38,16 @@ dpkg_runbuild() {
>          bbwarn "Export of '${line}' detected, please migrate to templates"
>      done
> 
> +    distro="${DISTRO}"
> +    if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
> +        distro="${HOST_DISTRO}"
> +    fi
> +
> +    deb_dl_dir_import "${WORKDIR}/rootfs" "${distro}"
> +
> +    deb_dir="/var/cache/apt/archives/"
> +    ext_deb_dir="/home/builder/${PN}/rootfs/${deb_dir}"
Hi,

please use the PP variable from dpkg-base.bbclass here:
ext_root="${PP}/rootfs"

Felix

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

* Re: [PATCH v8 00/16] Sbuild/Schroot migration
  2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
                   ` (16 preceding siblings ...)
  2022-04-07  9:32 ` [PATCH v8 00/16] Sbuild/Schroot migration Anton Mikanovich
@ 2022-05-04  8:56 ` Anton Mikanovich
  17 siblings, 0 replies; 22+ messages in thread
From: Anton Mikanovich @ 2022-05-04  8:56 UTC (permalink / raw)
  To: Uladzimir Bely, Felix Moessbauer, isar-users

17.03.2022 07:50, Uladzimir Bely wrote:
> This is a patchset showing how sbuild/schroot tools can be integrated
> into Isar build system.
>
> Base schroot images are created with sbuild-chroot-target or, in case
> of cross-build, sbuild-chroot-host recipes. These images are based on
> isar-bootstrap ones, but include some build-related stuff preinstalled.
>
> To use these changes you need to have sbuild and schroot installed and
> configured. User who runs build should be added to sbuild group.
>
> Currently, sbuild-related stuff is supported in latest kas.
>
> If Gilab CI is used, the following configuration changes are required:
> - external dir for schroot overlay should be set in the config
> /etc/gitlab-runner/config.toml:
>
> volumes = ["/path/to/overlay:/var/lib/schroot/union/overlay"]
>
> The patchset was tested with 'meta-iot2050' and 'xenomai-images'
> downstreams in combination with kas image mentioned above.
>
> Current limitations:
> - parallel building of several packages requires more free space in
> comparison with buildchroot-based architecture. This happens due
> the sbuild architecture which uses some basic layer (common for all
> packages) and per-package separate layer (where builddeps are downloaded
> and installed).

There are few issues with disk space consumption and cleanup in the 
current implementation.
We are currently working on it, patchset v10 will be send soon.


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

end of thread, other threads:[~2022-05-04  8:57 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-17  4:50 [PATCH v8 00/16] Sbuild/Schroot migration Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 01/16] dpkg-gbp: Use separate command to export tarball Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 02/16] dpkg-gbp: Use host tools for dsc preparation Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 03/16] sbuild: Add recipes for host and target rootfs to run sbuild Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 04/16] sbuild: Introduce a class for another build method Uladzimir Bely
2022-03-17 15:31   ` Moessbauer, Felix
2022-03-17  4:50 ` [PATCH v8 05/16] dpkg: Build packages with sbuild Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 06/16] sbuild: Support of DEB_BUILD_PROFILES Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 07/16] sbuild: Support of shell exports from dpkg_runbuild_prepend Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 08/16] dpkg: Remove builddeps install task Uladzimir Bely
2022-04-08  9:11   ` Moessbauer, Felix
2022-03-17  4:50 ` [PATCH v8 09/16] sbuild: Add ccache support Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 10/16] dpkg-base: Switch devshell to use schroot Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 11/16] dpkg-base: Switch apt_fetch and apt_unpack " Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 12/16] doc: Add sbuild-related documentation Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 13/16] sbuild: Use .dsc file instead of source directory Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 14/16] sbuild: Fixed proxy support Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 15/16] sbuild: Fix debsrc_download for packages dependencies Uladzimir Bely
2022-03-17  4:50 ` [PATCH v8 16/16] fix: support build of packages with epoch version Uladzimir Bely
2022-04-07  9:32 ` [PATCH v8 00/16] Sbuild/Schroot migration Anton Mikanovich
2022-04-07 10:15   ` Moessbauer, Felix
2022-05-04  8:56 ` Anton Mikanovich

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