From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057122428766388224 X-Received: by 2002:a05:651c:4cd:: with SMTP id e13mr3979151lji.511.1644475585135; Wed, 09 Feb 2022 22:46:25 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:22d1:: with SMTP id g17ls2369408lfu.2.gmail; Wed, 09 Feb 2022 22:46:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJxBYtPROfJbNKfq9pqBa+V8Tmi5yk7AaW/g8fF2fK/ZWsnhyNbitTs6bTBx+C42Xx/m3WGn X-Received: by 2002:a05:6512:2391:: with SMTP id c17mr4206821lfv.307.1644475584216; Wed, 09 Feb 2022 22:46:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644475584; cv=none; d=google.com; s=arc-20160816; b=l+bNYK/jYVpjyq4NTneA3g995SroYXO6qP4OUUAE0lh1CYd2pM6aFn8bOig94nNtt7 gdBxEjeuYXgSyIIF1YUQLNHL6Jqp7NTCCC3BDy8b62EB8u8nv1g/9arVGwnCvsZ+Ka0T uwaLz5fZinC9r/yaChOfklrddURpPhkIxRIlJFMJLcv275TKS0wgaAkxAzgnOl3YjkmN XM5cfld+0a04HJJIVX3Vo/Hd5x5eVXxJvnP1OvuFRvNiCBWmduS9bfivSjky01N3eI5B NI5hx/XRjp6Vb8y0eHXOAo7hS2F6aAEaV7AK8ZHAMeervEyvpQBJ3dqORe0JVGuj9afa xfVw== 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=b2tFEX0Tuv82QIn5m8O0EploujY2z0s+Hv3Z+sg7O3E=; b=W8TMDoQOVS0NVCkAFXshUuGWMQzcFKryZZK+DmcO3iS45RFES+LMElJEhAlmhFkNNa zgM82y9uLPuw2BFIwhcCw4BvLEdw+IHq/V5kDIXBZc0DftHKDz+xfNp2RPmMY9GD7Xyp iBwLN5n1i9HOv2eb4dNoXNncAheh8ZwBNcfJakBhu8u0QoYauOg6rYS7v56OR5aG38jl Q17QJOxt6KtPV21QNk5z3SOR9JZqfqkKRQyiqj2qjMksZcLl/CQHIYAOK7kDQ8Q/D5gP PcjFvpUS57Kp2WUhseD8/gFxOtzNq65VjfHJkGhlZO/02nTAAzRiOIcKo/ZUJhhBJhwA QG8Q== 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 d4si405092lfs.13.2022.02.09.22.46.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 09 Feb 2022 22:46:24 -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 21A6kKrA028169 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 10 Feb 2022 07:46:23 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v6 08/12] dpkg: Remove builddeps install task. Date: Thu, 10 Feb 2022 07:46:16 +0100 Message-Id: <20220210064620.4392-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220210064620.4392-1-ubely@ilbers.de> References: <20220210064620.4392-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: G/1du8gEPBw5 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 | 47 +++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index 82a722df..4cf405ad 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() { @@ -67,6 +40,21 @@ 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}" + + ( 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" @@ -80,6 +68,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