flatpak-builder can't apply `git config http.postBuffer` workaround, necessary to clone llvm-project
Checklist
- [X] I agree to follow the Code of Conduct that this project adheres to.
- [X] I have searched the issue tracker for a bug that matches the one I want to file, without success.
flatpak-builder version
1.3.3
Flatpak version
1.14.4
How to reproduce
Attempt to build a project with the following module
modules:
- name: llvm
sources:
- type: git
url: https://github.com/llvm/llvm-project.git
commit: fc3b34c50803274b8ba3b8a30df9177b7d29063c
Expected Behavior
The module should be cloned into the build directory
Actual Behavior
The following error:
Initialized empty Git repository in /tmp/swiftshader-example/.flatpak-builder/git/https_github.com_llvm_llvm-project.git-0O41N2/
Fetching full git repo https://github.com/llvm/llvm-project.git
error: RPC failed; HTTP 400 curl 22 The requested URL returned error: 400
fatal: unable to write request to remote: Broken pipe
Failed to download sources: module llvm: Child process exited with code 128
Additional Information
This same error can be seen outside of flatpak, simply by running git fetch on the llvm-project repo, but in that case it can be fixed by setting git config http.postBuffer to a larger-than-default value (I used 16777216). I can't find any way of getting flatpak-builder to do this - that's the actual issue here.
Of course, I wish I didn't need to have llvm in my build tree at all, but llvm-project is a submodule of a submodule of my actual dependency, so working around this is not really an option. Even if I did manage to patch something, flatpak-builder would still error out during setup, before attempting to apply any patches...
ETA: I'd also like to note that this used to work previously, this issue has only started happening some time in the last two months, probably when the overall llvm-project repo grew past some kind of "critical mass".
Did you have any thoughts on how you want to address this so far?
I came across this comment saying that git fetch can't be shallow for arbitrary revisions, but for me, this command seems to do exactly that:
git fetch --depth 1 -f -p --no-recurse-submodules --tags origin fc3b34c50803274b8ba3b8a30df9177b7d29063c
For comparison, here's what's happening currently:
git cat-file -e fc3b34c50803274b8ba3b8a30df9177b7d29063c
git fetch -f -p --no-recurse-submodules --tags origin '*:*'
A shallow fetch wouldn't solve the issue of being unable to configure git, but maybe it would make it a moot point. It would also make cloning submodules a lot faster. On the other hand, maybe my command would omit something that flatpak-builder needs.
Well, this no longer happens. I don't know when or how it was fixed, and I'm not going to try to bisect anything. Thanks for looking at this if you did.