public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Fix imager-buildchroot dependency
@ 2021-07-14  6:52 Anton Mikanovich
  2021-07-14  6:52 ` [PATCH v3 1/3] buildchroot: Introduce buildchroot dependency variable Anton Mikanovich
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Anton Mikanovich @ 2021-07-14  6:52 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

If using imager with ISAR_CROSS_COMPILE="1" it still depends on
buildchroot-target because of hardcoded flag value. Moreover, there were
no way to depends on buildchroot based on logic placed in python
anonymous function in buildchroot.bbclass. It forced developer to place
dependency set code inside buildchroot choose logic for any tasks like
do_apt_fetch was implemented.
To be able to set dependencies in places where they were implemented but
still take care about cross compile modes we need to put buildchroot
choose result into datastore variable and rely on it later.

Anton Mikanovich (3):
  buildchroot: Introduce buildchroot dependency variable
  buildchroot: Move apt_fetch dependency to dpkg-base
  image: Fix do_install_imager_deps dependency

 meta/classes/buildchroot.bbclass           | 4 ++--
 meta/classes/dpkg-base.bbclass             | 3 +++
 meta/classes/image-tools-extension.bbclass | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 1/3] buildchroot: Introduce buildchroot dependency variable
  2021-07-14  6:52 [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
@ 2021-07-14  6:52 ` Anton Mikanovich
  2021-07-14  6:52 ` [PATCH v3 2/3] buildchroot: Move apt_fetch dependency to dpkg-base Anton Mikanovich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2021-07-14  6:52 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

To allow setting dependencies on proper BUILDCHROOT based on
ISAR_CROSS_COMPILE value we need to save propriate build task in
datastore variable to use it later in task recipes.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/buildchroot.bbclass | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 806a29f..0db6ef9 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -18,6 +18,7 @@ python __anonymous() {
         rootfs = d.getVar('BUILDCHROOT_HOST_DIR', True)
 
     d.setVarFlag('do_apt_fetch', 'depends', dep)
+    d.setVar('BUILDCHROOT_DEP', dep)
     d.setVar('BUILDCHROOT_DIR', rootfs)
 }
 
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 2/3] buildchroot: Move apt_fetch dependency to dpkg-base
  2021-07-14  6:52 [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
  2021-07-14  6:52 ` [PATCH v3 1/3] buildchroot: Introduce buildchroot dependency variable Anton Mikanovich
@ 2021-07-14  6:52 ` Anton Mikanovich
  2021-07-14  6:52 ` [PATCH v3 3/3] image: Fix do_install_imager_deps dependency Anton Mikanovich
  2021-07-26 15:06 ` [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
  3 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2021-07-14  6:52 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Buildchroot should not care about all the task depends on it, so we
should move do_apt_fetch dependency to the place where this task was
implemented.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/buildchroot.bbclass | 3 +--
 meta/classes/dpkg-base.bbclass   | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/classes/buildchroot.bbclass b/meta/classes/buildchroot.bbclass
index 0db6ef9..f77e4f0 100644
--- a/meta/classes/buildchroot.bbclass
+++ b/meta/classes/buildchroot.bbclass
@@ -5,7 +5,7 @@
 
 ISAR_CROSS_COMPILE ??= "0"
 
-# Add dependency from the correct buildchroot: host or target
+# Choose the correct buildchroot: host or target
 python __anonymous() {
     mode = d.getVar('ISAR_CROSS_COMPILE', True)
     distro_arch = d.getVar('DISTRO_ARCH')
@@ -17,7 +17,6 @@ python __anonymous() {
         dep = "buildchroot-host:do_build"
         rootfs = d.getVar('BUILDCHROOT_HOST_DIR', True)
 
-    d.setVarFlag('do_apt_fetch', 'depends', dep)
     d.setVar('BUILDCHROOT_DEP', dep)
     d.setVar('BUILDCHROOT_DIR', rootfs)
 }
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index ed162b3..ec8fbc1 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -89,6 +89,9 @@ python do_apt_fetch() {
 addtask apt_fetch after do_unpack before do_apt_unpack
 do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
 
+# Add dependency from the correct buildchroot: host or target
+do_apt_fetch[depends] = "${BUILDCHROOT_DEP}"
+
 unpack_apt() {
     for uri in "${SRC_APT}"; do
         sudo -E chroot --userspec=$( id -u ):$( id -g ) ${BUILDCHROOT_DIR} \
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v3 3/3] image: Fix do_install_imager_deps dependency
  2021-07-14  6:52 [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
  2021-07-14  6:52 ` [PATCH v3 1/3] buildchroot: Introduce buildchroot dependency variable Anton Mikanovich
  2021-07-14  6:52 ` [PATCH v3 2/3] buildchroot: Move apt_fetch dependency to dpkg-base Anton Mikanovich
@ 2021-07-14  6:52 ` Anton Mikanovich
  2021-07-26 15:06 ` [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
  3 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2021-07-14  6:52 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

To allow the usage of imager with ISAR_CROSS_COMPILE set to "1" replace
hardcoded buildchroot-target dependency with proper one.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/image-tools-extension.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image-tools-extension.bbclass b/meta/classes/image-tools-extension.bbclass
index 4738479..9646a14 100644
--- a/meta/classes/image-tools-extension.bbclass
+++ b/meta/classes/image-tools-extension.bbclass
@@ -14,7 +14,7 @@ IMAGER_INSTALL ??= ""
 IMAGER_BUILD_DEPS ??= ""
 DEPENDS += "${IMAGER_BUILD_DEPS}"
 
-do_install_imager_deps[depends] = "buildchroot-target:do_build"
+do_install_imager_deps[depends] = "${BUILDCHROOT_DEP}"
 do_install_imager_deps[deptask] = "do_deploy_deb"
 do_install_imager_deps[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
 do_install_imager_deps() {
-- 
2.25.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/3] Fix imager-buildchroot dependency
  2021-07-14  6:52 [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
                   ` (2 preceding siblings ...)
  2021-07-14  6:52 ` [PATCH v3 3/3] image: Fix do_install_imager_deps dependency Anton Mikanovich
@ 2021-07-26 15:06 ` Anton Mikanovich
  2021-07-29  7:58   ` Anton Mikanovich
  3 siblings, 1 reply; 6+ messages in thread
From: Anton Mikanovich @ 2021-07-26 15:06 UTC (permalink / raw)
  To: isar-users; +Cc: Jan Kiszka, Baurzhan Ismagulov

14.07.2021 09:52, Anton Mikanovich wrote:
> If using imager with ISAR_CROSS_COMPILE="1" it still depends on
> buildchroot-target because of hardcoded flag value. Moreover, there were
> no way to depends on buildchroot based on logic placed in python
> anonymous function in buildchroot.bbclass. It forced developer to place
> dependency set code inside buildchroot choose logic for any tasks like
> do_apt_fetch was implemented.
> To be able to set dependencies in places where they were implemented but
> still take care about cross compile modes we need to put buildchroot
> choose result into datastore variable and rely on it later.
>
> Anton Mikanovich (3):
>    buildchroot: Introduce buildchroot dependency variable
>    buildchroot: Move apt_fetch dependency to dpkg-base
>    image: Fix do_install_imager_deps dependency
>
>   meta/classes/buildchroot.bbclass           | 4 ++--
>   meta/classes/dpkg-base.bbclass             | 3 +++
>   meta/classes/image-tools-extension.bbclass | 2 +-
>   3 files changed, 6 insertions(+), 3 deletions(-)
>
Does anything speaks against it or someone see more clear 
implementation? If not, will merge this.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v3 0/3] Fix imager-buildchroot dependency
  2021-07-26 15:06 ` [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
@ 2021-07-29  7:58   ` Anton Mikanovich
  0 siblings, 0 replies; 6+ messages in thread
From: Anton Mikanovich @ 2021-07-29  7:58 UTC (permalink / raw)
  To: isar-users

26.07.2021 18:06, Anton Mikanovich wrote:
> Does anything speaks against it or someone see more clear 
> implementation? If not, will merge this.
>
Applied to next.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-07-29  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-14  6:52 [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
2021-07-14  6:52 ` [PATCH v3 1/3] buildchroot: Introduce buildchroot dependency variable Anton Mikanovich
2021-07-14  6:52 ` [PATCH v3 2/3] buildchroot: Move apt_fetch dependency to dpkg-base Anton Mikanovich
2021-07-14  6:52 ` [PATCH v3 3/3] image: Fix do_install_imager_deps dependency Anton Mikanovich
2021-07-26 15:06 ` [PATCH v3 0/3] Fix imager-buildchroot dependency Anton Mikanovich
2021-07-29  7:58   ` Anton Mikanovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox