-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Remove runtime dependency on git
package
#9807
Comments
You should be aware that libgit2 has severe performance problems, which would be rather unfortunate given that git is already not the fastest thing in the world. It seems much more sensible to deliberately put a fallback git into the closure of Nix, so it will consistently be available, and be of the better implementation. |
We've seen some performance regressions that we expect to be offset by the ability to operate on subtrees of repositories, and not adding everything to the store. I haven't seen anything that I'd have to call severe. Note also that use libgit2 to sidestep not entirely reproducible behaviors in the git checkout and archive logic, such as smudge filters and export-ignore. This is solved simply and reliably by accessing the tree objects directly.
There's no doubt that we keep it as long as we need it. Performance can be a valid reason to keep it. |
I've used a very teeny slice of libgit2 indirectly through python and rust bindings and my experience was that it's a mix when it comes to performance. In particular, I found diffing was quite a bit slower (especially on big repos) via libgit2 than by shelling out to git. (Some other stuff was quite a bit faster, though.) I think it just merits benchmarking each implementation against a good mix of repo sizes. Maybe an easy-to-run ~benchmarking suite pays off over time by warding off problems and encouraging people to experiment with optimizations. Edit: there's also the rust |
Here's an example of the pain it's caused with cargo: rust-lang/cargo#11567 (comment) It's plausible that nix's use case of pulling objects out of the store for a vfs would be faster on libgit2 and yet also that clone would be unacceptably slow without instead shelling out to git. I can believe that various use cases end up with very different perf results. |
Regarding libgit2 performance, romkatv has made optimizations that may be interesting to upstream. |
Interesting. Hadn't spotted that before. Amusingly, my motivating case is more or less the same (I implemented |
Related to: |
I filed #10567 which goes in the opposite direction of this issue. Great input by @fricklerhandwerk makes me think that removing |
When I've added "Do not regress in functionality" to the issue description, because I'm certainly not advocating for breaking people's stuff for some minor technical reason. |
Right. But do you have any indication that libgit2 would consider adding this, or even better someone working on it? I searched their repo but couldn't find anything. Don't get me wrong, I think it'd be very cool if it would support remote helpers, I am just genuinely asking. |
I haven't talked to them about these features; I've only opened this issue to track what we'd need, because it came up in review and discussions. I don't think this issue is strategically important for Nix, but any efforts will be appreciated. |
It looks like libgit2 is used pretty extensively. I wonder what is remaining that calls git? |
Most significantly it uses git grep -E 'runProgram\("git"|.program = "git"' |
Is your feature request related to a problem? Please describe.
git
that's a trap door, asking the user to install xcode.Describe the solution you'd like
Use libgit2 for everything.
Do not call the Git CLI from Nix.
We'll still need it in the functional test suite, but that's ok.
Do not regress in functionality.
Additional context
Priorities
Personally, I just opened this for tracking purposes.
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: