Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatpak-builder can't apply git config http.postBuffer workaround, necessary to clone llvm-project #599

Open
2 tasks done
Adamcake opened this issue May 13, 2024 · 1 comment

Comments

@Adamcake
Copy link

Adamcake commented May 13, 2024

Checklist

  • I agree to follow the Code of Conduct that this project adheres to.
  • 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".

@smcv smcv changed the title flatpak-builder can't clone llvm-project flatpak-builder can't apply git config http.postBuffer workaround, necessary to clone llvm-project May 13, 2024
@Adamcake
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant