From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7075595997826514944 X-Received: by 2002:adf:d1cb:0:b0:203:d2f7:43cf with SMTP id b11-20020adfd1cb000000b00203d2f743cfmr5508957wrd.287.1647415579696; Wed, 16 Mar 2022 00:26:19 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:2747:0:b0:381:80e8:be59 with SMTP id n68-20020a1c2747000000b0038180e8be59ls524957wmn.1.gmail; Wed, 16 Mar 2022 00:26:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTCWeZEjYeFttnCYMXh8uGYSb9v5ncWOuxY+0oncYzaEtuM/q+evb1l6roNipjtVp65SoV X-Received: by 2002:a1c:f719:0:b0:381:ba:5247 with SMTP id v25-20020a1cf719000000b0038100ba5247mr6355325wmh.183.1647415578693; Wed, 16 Mar 2022 00:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647415578; cv=none; d=google.com; s=arc-20160816; b=Sr0XmcI/JfdjLL9DWuSBegNaz4/AYkd9On4RyXFxD4/jvB+PWAzoOPoB7Hr0Vz1053 JbEnM4K5OGvK/BEDeQadxqwEVjXs94QQeSgjWMsR3D6gFaQLhgDoXNm8LbqKM7w4xKV2 F/dl7u/RMFbhRU9KVM6noehiL/l5PPsbQCIxOusUGxG6PTSvdTCiWzhaLCrP7nXuI28W j1qSyF4Fkkjo34LviWYj4OTzMRh4N4YtgfZuh9PshI2oU4Qbs0pVaqiVmaqGjAF9oGdm vb9TBZ28W12I5ni1ISLQNKVJCasOT2etT1egziWNpv1Id1CjawmUgTy/O/HY+XcMNI2i tQew== 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=jDP5/mulA3IBaLbm/H4LLh8TFVoL4zD78P78ZXJ2Scc=; b=v79/fs0VRoSKaS3ezFtuP5FW039TCCpkq4P0ITqRvoWkalSgG7PgG846aHkSmV3/6P T3i7qzaTeTZ+4C2nNX9bOtrfV1k18k+MrbsiJACDX/iJE47ICqi5/BvjVKsIf4G+J0pt jHUIU509c3HwMXdeuPlErezA3ct5oDTL0SgoWhwkvuze+0fVcA7YY/UI3AqZMGWz1V6l P7xvK6xrgQCOA0mPNnUljKIluvKIwV4sye8I59FciPgepx/zqVrIc1afjjnqBkfR2Bcf mJ18/JrIiumZVJ9dSlMgbu2VpFiWq1DSscP043XuOBFVJE8lEDG2O44VS8ZSk41LYmwZ niBg== 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 i12-20020a5d558c000000b001ea830df1aasi57969wrv.7.2022.03.16.00.26.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Mar 2022 00:26:18 -0700 (PDT) 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 22G7Q7dm021517 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 16 Mar 2022 08:26:18 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v8 08/15] dpkg: Remove builddeps install task. Date: Wed, 16 Mar 2022 08:26:00 +0100 Message-Id: <20220316072607.20518-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220316072607.20518-1-ubely@ilbers.de> References: <20220316072607.20518-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: r4Wk406MnqXV 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 ++++++++++++++----------------------- meta/classes/sbuild.bbclass | 1 - 2 files changed, 17 insertions(+), 28 deletions(-) diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass index b61d182d..b3931850 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() { @@ -65,6 +38,16 @@ 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}" + profiles="${@ isar_deb_build_profiles(d)}" if [ ! -z "$profiles" ]; then profiles=$(echo --profiles="$profiles" | sed -e 's/ \+/,/g') @@ -72,9 +55,16 @@ dpkg_runbuild() { export SBUILD_CONFIG="${SBUILD_CONFIG}" + echo '$apt_keep_downloaded_packages = 1;' >> ${SBUILD_CONFIG} + 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}" } diff --git a/meta/classes/sbuild.bbclass b/meta/classes/sbuild.bbclass index 6fff664f..cfd0acd5 100644 --- a/meta/classes/sbuild.bbclass +++ b/meta/classes/sbuild.bbclass @@ -8,7 +8,6 @@ SCHROOT_MOUNTS ?= "" python __anonymous() { import pwd d.setVar('SCHROOT_USER', pwd.getpwuid(os.geteuid()).pw_name) - d.setVar('SCHROOT_USER_HOME', pwd.getpwuid(os.geteuid()).pw_dir) mode = d.getVar('ISAR_CROSS_COMPILE', True) distro_arch = d.getVar('DISTRO_ARCH') -- 2.20.1