public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Subject: [PATCH 3/4] sbuild-chroot: Pre-install cross-compiler and libc6-dev
Date: Mon,  9 Jan 2023 06:32:34 +0100	[thread overview]
Message-ID: <386d288ca3eff0555ffe1a6b1267f9b926a7ee5c.1673242355.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1673242355.git.jan.kiszka@siemens.com>

From: Jan Kiszka <jan.kiszka@siemens.com>

This saves build setup time by pre-installing not only build-essential
but - for cross and compat-arch cases - also the cross-compiler as well
as libc6-dev.

The latter is coming via build-essential in the native case, it's not
installed by crossbuild-essential but sbuild is pulling it. We can
install libc6-dev:${DISTRO_ARCH} unconditionally as this becomes a not
in the native case.

Things brings sbuild on eye-level with buildchroot regarding the initial
build environment, even goes beyond as buildchroot used to install only
libc6:<target-arch>.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 .../sbuild-chroot/sbuild-chroot-host.bb               | 11 +++++++++++
 .../sbuild-chroot/sbuild-chroot-target.bb             |  4 ++++
 meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc | 10 ++++++----
 3 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
index a37e49b7..c0015721 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
@@ -12,3 +12,14 @@ require sbuild-chroot.inc
 ROOTFS_ARCH = "${HOST_ARCH}"
 ROOTFS_DISTRO = "${HOST_DISTRO}"
 ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
+
+SBUILD_CHROOT_PREINSTALL ?= " \
+    ${SBUILD_CHROOT_PREINSTALL_COMMON} \
+    crossbuild-essential-${DISTRO_ARCH} \
+    "
+
+SBUILD_CHROOT_PREINSTALL_riscv64 ?= " \
+    ${SBUILD_CHROOT_PREINSTALL_COMMON} \
+    gcc-riscv64-linux-gnu \
+    g++-riscv64-linux-gnu \
+    dpkg-cross"
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
index d75d783b..8f2da720 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
@@ -8,3 +8,7 @@ DESCRIPTION = "Isar sbuild/schroot filesystem for target"
 SBUILD_VARIANT = "target"
 
 require sbuild-chroot.inc
+
+SBUILD_CHROOT_PREINSTALL ?= " \
+    ${SBUILD_CHROOT_PREINSTALL_COMMON} \
+    "
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index fa4a295c..08a2d55d 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -10,7 +10,13 @@ PV = "1.0"
 
 inherit rootfs
 
+SBUILD_CHROOT_COMPAT_PREINSTALL_compat-arch = " \
+    libc6-dev:${COMPAT_DISTRO_ARCH} \
+    crossbuild-essential-${COMPAT_DISTRO_ARCH}"
+
 SBUILD_CHROOT_PREINSTALL_COMMON = " \
+    ${SBUILD_CHROOT_COMPAT_PREINSTALL} \
+    libc6-dev:${DISTRO_ARCH} \
     fakeroot \
     build-essential \
     debhelper \
@@ -19,10 +25,6 @@ SBUILD_CHROOT_PREINSTALL_COMMON = " \
     equivs \
 "
 
-SBUILD_CHROOT_PREINSTALL ?= " \
-    ${SBUILD_CHROOT_PREINSTALL_COMMON} \
-"
-
 SBUILD_CHROOT_DIR = "${WORKDIR}/rootfs"
 ROOTFSDIR = "${SBUILD_CHROOT_DIR}"
 ROOTFS_PACKAGES = "${SBUILD_CHROOT_PREINSTALL}"
-- 
2.35.3


  parent reply	other threads:[~2023-01-09  5:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  5:32 [PATCH 0/4] sbuild-chroot optimizations Jan Kiszka
2023-01-09  5:32 ` [PATCH 1/4] sbuild-chroot: Only install ccache is used Jan Kiszka
2023-01-20  8:28   ` Jan Kiszka
2023-01-09  5:32 ` [PATCH 2/4] crossbuild-essential-riscv64: Drop unneeded crossbuild disabling Jan Kiszka
2023-01-09  5:32 ` Jan Kiszka [this message]
2023-01-09  5:56   ` [PATCH 3/4] sbuild-chroot: Pre-install cross-compiler and libc6-dev Moessbauer, Felix
2023-01-09  7:45     ` Jan Kiszka
2023-01-09  5:32 ` [PATCH 4/4] sbuild-chroot: Pre-install also libcpp-*-dev and libstdc++-*-dev Jan Kiszka
2023-01-24  7:33 ` [PATCH 0/4] sbuild-chroot optimizations Uladzimir Bely

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=386d288ca3eff0555ffe1a6b1267f9b926a7ee5c.1673242355.git.jan.kiszka@siemens.com \
    --to=jan.kiszka@siemens.com \
    --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