From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7114179385042665472 X-Received: by 2002:a05:6870:1f05:b0:144:5572:4af6 with SMTP id pd5-20020a0568701f0500b0014455724af6mr3735299oab.230.1673510492608; Thu, 12 Jan 2023 00:01:32 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6870:3a2a:b0:150:5959:52ad with SMTP id du42-20020a0568703a2a00b00150595952adls503497oab.3.-pod-prod-gmail; Thu, 12 Jan 2023 00:01:30 -0800 (PST) X-Google-Smtp-Source: AMrXdXsp6vkdUSovU1pFT51L7nyHMVIhrYRwQXkWYTiA5DjxsXaebjldUxcGROSkIZ812lk+7+Y/ X-Received: by 2002:a05:6870:6086:b0:152:8714:532b with SMTP id t6-20020a056870608600b001528714532bmr12998338oae.47.1673510490054; Thu, 12 Jan 2023 00:01:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673510490; cv=none; d=google.com; s=arc-20160816; b=N47jm0WGiu6ol1M/BsWAZDML/LRgKjJr/nMRVZNivkoUfuzmRQqcSIQLyz7nB6JOtI +4Ym+UUMLVonoHhaHMXYg7Vry/q92ACvwouOlV207B1PQapIrCl16LNV881bm5gQlJ9R KAFTdAWNjVVQUh+l1r6A2Nb3YWuKRnXHXdFWH2mUDT3zAAZ2OGa0s26FCR3FDZ0f5JHd 39H8GC5tqfL29pRuP4Mta6BzjhYxK5xdzjE8qlbUs+vHbXBoDvlBO2ECZ0vZr5tZ4/Eq IaIt0I0wuP8xvkx0/lr2InVSN/OQ1O07Dr6CeKUNGJeITW08slO8xBs3OsI/LvsHVDT9 pLmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from; bh=NPcJULVgWsPKx/tEDxAHLKyooFAmbUn/Pe8xiPd6RMQ=; b=m3yqsk7SohsBcmBRBWf7UjnIli1+iJP6GXdcAjwdecH18uG9vE/U/jeGkZCpAJCVys 7SIU76IJb/8KHrd0BUx61VG7e5xGyiVzKVm9RnD7h95uud0y8JR87ECvkZc1cp+WtPYq 3OEp5kGreH1XeBP93FVx/+5twuE9VXLTY4hiWMxYOHlCI3vk8kqqzFgSz9YoblXXHiBZ lLyJ+iM78UrSp5ZH20atXjVkprXj8foRcTgAfwctaVSRGFmYqTRMY9uKvaQar90SQM9t yHDQEm7SCxiwTFkShkQfImowdJb7XRQvcLd7GBARhcc1vAA/ShKmhs53mXI0/mBjJXiu N08w== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id z15-20020a056871014f00b0015452b4f27asi1641751oab.3.2023.01.12.00.01.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 12 Jan 2023 00:01:29 -0800 (PST) Received-SPF: pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of ubely@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=ubely@ilbers.de Received: from home.localnet (44-208-124-178-static.mgts.by [178.124.208.44] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 30C81Q0q021225 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Jan 2023 09:01:26 +0100 From: Uladzimir Bely To: Anton Mikanovich , isar-users@googlegroups.com, Jan Kiszka Subject: Re: [PATCH v12 05/21] dpkg: Build packages with sbuild Date: Thu, 12 Jan 2023 11:01:21 +0300 Message-ID: <2066274.BFZWjSADLM@home> In-Reply-To: <7515b359-4ebf-7214-074c-b258078efbd0@siemens.com> References: <20220628064913.27938-1-amikan@ilbers.de> <20220628064913.27938-6-amikan@ilbers.de> <7515b359-4ebf-7214-074c-b258078efbd0@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: S/r8RNqBK7lI In the email from Wednesday, 11 January 2023 23:59:05 +03 user Jan Kiszka wrote: > On 28.06.22 08:48, Anton Mikanovich wrote: > > 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 > > Signed-off-by: Uladzimir Bely > > --- > > > > 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 7e032ba..dbe35f4 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 > > > > @@ -175,6 +178,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}" > > > > @@ -200,6 +204,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" > > > > @@ -222,14 +235,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 > > > > @@ -259,7 +269,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" > > > > @@ -269,15 +279,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 2b0b818..68172b3 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" > > + > > This was always (at least in-tree) dead code because insert_mounts() was > never invoked. What was this setting here supposed to achieve? > > Jan Hello. You could look at these patches from early stage of isar/sbuild story https://groups.google.com/g/isar-users/c/vNcgAkbdECI/m/NhROnwKOAgAJ https://groups.google.com/g/isar-users/c/QBhw8FUwCe0/m/aDd3hY4oAwAJ We didn't have proper "git alternates" solution at that time so mounting '.git' was used. For now, these mounts might not be needed and we probably could remove these mountpoints and related code.