From: Henning Schild <henning.schild@siemens.com>
To: Alexander Smirnov <asmirnov@ilbers.de>
Cc: <isar-users@googlegroups.com>
Subject: Re: [RFC][PATCH 2/6] base-apt: Add to pipeline
Date: Wed, 3 Jan 2018 18:24:18 +0100 [thread overview]
Message-ID: <20180103182418.17f4cb5e@mmd1pvb1c.ad001.siemens.net> (raw)
In-Reply-To: <20180102145744.21814-3-asmirnov@ilbers.de>
Am Tue, 2 Jan 2018 17:57:40 +0300
schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> Add 'base-apt' recipe to build pipeline.
>
> Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> ---
> meta-isar/conf/local.conf.sample | 5 +++++
> meta/classes/dpkg-base.bbclass | 14 ++++++++++++++
> meta/classes/image.bbclass | 13 ++++++++++++-
> meta/recipes-devtools/base-apt/base-apt.bb | 5 ++++-
> meta/recipes-devtools/buildchroot/buildchroot.bb | 12 ++++++++++++
> 5 files changed, 47 insertions(+), 2 deletions(-)
>
> diff --git a/meta-isar/conf/local.conf.sample
> b/meta-isar/conf/local.conf.sample index 660958f..2da803b 100644
> --- a/meta-isar/conf/local.conf.sample
> +++ b/meta-isar/conf/local.conf.sample
> @@ -162,3 +162,8 @@ BB_NUMBER_THREADS = "4"
> #
> # Number of attempts to try to get reprepro lock for access to apt
> cache REPREPRO_LOCK_ATTEMPTS = "16"
> +
> +#
> +# List of images, wich dependencies will be pre-fetched and put in
> base-apt. +# This will guarantee image building reproducibility.
> +BASE_APT_IMAGES ?= "isar-image-base isar-image-debug"
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass index ad58f0b..c61f9a6 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -8,6 +8,20 @@ do_build[depends] = "buildchroot:do_build"
> # recipe name as identifier
> PP = "/home/builder/${PN}"
>
> +do_get_deps[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> +
> +S = "${WORKDIR}/${SRC_DIR}"
> +
> +do_get_deps() {
> + if [ -e ${S}/debian/control ]; then
> + mkdir -p ${BASE_APT_DIR}/deps
> + DEPS=$(perl -ne 'next if /^#/; $p=(s/^Build-Depends:\s*/ /
> or (/^ / and $p)); s/,|\n|\([^)]+\)|\[[^]]+\]//mg; print if $p' <
> ${S}/debian/control)
> + echo $DEPS > ${BASE_APT_DIR}/deps/${PN}
> + fi
> +}
This perl expression has another issue, it does not handle the
|-operator, which is also valid in Build-Depends.
https://www.debian.org/doc/debian-policy/ (7.1)
In fact this code fails for a lot of valid rules-files. It can also not
handle the architecure selection operator [] and it ignores
Build-Depends-Indep.
To sum up, this is very broken and should be replaced with something
official that hopefully works.
"mk-build-deps" looks promising, it generates a meta-package out of a
given control-file. I will look into replacing the perl with
mk-build-deps.
Henning
> +addtask get_deps after do_unpack before do_build
> +
> BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
>
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index e2cb01b..457a525 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -66,6 +66,17 @@ do_cache_config() {
>
> addtask cache_config before do_populate
>
> +IMAGE_PREINSTALL ?= ""
> +do_get_deps[stamp-extra-info] = "${DISTRO}-${MACHINE}"
> +
> +do_get_deps() {
> + mkdir -p ${BASE_APT_DIR}/deps
> + echo ${IMAGE_PREINSTALL} > ${BASE_APT_DIR}/deps/${PN}
> +}
> +
> +addtask get_deps before do_build after do_unpack
> +do_get_deps[deptask] = "do_get_deps"
> +
> do_populate[stamp-extra-info] = "${DISTRO}-${MACHINE}"
>
> # Populate Isar apt repository by newly built packages
> @@ -79,7 +90,7 @@ do_populate() {
> fi
> }
>
> -addtask populate before do_build after do_unpack
> +addtask populate before do_build after do_get_deps
> do_populate[deptask] = "do_deploy_deb"
>
> do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}"
> diff --git a/meta/recipes-devtools/base-apt/base-apt.bb
> b/meta/recipes-devtools/base-apt/base-apt.bb index b292d89..108d501
> 100644 --- a/meta/recipes-devtools/base-apt/base-apt.bb
> +++ b/meta/recipes-devtools/base-apt/base-apt.bb
> @@ -13,7 +13,10 @@ SRC_URI = "file://distributions.in \
> file://multistrap.conf.in \
> "
>
> -BASE_PREINSTALL ?= ""
> +DEPENDS = "${BASE_APT_IMAGES} buildchroot"
> +do_get_base_apt[deptask] = "do_get_deps"
> +
> +BASE_PREINSTALL ?= "apt"
>
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb
> b/meta/recipes-devtools/buildchroot/buildchroot.bb index
> 59ad0e0..098f5c7 100644 ---
> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -29,8 +29,20 @@
> BUILDCHROOT_PREINSTALL ?= "gcc \
> WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>
> +do_get_deps[stamp-extra-info] = "${DISTRO}-${MACHINE}"
> +
> +do_get_deps() {
> + mkdir -p ${BASE_APT_DIR}/deps
> + echo ${BUILDCHROOT_PREINSTALL} > ${BASE_APT_DIR}/deps/${PN}
> +}
> +
> +addtask get_deps before do_build after do_unpack
> +do_get_deps[deptask] = "do_get_deps"
> +
> +
> do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> do_build[dirs] = "${WORKDIR}/hooks_multistrap"
> +do_build[depends] = "base-apt:do_get_base_apt"
>
> do_build() {
> E="${@ bb.utils.export_proxies(d)}"
next prev parent reply other threads:[~2018-01-03 17:24 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-02 14:57 [RFC][PATCH 0/6] Isar build reproducibility Alexander Smirnov
2018-01-02 14:57 ` [RFC][PATCH 1/6] base-apt: Introduce fetching upstream apt Alexander Smirnov
2018-01-02 16:15 ` Jan Kiszka
2018-01-02 17:02 ` Alexander Smirnov
2018-01-03 13:15 ` Henning Schild
2018-01-02 16:20 ` Jan Kiszka
2018-01-02 14:57 ` [RFC][PATCH 2/6] base-apt: Add to pipeline Alexander Smirnov
2018-01-03 13:32 ` Henning Schild
2018-01-03 17:24 ` Henning Schild [this message]
2018-01-02 14:57 ` [RFC][PATCH 3/6] buildchroot: Switch to base-apt Alexander Smirnov
2018-01-02 14:57 ` [RFC][PATCH 4/6] buildchroot: Add mount/umount for 'base-apt' Alexander Smirnov
2018-01-02 14:57 ` [RFC][PATCH 5/6] image: Switch to base-apt Alexander Smirnov
2018-01-02 14:57 ` [RFC][PATCH 6/6] base-apt: Add possibility to reuse Alexander Smirnov
2018-01-02 16:09 ` [RFC][PATCH 0/6] Isar build reproducibility Jan Kiszka
2018-01-02 16:58 ` Alexander Smirnov
2018-01-02 17:07 ` Jan Kiszka
2018-01-02 17:25 ` Jan Kiszka
2018-01-03 13:49 ` Henning Schild
2018-01-03 13:54 ` Jan Kiszka
2018-01-03 14:03 ` Henning Schild
2018-01-03 14:06 ` Jan Kiszka
2018-01-09 7:45 ` Alexander Smirnov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180103182418.17f4cb5e@mmd1pvb1c.ad001.siemens.net \
--to=henning.schild@siemens.com \
--cc=asmirnov@ilbers.de \
--cc=isar-users@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox