[v2] dpkg: schroot migration then buildchroot references removed, v2

Message ID 20230110040427.1177958-1-roberto.foglietta@linuxteam.org
State Rejected, archived
Headers show
Series [v2] dpkg: schroot migration then buildchroot references removed, v2 | expand

Commit Message

roberto.foglietta@linuxteam.org Jan. 10, 2023, 4:04 a.m. UTC
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>

dpkg, adding feature: migration to schroot

The patchset v.2 by Anton Mikanovich to migrate buildchroot to schroot is not
complete because the buildchroot is still used by the dpkg base class which can
be freed by buildchroot with this patch which applies on the top of these four:

    * events: Cleanup lost schroot sessions if any, v2
    * imager: Move image types to schroot, v2
    * imager: Migrate from buildchroot to schroot, v2
    * sbuild: Allow setting custom config paths, v2

v2: remove the lines instead of commenting them, better description

Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
 meta/classes/dpkg-base.bbclass | 6 ------
 1 file changed, 6 deletions(-)

Comments

Roberto A. Foglietta Jan. 10, 2023, 4:24 a.m. UTC | #1
On Tue, 10 Jan 2023 at 05:04, <roberto.foglietta@linuxteam.org> wrote:
>
> From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
>
> dpkg, adding feature: migration to schroot
>
> The patchset v.2 by Anton Mikanovich to migrate buildchroot to schroot is not
> complete because the buildchroot is still used by the dpkg base class which can
> be freed by buildchroot with this patch which applies on the top of these four:
>
>     * events: Cleanup lost schroot sessions if any, v2
>     * imager: Move image types to schroot, v2
>     * imager: Migrate from buildchroot to schroot, v2
>     * sbuild: Allow setting custom config paths, v2
>
> v2: remove the lines instead of commenting them, better description
>
> Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
> ---
>  meta/classes/dpkg-base.bbclass | 6 ------
>  1 file changed, 6 deletions(-)


Hi all,

to complete the migration to schroot the patch above should be applied.

I also suggest to review the code in these two files and three functions:

meta/classes/image-tools-extension.bbclass

do_start_imager_session()
do_stop_imager_session()

b/meta/classes/isar-events.bbclass

stop_schroot_session()

In particular in this function stop_schroot_session() the code could
be factorized in common with do_stop_imager_session() using a function
like stop_schroot_session() to use everywhere is necessary.

About this, I am going to send the following patch

v7-0001-image-tools-ext.-start_imager_session-not-break-t.patch

Best regards, R-
Jan Kiszka Jan. 10, 2023, 6:59 a.m. UTC | #2
On 10.01.23 05:04, roberto.foglietta@linuxteam.org wrote:
> From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
> 
> dpkg, adding feature: migration to schroot
> 
> The patchset v.2 by Anton Mikanovich to migrate buildchroot to schroot is not
> complete because the buildchroot is still used by the dpkg base class which can
> be freed by buildchroot with this patch which applies on the top of these four:
> 
>     * events: Cleanup lost schroot sessions if any, v2
>     * imager: Move image types to schroot, v2
>     * imager: Migrate from buildchroot to schroot, v2
>     * sbuild: Allow setting custom config paths, v2
> 
> v2: remove the lines instead of commenting them, better description
> 
> Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
> ---

Patch version changes and dependencies generally go here, not above.

>  meta/classes/dpkg-base.bbclass | 6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
> index 260aa73..ce150b3 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -5,7 +5,6 @@
>  # SPDX-License-Identifier: MIT
>  
>  inherit sbuild
> -inherit buildchroot
>  inherit debianize
>  inherit terminal
>  inherit repository
> @@ -123,9 +122,6 @@ do_apt_fetch() {
>  addtask apt_fetch
>  do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
>  
> -# Add dependency from the correct buildchroot: host or target
> -do_apt_fetch[depends] += "${BUILDCHROOT_DEP}"
> -

I've only dropped this bit in
https://patchwork.isar-build.org/project/isar/patch/4a89ddd8-5be1-9aff-ab5c-579ecda50b8f@siemens.com/,
wasn't sure about the rest. How did you validate your cleanup?

>  # Add dependency from the correct schroot: host or target
>  do_apt_fetch[depends] += "${SCHROOT_DEP}"
>  
> @@ -193,8 +189,6 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
>  dpkg_do_mounts() {
>      mkdir -p ${BUILDROOT}
>      sudo mount --bind ${WORKDIR} ${BUILDROOT}
> -
> -    buildchroot_do_mounts
>  }
>  
>  dpkg_undo_mounts() {

Isn't there is more to clean up then? Are we still using BUILDROOT in
the end? In fact: Are we still calling dpkg_do_mounts at all?? I don't
find references in the tree, today.

And then doc/technical_overview.md will need an update as well, not only
because of this here.

Jan
Roberto A. Foglietta Jan. 10, 2023, 11:09 a.m. UTC | #3
On Tue, 10 Jan 2023 at 07:59, Jan Kiszka <jan.kiszka@siemens.com> wrote:
>
> On 10.01.23 05:04, roberto.foglietta@linuxteam.org wrote:
> > From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
> >
> > dpkg, adding feature: migration to schroot
> >

>
> I've only dropped this bit in
> https://patchwork.isar-build.org/project/isar/patch/4a89ddd8-5be1-9aff-ab5c-579ecda50b8f@siemens.com/,
> wasn't sure about the rest. How did you validate your cleanup?
>
> >  # Add dependency from the correct schroot: host or target
> >  do_apt_fetch[depends] += "${SCHROOT_DEP}"
> >> > The patchset v.2 by Anton Mikanovich to migrate buildchroot to schroot is not
> > complete because the buildchroot is still used by the dpkg base class which can
> > be freed by buildchroot with this patch which applies on the top of these four:
> >
> >     * events: Cleanup lost schroot sessions if any, v2
> >     * imager: Move image types to schroot, v2
> >     * imager: Migrate from buildchroot to schroot, v2
> >     * sbuild: Allow setting custom config paths, v2
> >
> > v2: remove the lines instead of commenting them, better description
> >
> > Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
> > ---
>
> Patch version changes and dependencies generally go here, not above.
>
> >  meta/classes/dpkg-base.bbclass | 6 ------
> >  1 file changed, 6 deletions(-)
> >
> > diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
> > index 260aa73..ce150b3 100644
> > --- a/meta/classes/dpkg-base.bbclass
> > +++ b/meta/classes/dpkg-base.bbclass
> > @@ -5,7 +5,6 @@
> >  # SPDX-License-Identifier: MIT
> >
> >  inherit sbuild
> > -inherit buildchroot
> >  inherit debianize
> >  inherit terminal
> >  inherit repository
> > @@ -123,9 +122,6 @@ do_apt_fetch() {
> >  addtask apt_fetch
> >  do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
> >
> > -# Add dependency from the correct buildchroot: host or target
> > -do_apt_fetch[depends] += "${BUILDCHROOT_DEP}"
> > -
> > @@ -193,8 +189,6 @@ BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
> >  dpkg_do_mounts() {
> >      mkdir -p ${BUILDROOT}
> >      sudo mount --bind ${WORKDIR} ${BUILDROOT}
> > -
> > -    buildchroot_do_mounts
> >  }
> >
> >  dpkg_undo_mounts() {
>
> Isn't there is more to clean up then? Are we still using BUILDROOT in
> the end? In fact: Are we still calling dpkg_do_mounts at all??

your own patch tell me that your questions found an answer:

       dpkg-base: Drop dependency on buildchroot v2

> I don't
> find references in the tree, today.

Which tree? Of which repository?

Best regards, R-

Patch

diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 260aa73..ce150b3 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -5,7 +5,6 @@ 
 # SPDX-License-Identifier: MIT
 
 inherit sbuild
-inherit buildchroot
 inherit debianize
 inherit terminal
 inherit repository
@@ -123,9 +122,6 @@  do_apt_fetch() {
 addtask apt_fetch
 do_apt_fetch[lockfiles] += "${REPO_ISAR_DIR}/isar.lock"
 
-# Add dependency from the correct buildchroot: host or target
-do_apt_fetch[depends] += "${BUILDCHROOT_DEP}"
-
 # Add dependency from the correct schroot: host or target
 do_apt_fetch[depends] += "${SCHROOT_DEP}"
 
@@ -193,8 +189,6 @@  BUILDROOT = "${BUILDCHROOT_DIR}/${PP}"
 dpkg_do_mounts() {
     mkdir -p ${BUILDROOT}
     sudo mount --bind ${WORKDIR} ${BUILDROOT}
-
-    buildchroot_do_mounts
 }
 
 dpkg_undo_mounts() {