Skip to content

Implement git shallow mirror tarball support

Christopher Larson bitbake-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4bb.fetch: simplify mirror tarball handling in try_mirror_urllib/bb/fetch2/__init__.py+2 -30 replies
2/4bb.fetch: support ud.mirrortarballslib/bb/fetch2/__init__.py+13 -90 replies
3/4bb.fetch.git: add support for shallow mirror tarballslib/bb/fetch2/git.py+133 -400 replies
4/4bb.fetch.git: truncate branches to SRCREVlib/bb/fetch2/git.py+4 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] Implement git shallow mirror tarball support

From: Christopher Larson <[email protected]>

Supercedes [RFC PATCH 0/5] Implement git shallow mirror tarball support.

The shallow mirror tarball filename includes branch, revision, and depth. To enable, use the BB_GIT_SHALLOW variable, or BB_GIT_SHALLOW_<name> for specific URLs. This variable can hold either a clone depth (e.g. 1 to just get SRCREV), or a ref or commit, in which case we keep history up to that commit.

Example:

BB_GIT_SHALLOW ?= "1"
BB_GIT_SHALLOW_pn-linux-yocto = ""
BB_GIT_SHALLOW_pn-linux-mel_mx6 = "v3.14"
BB_GIT_SHALLOW_pn-testrepo = "testbranch"

Example in a recipe with multiple named uris, or multiple named branches in a single git URI:

    BB_GIT_SHALLOW_main = "1"
    BB_GIT_SHALLOW_doc = ""

BB_GIT_SHALLOW affects both the tarballs being fetched and the mirror tarball which is created when BB_GENERATE_MIRROR_TARBALLS is enabled. If the shallow mirror tarball cannot be fetched, it will try to fetch the full mirror tarball and use that.

Limitations:

The shallow support will not, at this time, function correctly for linux-yocto, due to its branching scheme & validation.

This implements support for shallow mirror tarballs, not shallow clones. Supporting shallow clones directly would be rather more problematic, as we'd need to hardcode the depth between branch HEAD and the SRCREV, and that depth would change as the branch is updated.

Christopher Larson (4):
bb.fetch: simplify mirror tarball handling in try_mirror_url bb.fetch: support ud.mirrortarballs
bb.fetch.git: add support for shallow mirror tarballs bb.fetch.git: truncate branches to SRCREV

 lib/bb/fetch2/__init__.py |  27 +++----
 lib/bb/fetch2/git.py      | 177 +++++++++++++++++++++++++++++++++++-----------
 2 files changed, 152 insertions(+), 52 deletions(-)
Signature · 1 line
2.2.1