Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Paul Barker" <paul@pbarker.dev>
To: <ecordonnier@snap.com>, <openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH v3 1/3] archiver.bbclass: archive shallow git sources which have no clone
Date: Fri, 20 Nov 2026 13:30:08 +0000	[thread overview]
Message-ID: <DN02P6581AAC.6W4V8B9MA0N0@pbarker.dev> (raw)
In-Reply-To: <20261117122457.435864-2-ecordonnier@snap.com>

On Tue Nov 17, 2026 at 12:24 PM GMT, ecordonnier wrote:
> From: Etienne Cordonnier <ecordonnier@snap.com>
>
> In the original mode, do_ar_original archives a source if the fetcher's
> localpath is a file, or a directory (which is unpacked and tarred). For git,
> localpath was the clone in DL_DIR/git2, which a shallow fetch (BB_GIT_SHALLOW)
> does not create when it uses the gitshallow tarball: since bitbake commit
> 457288b2f ("fetch2/git: Add support for fast initial shallow fetch") this is
> what a shallow fetch does by default, and it also happens when the shallow
> tarball is fetched from a mirror. The source was then silently skipped and not
> archived at all.
>
> The git fetcher now returns the shallow tarball as localpath in this case.
> Copying it would make the archive differ depending on how the source was
> fetched, so unpack git sources like a clone, which uses the shallow tarball.
>
> AI-Generated: Claude Sonnet 5.5
> Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
> ---
>  meta/classes/archiver.bbclass            |  9 ++++-
>  meta/lib/oeqa/selftest/cases/archiver.py | 48 ++++++++++++++++++++++++
>  2 files changed, 55 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
> index 0400d6e373..d1a8dadec7 100644
> --- a/meta/classes/archiver.bbclass
> +++ b/meta/classes/archiver.bbclass
> @@ -204,10 +204,15 @@ python do_ar_original() {
>      fetch = bb.fetch.Fetch(urls, ld)
>      tarball_suffix = {}
>      for url in fetch.urls:
> +        ud = fetch.ud[url]
> +        is_git = isinstance(ud.method, bb.fetch.git.Git)

Hi Etienne,

These changes are definitely moving in the right direction, but I don't
think they're quite ready to merge yet.

Here we are still special casing particular fetchers, which we shouldn't
need to do.

I think we just need two cases:

1) If the path returned by localpath() is a file, copy it.

2) Otherwise, call fetch.unpack() into a tmpdir, regardless of whether
   the path returned by localpath() exists or not. Raise an error if the
   tmpdir is still empty after the unpack.

Best regards,

-- 
Paul Barker


  reply	other threads:[~2026-11-20 13:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17 12:24 [PATCH v3 0/3] archiver.bbclass: archive shallow git sources which have no clone ecordonnier
2026-11-17 12:24 ` [PATCH v3 1/3] " ecordonnier
2026-11-20 13:30   ` Paul Barker [this message]
2026-11-17 12:24 ` [PATCH v3 2/3] archiver.bbclass: remove .git from original git source archives ecordonnier
2026-11-17 12:24 ` [PATCH v3 3/3] archiver.bbclass: fail on sources which cannot be archived ecordonnier

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=DN02P6581AAC.6W4V8B9MA0N0@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=ecordonnier@snap.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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