From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7032253102499561472 X-Received: by 2002:a17:906:ae07:: with SMTP id le7mr7246910ejb.132.1638968751560; Wed, 08 Dec 2021 05:05:51 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:907:3d8e:: with SMTP id he14ls724565ejc.6.gmail; Wed, 08 Dec 2021 05:05:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzHK1GCVsi5mCRTTM9mh/Tkb4l08La9+7facql9/vNQG1fzYXB77OeBC/r5M0H9qtw9cztL X-Received: by 2002:a17:906:3b84:: with SMTP id u4mr7100564ejf.310.1638968750417; Wed, 08 Dec 2021 05:05:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1638968750; cv=none; d=google.com; s=arc-20160816; b=ayu1WjLK9d3//0ZOdMU2yL4e7sB+9c/oskGR9ePaPFRaMmiQICaKPuC/xQBM1BZ0Pt XFTb/v0WJeBim3LbFEvwTIPuToOUZGsleWPv0yVoSA+mT4krqoWqZHxYCEpMObU01yov 3Xgwx5Zomi9dohgvbdZdWA/GhwciGm08YwtVovAwqV0RgF+Q075ERdYGZS5VBEfxIFC5 2XuT3q9qnb3wlQFDOxZMeB6PzHitZ6cB7G9P3cXWwN/MPwORtpqGj0xpvYLpjkfX2gN1 Uh4YPn9J5ixAVp0yHYNZ89FqkrxhxTGxICShdH6rhSTsxYja08mKq3Vz75UG6aeAhiAy GKcA== 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=PH3QeHC6bRPTNao0RLZ0TJ6LCObYGYs8PaFMD9/uNYE=; b=Jx8xnm6oQFQcDsKhtWiLdUJ/lqd1zOi8E4TMV0mZTwHsIQSVTW3s6cS35+c0UNgeWx SWe/piLokNVRMfGffRGFVOmVgwgyMNGcpXZMA8ranE9XdLzM97jlaOBZfscMM7Rmuj4N qgdMGOqgDYiWWNxSmC+NJBEV9428vs8cp9UlUTfuMYNS0L1fxHkx0T4JRy59KUlCsQ3H bbMHgFDNwk1ZDUopEXhQduI5L3kPn66+kegeVpGl121M+zDbg2lBiYdYoORDhMScNEdz u5KZtojkixrsOqpBn09klUaSkZ87nfMKtolFHItwK3AfxXrt0xXJ8ha2rkjz1U6ZE3tZ TmhQ== 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 e10si213568edz.5.2021.12.08.05.05.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 Dec 2021 05:05:50 -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 1B8D5iLG009193 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 8 Dec 2021 14:05:49 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v3 15/20] dpkg: Remove builddeps install task. Date: Wed, 8 Dec 2021 14:05:39 +0100 Message-Id: <20211208130544.15133-16-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20211208130544.15133-1-ubely@ilbers.de> References: <20211208130544.15133-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: Abs81shVoh7S 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 6cd0f7d1..fe5a6011 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() { @@ -37,12 +14,32 @@ 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" + sbuild -A -n -c ${SBUILD_CHROOT} --extra-repository="${ISAR_APT_REPO}" \ --host=${PACKAGE_ARCH} --build=${SBUILD_HOST_ARCH} \ --starting-build-commands="runuser -u ${SCHROOT_USER} -- sh -c \"${SBUILD_PREBUILD:-:}\"" \ --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="-d --source-option=-I" \ --build-dir=${WORKDIR} ${WORKDIR}/${PPS} + deb_dl_dir_export "${WORKDIR}/rootfs" "${distro}" + schroot_delete_configs } -- 2.20.1