From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7075595997826514944 X-Received: by 2002:adf:facd:0:b0:20a:de99:403c with SMTP id a13-20020adffacd000000b0020ade99403cmr21053824wrs.123.1651761584064; Thu, 05 May 2022 07:39:44 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:3b0f:b0:394:7348:9f2b with SMTP id m15-20020a05600c3b0f00b0039473489f2bls206120wms.2.gmail; Thu, 05 May 2022 07:39:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGr2NM7Hf1EjA1MMDSsoKGlJP64j0UrfTNnDEbBgPAgjWC5OfPzbPGgj2H40Bp4d9VNwQ5 X-Received: by 2002:a05:600c:4fd6:b0:394:3e64:2081 with SMTP id o22-20020a05600c4fd600b003943e642081mr5158649wmq.153.1651761583041; Thu, 05 May 2022 07:39:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651761583; cv=none; d=google.com; s=arc-20160816; b=MjU7wZvrwOvFaKARc2ht9D9dcPAhdTrH6aMRFOoAosb5t+RpkX8uub0u9AqOXUnyF1 g10qs/fDgqujvv7FiyHxG80cQ8n4wGoPv8IOpc7GESOVoevePdet/v4eiUpc6Sgo2KBW b17SUdezFayMjSKBG+jZWGkICEy9farmEU8LN43Kvn81MLh7BbvzUG2XAYBosJ7bnpf6 2MfSNX3aaPaFFykOK0F9YAmHv1jYbgih/TjsOVGCJ+L7vXBgMWALySZmgGlBNlVIt24q k8rZjD8uVWVeBf8cLU4BVTi7WnYnOLWKx3hl6A6RPyAkyP4JVHg5uRMQ1C6LG9Kc9IFt PSug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from; bh=DjeZamw3OUCT8pY3FIgitMYZFkC5BZefCnwoEusnwcI=; b=NZJN7FXZ67hHBeOCHK7Jy/Zcvq56qCISO5rRT9FJ5g9oakbbqf8ZQhcRqNmlY6HvEQ CXUpb3fuw8vaPhIFm7vGbo9DaYBk77aPuxnaPiAH/XhTOdi8IOk8udUR6EsRjGBYfMD7 9nWA8a/esjOankEIFAZG0Pv6+XlyDMh9PQsMIINyWVtgxizNii2htjuECwCPWg5WXj9j MPcR6TvywMWeLBkLM+vt2Mv7et02TP8gCZpJn+JifJ74Ke+WW8gIEE8Q9iD4V23Rh3C/ hg7smSFYezlqi7UQ5C0npXtf5XFELSpTEPuvakrrzFH0oGhj+vZvPWObd3sgupjAbmER bteQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id k6-20020a05600c1c8600b0039439429409si129645wms.2.2022.05.05.07.39.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 May 2022 07:39:42 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@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 amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from localhost.localdomain (mm-0-74-214-37.mgts.dynamic.pppoe.byfly.by [37.214.74.0] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 245Edf7S014026 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 5 May 2022 16:39:42 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: adriaan.schmidt@siemens.com, Anton Mikanovich Subject: [PATCH v10 00/19] Sbuild/Schroot migration Date: Thu, 5 May 2022 17:39:15 +0300 Message-Id: <20220505143934.16096-1-amikan@ilbers.de> X-Mailer: git-send-email 2.17.1 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: Dyll8ueOAges This is a patchset showing how sbuild/schroot tools can be integrated into Isar build system. Base schroot images are created with sbuild-chroot-target or, in case of cross-build, sbuild-chroot-host recipes. These images are based on isar-bootstrap ones, but include some build-related stuff preinstalled. To use these changes you need to have sbuild and schroot installed and configured. User who runs build should be added to sbuild group. Currently, sbuild-related stuff is supported in latest kas. If Gilab CI is used, the following configuration changes are required: - external dir for schroot overlay should be set in the config /etc/gitlab-runner/config.toml: volumes = ["/path/to/overlay:/var/lib/schroot/union/overlay"] The patchset was tested with 'meta-iot2050' and 'xenomai-images' downstreams in combination with kas image mentioned above. Current limitations: - parallel building of several packages requires more free space in comparison with buildchroot-based architecture. This happens due the sbuild architecture which uses some basic layer (common for all packages) and per-package separate layer (where builddeps are downloaded and installed). Changes sinse v9: - Add caching improvement patch; - Remove per-package deb artifacts dir after usage to reduce disk space; - Improve schroot cleanup on failures. Changes since v8: - Added patch with support of package versions with epochs Changes since v7: - fixed work with proxy by adding some environment filters in sbuild; - DEB_BUILD_PROFILES support simplified and improved - Fixed gbp-based recipes rebuilding (get back --git-ignore-new option previously removed) - fixed base-apt caching for packages and source packages temporary installed in sbuild isolated environment - fixed rare build error related to ccache setup (added locking) Changes since v6: - added patch that switches sbuild from using source directory to using .dsc file. The file is generated before sbuild call by `dpkg-source`. Changes since v5: - warning about shell exports in dpkg_runbuild_prepend. This should avoided be reworked to templates. Changes since v4: - consider shell exports done in dpkg_runbuild_prepend and pass them to sbuild environment; - fixed ccache work. Changes since v3: - dpkg_do_mounts() and dpkg_undo_mounts() are not removed for downstreams compatibility; - dpkg_build_export is used for adjusting sbuild environment; - DEB_BUILD_PROFILES support for sbuild is fixed in case of cross-build. Changes since v2: - patches reworked/squashed for easier reading and understanding; - fixed building foreigh architectures with kas-docker; - implemented support of ccache; - fixed devshell and devshell_nodeps. Changes since v1: - parallel builds with different BUILD_DIR are supported; - parallel multiconfig targets in one build are supported; - per-task schroot configuration in /etc/schroot/ is now used; - patchset now passes Jenkins CI (so patches changes RFC => PATCH). *** BLURB HERE *** Anton Mikanovich (2): dpkg: Build packages with sbuild dpkg-base: Cleanup on schroot fail Felix Moessbauer (3): fix: support build of packages with epoch version always create apt-cache dirs in deb_dl_dir_import avoid absolute SCHROOT_* paths to improve caching Uladzimir Bely (14): dpkg-gbp: Use separate command to export tarball dpkg-gbp: Use host tools for dsc preparation sbuild: Add recipes for host and target rootfs to run sbuild sbuild: Introduce a class for another build method sbuild: Support of DEB_BUILD_PROFILES sbuild: Support of shell exports from dpkg_runbuild_prepend dpkg: Remove builddeps install task sbuild: Add ccache support dpkg-base: Switch devshell to use schroot dpkg-base: Switch apt_fetch and apt_unpack to use schroot doc: Add sbuild-related documentation sbuild: Use .dsc file instead of source directory sbuild: Fixed proxy support sbuild: Fix debsrc_download for packages dependencies doc/user_manual.md | 22 ++- meta/classes/deb-dl-dir.bbclass | 6 +- meta/classes/dpkg-base.bbclass | 88 ++++++---- meta/classes/dpkg-gbp.bbclass | 26 +-- meta/classes/dpkg.bbclass | 109 +++++++++--- meta/classes/sbuild.bbclass | 159 ++++++++++++++++++ meta/conf/bitbake.conf | 2 + .../sbuild-chroot/sbuild-chroot-host.bb | 13 ++ .../sbuild-chroot/sbuild-chroot-target.bb | 10 ++ .../sbuild-chroot/sbuild-chroot.inc | 39 +++++ 10 files changed, 394 insertions(+), 80 deletions(-) create mode 100644 meta/classes/sbuild.bbclass create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb create mode 100644 meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc -- 2.17.1