diff mbox series

mirrors: Switch llvm to use shallow cloning

Message ID 20240228223949.1651046-1-richard.purdie@linuxfoundation.org
State Accepted, archived
Commit 6cf98a4954751977fb02fb2024ef842865352138
Headers show
Series mirrors: Switch llvm to use shallow cloning | expand

Commit Message

Richard Purdie Feb. 28, 2024, 10:39 p.m. UTC
The llvm github repo appears to see a lot of churn on branches we're not
interested in and is in general huge and unreliable to clone.

Switch to shallow clones to improve the user experience.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/mirrors.bbclass | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Chuck Wolber March 16, 2024, 12:18 a.m. UTC | #1
On Wed, Feb 28, 2024 at 2:39 PM Richard Purdie <
richard.purdie@linuxfoundation.org> wrote:

> The llvm github repo appears to see a lot of churn on branches we're not
> interested in and is in general huge and unreliable to clone.
>
> Switch to shallow clones to improve the user experience.
>

This reminded me of something I recently observed in a kirkstone build.

I set the following in my local.conf:

BB_GENERATE_MIRROR_TARBALLS = "1"
BB_GENERATE_SHALLOW_TARBALLS = "1"
BB_GIT_SHALLOW = "1"

For the most part this worked as expected, but the llvm recipe ended up
with both a shallow
(157 MB) *AND* a full (6.4GB) git clone .tar.gz file in the downloads
directory.

It is always possible that I mixed something up, but I tried it twice,
being careful to start from a
completely empty build. Each time I was able to unpack the gitshallow and
git2 LLVM bundles
and convince myself that I was looking at the same thing when the
"release/13.x" branch was
checked out.

..Ch:W..
diff mbox series

Patch

diff --git a/meta/classes-global/mirrors.bbclass b/meta/classes-global/mirrors.bbclass
index af66fb1832f..862648eec5f 100644
--- a/meta/classes-global/mirrors.bbclass
+++ b/meta/classes-global/mirrors.bbclass
@@ -83,7 +83,7 @@  git://.*/.*                   git://HOST/PATH;protocol=https \
 git://.*/.*                   git://HOST/git/PATH;protocol=https \
 "
 
-# Switch glibc and binutils recipes to use shallow clones as they're large and this
+# Switch llvm, glibc and binutils recipes to use shallow clones as they're large and this
 # improves user experience whilst allowing the flexibility of git urls in the recipes
 BB_GIT_SHALLOW:pn-binutils = "1"
 BB_GIT_SHALLOW:pn-binutils-cross-${TARGET_ARCH} = "1"
@@ -98,3 +98,7 @@  BB_GIT_SHALLOW:pn-glibc = "1"
 BB_GIT_SHALLOW:pn-glibc-tests = "1"
 PREMIRRORS += "git://sourceware.org/git/glibc.git https://downloads.yoctoproject.org/mirror/sources/ \
               git://sourceware.org/git/binutils-gdb.git https://downloads.yoctoproject.org/mirror/sources/"
+
+BB_GIT_SHALLOW:pn-llvm = "1"
+BB_GIT_SHALLOW:pn-llvm-native = "1"
+BB_GIT_SHALLOW:pn-nativesdk-llvm = "1"