Bug 14157

Summary: git fetcher: consider using different git commands for repo packing, eliminating "git pack-redundant"
Product: [Build System, Metadata & Runtime] BitBake Reporter: Daniel Klauer <daniel.klauer>
Component: bitbakeAssignee: Richard Purdie <richard.purdie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: High CC: akuster, poky.bs.watcher, poky.watcher, randy.macleod
Version: unspecified   
Target Milestone: 6.0 M3   
Hardware: x86   
OS: Multiple   
Whiteboard: backports perhaps
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Daniel Klauer 2020-12-18 13:31:54 UTC
Hello,

First some background: bitbake's git fetcher invokes `git pack-redundant` and some other commands for packing the git repos downloaded into the downloads cache directory. In recent git versions (such as git 2.25.1 from Ubuntu 20.04), `git pack-redundant` sometimes crashes. It only happens on some repositories, and it's not a big issue for the Yocto build process, since as far as I could tell bitbake ignores the error and just continues on (the only reason I even noticed that is because of Kubuntu's automated crash/error reporting tool popping up occasionally in the middle of running a Yocto build here on my desktop).

This crash has been reported to the git mailing list (see <https://lore.kernel.org/git/CANYiYbHOczhRoJkOofFNQ6VA3BiyOF=QjffFBDvLn43Ts8B67w@mail.gmail.com/T/#t>) and it will probably be fixed (and as it turns out, has existed since 2019).

However, there also was some concern about why bitbake uses this at all. From what I understood, `git pack-redundant` may be deprecated soon anyways, and it would be better to just use `git repack -ad` instead of `git pack-redundant --all | xargs -r rm`, or even better `git gc --prune=now` instead of `git prune-packed` + `git pack-refs --all` + `git pack-redundant --all | xargs -r rm`. Please see that mail thread for a more detailed explanation.

I don't know exactly what bitbake needs here, but maybe this simplification would be worth considering. Thanks!
Comment 1 Armin Kuster 2020-12-24 18:43:35 UTC
Daniel,

Thanks for bringing this issue forward. The bug triage is off until after the New Year. Due to the Year End holiday, there may be a delay in response.
Comment 2 Randy MacLeod 2023-07-26 21:29:36 UTC
Bulk move to 4.3 M3.
Comment 3 Richard Purdie 2026-03-12 14:22:44 UTC
$ git pack-redundant
'git pack-redundant' is nominated for removal.
If you still use this command, please add an extra
option, '--i-still-use-this', on the command line
and let us know you still use it by sending an e-mail
to <git@vger.kernel.org>.  Thanks.
fatal: refusing to run without --i-still-use-this

The fetcher does still reference this
Comment 4 Randy MacLeod 2026-03-12 14:35:06 UTC
We need to ensure that we don't lose any of the unreachable references 
since the archives need them.
Comment 5 Richard Purdie 2026-03-27 16:48:12 UTC
Thanks again for raising this, we did finally get around to merging something to avoid it: https://git.openembedded.org/bitbake/commit/?id=64fda8cb8efaff280d33bf60d93fed6e37244640