From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057122428766388224 X-Received: by 2002:aa7:c5ce:: with SMTP id h14mr25812738eds.18.1643734871111; Tue, 01 Feb 2022 09:01:11 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:907:2da6:: with SMTP id gt38ls8375175ejc.9.gmail; Tue, 01 Feb 2022 09:01:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmya1VldvvCCJyjYScT1DMwdMwDkJfXl/e1pqcBxifUMmEG6f58O4HdtyCJ6wjNOgKxtdE X-Received: by 2002:a17:906:8345:: with SMTP id b5mr22125856ejy.355.1643734870133; Tue, 01 Feb 2022 09:01:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643734870; cv=none; d=google.com; s=arc-20160816; b=POl4ppdLFHqTgtoMl/egNbWHX5No1RzZdRduoM2ilkmzETFbRaZyB9Da/j773r1/M8 +N6NAd8Wv7ziMrZkLzUN1SZ7wjeK0WaBhVhL+KkrVbxwvzVbub1W4ZOIkWlVmKzJeZLe v7/lnmOqonUNud1MAhGEbVK+mT7+CTLM+LywqadgQK4hkczQo6vO4AZslKVW4lzlsVlp Mb60KMHeRDz5+JXpaiV5X+dCNF1WSw9KPb4HyBgPsl0lDbviKPBcvIoRUBzN4StuGftw 9W+0BwiJDQiXuxTbQJdqnTQcvYghNrg2MuUhdeGuKVmesJRxo6mrmkNKX6ysHgKyQ7C7 Fpdw== 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=JN4zU2Pg9MQN3/FMzmtWfChRScg3LUoehv3ZS+P2ZIc=; b=FhOctEeq/5krlnwl+PYqz9TQ1Ms1x8IFr4ZFtLuihM3x2XM/gls7bpvac+1bconuim 7kByR7VY2nlwfk0lLSXwjbu/H6Ac1GWXExAiY5mlRRxHwKO+8MHGcmkR1PRf+G244wkH IN+ocRZnA7NFo3n+MZ1ZVlrVPFbK5n+QG17z2qp+QaMaN+HaM1kpXYJoDeSIzr/4pGOU nMN1/I7Ud9RqD/ZNHkswOSoX+PnvTzq4JPNYwvcOs7IVKT/SaXW+tVPGoOdHywdIw1rn eiMYKCyXnzWXDlM3+jpfjYQ+UKIXZaHHXpqdfOqiCFaTEGNvznOGnazMDjkwK27cQPDA MLIQ== 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 s15si778840eji.1.2022.02.01.09.01.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 01 Feb 2022 09:01:10 -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 211H0cAC019722 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 1 Feb 2022 18:01:09 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v5 08/12] dpkg: Remove builddeps install task. Date: Tue, 1 Feb 2022 18:00:34 +0100 Message-Id: <20220201170038.5723-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220201170038.5723-1-ubely@ilbers.de> References: <20220201170038.5723-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: DGTb1bHh+0vv 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 | 44 ++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index c252e9b3..8f311deb 100644 --- a/meta/classes/dpkg.bbclass +++ b/meta/classes/dpkg.bbclass @@ -5,30 +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)}" - 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() { @@ -53,6 +29,21 @@ dpkg_runbuild() { sbuild_export $var "$value" 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}" + + ( 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" + profiles=$(grep "DEB_BUILD_PROFILES" ${SBUILD_CONFIG} | tail -n1 | cut -d "'" -f 4) if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then profiles="${profiles} cross nocheck" @@ -66,6 +57,11 @@ 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}" } -- 2.20.1