From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7057122428766388224 X-Received: by 2002:a05:6512:3055:: with SMTP id b21mr6661958lfb.621.1644738304844; Sat, 12 Feb 2022 23:45:04 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac2:4e11:: with SMTP id e17ls1296238lfr.1.gmail; Sat, 12 Feb 2022 23:45:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJzoWkcOEIpJOS8dHlTmTkCSxxuQhsrOGkYZ6nN/cSKURQqC7xxG+yqBqnbVNMa73Y2lCuiS X-Received: by 2002:ac2:529a:: with SMTP id q26mr6565595lfm.23.1644738303930; Sat, 12 Feb 2022 23:45:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644738303; cv=none; d=google.com; s=arc-20160816; b=ns61RIsJoCQ3NOhiB5EWUN9o8tN51SseoLWQpU0251k0mGJwZkUpLrA5faJGOuwJSd 52XFWdhdxRIOQgQDftrSD8uPyhud4i/3zTGV+GYnOAgcAoJX5bsarczwsj7S3oKkH/YH ue1NE7TjOTwExjCvPYysLv9idN4yERXZobyKhnEIqCy2NxGTFx82dbu8GALDC2bCN3g4 K3T5HjIW79W8rtMseDg2p20na+wV13V51zS56jJ3sPByJYDJr6eKuhh5Byj07XsKA4Da UFK4IepGqwSeY3vmap4beqhW2sHmORu1cbgmQOyTlzFoLoZ07N43ejtCVO0/mspLG03g PNUA== 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=agEHayHVFnfxGhwm3daR+Z5kwKelfKOScob1C6OW1Gx5On6bGa5w5pTN7N7e+Te4LE 7vItw6mlsYxIx4qP5rcKWklg60MQj7c8WFnu9BLudd/T5QcjmEC/sG5EsPPcUKznruA+ 3bnbKgfki8dKEEJBXmXIGlRnG7u0ggszlVM39uEcNAtZr1lsfQ/XfpQIQV/UCYpcNJMe kpd+GPslhghInI/dY+UBQxTq/tybcXCRykq+7rVeiFBE/7FSr5Fw822Wgc+h8kzopXsZ xiC5EdghqbL0oOUl+CsVdTn+CZbTa4xEG55Y1R8sxzNdQnJjydD0ethek+qvYFwJWKYd fMWw== 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 o24si1655245lfb.1.2022.02.12.23.45.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 12 Feb 2022 23:45:03 -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 21D7j0Ba010453 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sun, 13 Feb 2022 08:45:03 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v7 08/13] dpkg: Remove builddeps install task. Date: Sun, 13 Feb 2022 08:44:54 +0100 Message-Id: <20220213074459.24200-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220213074459.24200-1-ubely@ilbers.de> References: <20220213074459.24200-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: 1ERTl1lDQIJ5 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