public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] dpkg-base: "unshare" git clones in adjust_git
Date: Mon, 16 Aug 2021 13:36:06 +0200	[thread overview]
Message-ID: <20210816133606.36949c9c@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <e3d85fcf-4227-9ec0-9d7f-d6d676dbc2fa@siemens.com>

Am Sun, 15 Aug 2021 20:55:34 +0200
schrieb Jan Kiszka <jan.kiszka@siemens.com>:

> On 13.08.21 19:49, Henning Schild wrote:
> > Instead of messing with the alternate make the clone not "shared"
> > anymore. Doing that will allow us to use git as a patchtool, also in
> > incremental rebuilds where do_patch might run again after
> > do_adjust_git
> > 
> > It will also make sure git repos will be usable in all three
> > environments. On a container host, inside the container, and inside
> > the chroot ... as apposed to only the chroot in the end.
> > 
> > Signed-off-by: Henning Schild <henning.schild@siemens.com>
> > ---
> >  meta/classes/dpkg-base.bbclass | 7 +++----
> >  1 file changed, 3 insertions(+), 4 deletions(-)
> > 
> > diff --git a/meta/classes/dpkg-base.bbclass
> > b/meta/classes/dpkg-base.bbclass index ec8fbc14d5e4..2a8e3ef4b817
> > 100644 --- a/meta/classes/dpkg-base.bbclass
> > +++ b/meta/classes/dpkg-base.bbclass
> > @@ -45,11 +45,11 @@ python do_adjust_git() {
> >              alternates = os.path.join(destdir,
> > ".git/objects/info/alternates") 
> >              if os.path.exists(alternates):
> > -                cmd = ["sed", "-i", alternates, "-e",
> > -
> > "s|{}|/downloads|".format(d.getVar("DL_DIR"))]
> > +                cmd = ["git", "-C", destdir, "repack", "-a" ]
> >                  bb.note(' '.join(cmd))
> >                  if subprocess.call(cmd) != 0:
> > -                    bb.fatal("git alternates adjustment failed")
> > +                    bb.fatal("git repack failed")
> > +                os.remove(alternates)
> >          except bb.fetch2.BBFetchException as e:
> >              bb.fatal(str(e))
> >  }
> > @@ -57,7 +57,6 @@ python do_adjust_git() {
> >  addtask adjust_git before do_dpkg_build
> >  
> >  inherit patch
> > -addtask patch before do_adjust_git
> >  
> >  SRC_APT ?= ""
> >  
> >   
> 
> NACK, we have a pattern now that avoids this.

Does that cover all three envs? (docker-host, docker, and chroots?)

If your ../../../.. thing works that might be fine, but this whole
approach with "sed" is git surgery not backed by documentation or
official interfaces.
The benefit of the deduplication is likely neglectible ... unless you
take the kernel as example. But even there you are probably saving much
more with going shallow than with deduplication via shared clones.

Henning

> Jan
> 


  reply	other threads:[~2021-08-16 11:36 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-12 11:48 [PATCH v2 0/4] Make adjust_git work in both worlds Jan Kiszka
2021-08-12 11:48 ` [PATCH v2 1/4] dpkg-base: Lock do_adjust_git against each other Jan Kiszka
2021-08-13 13:55   ` Henning Schild
2021-08-15 18:55     ` Jan Kiszka
2021-08-26  8:00   ` [PATCH v3 " Jan Kiszka
2021-08-26  8:06     ` Jan Kiszka
2021-08-12 11:48 ` [PATCH v2 2/4] dpkg-base: Make mirror link relative Jan Kiszka
2021-08-13 14:04   ` Henning Schild
2021-08-13 17:49     ` [PATCH] dpkg-base: "unshare" git clones in adjust_git Henning Schild
2021-08-13 20:13       ` [PATCH v2] " Henning Schild
2021-08-13 20:14         ` Henning Schild
2021-08-15 18:55       ` [PATCH] " Jan Kiszka
2021-08-16 11:36         ` Henning Schild [this message]
2021-08-16 16:57           ` Jan Kiszka
2021-08-12 11:48 ` [PATCH v2 3/4] Rework do_adjust_git to support inside and outside usage Jan Kiszka
2021-08-12 11:48 ` [PATCH v2 4/4] Revert "dpkg: adjust task order to allow using "git" for patching" Jan Kiszka
2021-08-13  8:31 ` [PATCH v2 0/4] Make adjust_git work in both worlds Uladzimir Bely
2021-08-13 10:13   ` Jan Kiszka
2021-08-13 12:23     ` Uladzimir Bely
2021-08-13 12:28       ` Jan Kiszka
2021-08-13 12:40         ` Uladzimir Bely
2021-08-15 19:02           ` Jan Kiszka
2021-08-16  7:52             ` Uladzimir Bely
2021-08-16  7:55               ` Jan Kiszka
2021-08-16  8:27                 ` Uladzimir Bely
2021-08-16 10:45                   ` Jan Kiszka
2021-08-16 11:01                     ` Jan Kiszka
2021-08-16 11:26                       ` Henning Schild
2021-08-16 12:49                       ` Uladzimir Bely
2021-08-19  6:17                     ` Uladzimir Bely
2021-08-19  6:21                       ` Jan Kiszka
2021-08-26  7:57                         ` Jan Kiszka
2021-08-27  8:39                           ` ub...@ilbers.de

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=20210816133606.36949c9c@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.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