From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7075595997826514944 X-Received: by 2002:ac2:598d:0:b0:443:1606:c88f with SMTP id w13-20020ac2598d000000b004431606c88fmr1698436lfn.111.1647492626798; Wed, 16 Mar 2022 21:50:26 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:b710:0:b0:249:1800:6d81 with SMTP id j16-20020a2eb710000000b0024918006d81ls809410ljo.0.gmail; Wed, 16 Mar 2022 21:50:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjuZkn+LIRte5/6YmUjADSjHrq47yiwa9gSR125Zws4p37HhmXnQtAjbcs5RSok1bGNo5e X-Received: by 2002:a2e:bf17:0:b0:248:8d0:1f7e with SMTP id c23-20020a2ebf17000000b0024808d01f7emr1789591ljr.272.1647492625684; Wed, 16 Mar 2022 21:50:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647492625; cv=none; d=google.com; s=arc-20160816; b=E0F4kiBfsW4t3S4iH0ElDFrz+PgTgJzAErAVntEKX8Tdud1o6GYAbpzwgBZwKcxDfv ThOywtdX1Xvi/8FGtaYM1nCbxyk+Jz+SN+vxXDApgRqr6p1r2YzL0+UdzBP/1uRn3+UN BRjcFvcdEPV9KtOCLT+DfhFW1IiQpCJXa+BKAUR4ZrNcIMTROCXPddjOXULtf0odI15R V9BeErnlXzEZ+GKCHA3iv+CPZwA1z/+9RIAYmwwohR86gsHL+uz2hZfZl3fjzYRWHfc8 eg/0QWRAqY+Wb7I9aOXs5eW7+vtK2xg1Aw0dgzr4wggULcTrOuk4Zhvxuw8pyiFJdTFD 2sYg== 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=eLwHxGXRX7tH7XMCDWB91mqvED2UJMhSzth8ntXfCb7wTivT8nbubQ9qFcLgHijJJx CIF+Nr6/4LoRov1yhqE1AD/A/OY/DwHjBYajhw+aMtJZyAi44RNpn/6Z18N0IuI2JNL6 V4dHJ9Vc31/T/WZkHhf1Im3LH394ctkbHkspvFqJc0G2PJF/xbdmDP4uOyBWcUsY840G dv1qd5GGZwMt++adqSN3rDCL1fEGrOx9eg/12a1d8GKBQQu7nSoCoRBRpMBfmBOqpDDG uPQQjcmKBN1ZBmq/zFakBkYNk2yg11z/irQYmjpilT10ldSIa5VG1jGiD3Mk2OQWga8X DZTA== 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 x6-20020a056512046600b00449ad17c638si137039lfd.1.2022.03.16.21.50.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Mar 2022 21:50:25 -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 22H4oLHf025716 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 17 Mar 2022 05:50:24 +0100 From: Uladzimir Bely To: isar-users@googlegroups.com Subject: [PATCH v8 08/16] dpkg: Remove builddeps install task. Date: Thu, 17 Mar 2022 05:50:13 +0100 Message-Id: <20220317045021.4018-9-ubely@ilbers.de> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220317045021.4018-1-ubely@ilbers.de> References: <20220317045021.4018-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: sittcw8t9nRh 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