From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057122428766388224 X-Received: by 2002:a05:6512:2306:: with SMTP id o6mr16806891lfu.144.1643114360290; Tue, 25 Jan 2022 04:39:20 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3c97:: with SMTP id h23ls2017244lfv.2.gmail; Tue, 25 Jan 2022 04:39:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9MsPZKxzpfjy38G3f+44uzJtdctRN7PELM1OVI4ZG18VVYW8vt48AC52O3LTsoLmGPScf X-Received: by 2002:a05:6512:4020:: with SMTP id br32mr7256152lfb.654.1643114359369; Tue, 25 Jan 2022 04:39:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643114359; cv=none; d=google.com; s=arc-20160816; b=dn3JyZyApC0/B6a/ZqzNE6UEAUSzW+R/zvRiIIrChqM+lNlCumJLGqNgrTd4NU7DEe +KM8NRZrLXCOk0kxS+t6ZENe/rUtr5U2Uer8nlDhyAlyIRVWC978jocPzOBg0JdjBnJj vB3b18t+KrKPGN0YRj+HUhllYF+C9YWK10NrZ5clWkgc0QrBM74PszPODjOT2sdtUHkp LZXxcHupINWkPIBPmNKRN2e/PP2Sf/Aupuaq+59P1hjX32BiuaYJwdm1eQTMHEBtQyKq Z1Elg8BD2Xy/Z5h+brsEv884gdOxw71OBChPlAHCvcjKOfDk6sh106rV3IF9aNvmtDDp bnPg== 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=wctSfpC56y1m7dNlccu5+mrrKs8k8ys7pRxiiIi6z5c=; b=g9IvJ6yzQHYDGIYvHgWcd10jWI4TPbVRDF8zbZWxHwZbGnObC2g+C2zXjV7XH2HTw4 Cw4awLq59mLWsmPwHrysiKDDZHBSMpoGz1JKvBMAJBOFxwQ7LFE4/8ROJZJdGI5aaSqQ xcA6wq95Bx+fOInIa0ACkOBoQM9h9dko7Q+uIwgeqXhIPdkNo4xyvoddG3PHGy0W0y2P amJmaYa0/w0lnFo7a82PVHFcPZio2e7uXBv0G0i60V6EBgSrD3XQ0vbpd6emKgCM+dSy XQXERG5mmJBZ45X1glf5JvFCvNU6s27XjDCtfqm1g8os+CeaUK1t69U0Y4FIyoY2U7Xq /qJA== 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 q5si603202lfg.3.2022.01.25.04.39.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 25 Jan 2022 04:39:19 -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 baighyz.m.ilbers.de (host-80-81-17-52.static.customer.m-online.net [80.81.17.52]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 20PCdFmi019254 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 25 Jan 2022 13:39:18 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v4 08/12] dpkg: Remove builddeps install task. Date: Tue, 25 Jan 2022 13:39:11 +0100 Message-Id: <20220125123915.1053-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220125123915.1053-1-ubely@ilbers.de> References: <20220125123915.1053-1-ubely@ilbers.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: tRTMN8QnZsFK 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 --- meta/classes/dpkg.bbclass | 43 ++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index e761078d..38845a16 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -5,30 +5,7 @@ inherit dpkg-base PACKAGE_ARCH ?= "${DISTRO_ARCH}" -# Install build dependencies for package -do_install_builddeps() { - dpkg_do_mounts - E="${@ isar_export_proxies(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 - # Build package from sources using build script dpkg_runbuild() { @@ -38,6 +15,21 @@ dpkg_runbuild() { schroot_create_configs + 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}" + + ( flock 9 + grep -qxF '$apt_keep_downloaded_packages = 1;' ${SCHROOT_USER_HOME}/.sbuildrc || + echo '$apt_keep_downloaded_packages = 1;' >> ${SCHROOT_USER_HOME}/.sbuildrc + ) 9>"${TMPDIR}/sbuildrc.lock" + if [ ${USE_CCACHE} -eq 1 ]; then schroot_configure_ccache fi @@ -53,8 +45,13 @@ 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="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}" + schroot_delete_configs } -- 2.20.1