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

consider gix instead of libgit2 #217

Closed
j-baker opened this issue Jan 25, 2024 · 5 comments
Closed

consider gix instead of libgit2 #217

j-baker opened this issue Jan 25, 2024 · 5 comments
Assignees
Labels
type::refactoring Changing the inner-workings of buffrs

Comments

@j-baker
Copy link
Contributor

j-baker commented Jan 25, 2024

libgit2 is a fairly minor dependency for buffrs, but at a fairly high cost for users. git is in the default featureset, so:

  1. Builds take a long time due to need to compile openssl, libgit2, etc (e.g. a cargo package using the buffrs crate will take 5 minutes to compile every time the right env vars change).
  2. They can fail more easily on esoteric platforms. For example, I'm using cargo zigbuild to build python wheels, and this is complaining when trying to access zlib during the vendored openssl build. I can only assume it's gotten confused with its compilers in one place or another (maybe it's trying to use clang when it should be using gcc? not sure).

Instead of using libgit2 and all the extra cruft this entails, we could use gix instead, which I think supports the specific functionality we need. This would simplify the native dependency tree and reduce install times.

@mara-schulke
Copy link
Contributor

@vsiles what are your thoughts? Would you be able to pick this up? I think this has great value for our users (that can likely ditch some native libraries if we do this change)

@mara-schulke
Copy link
Contributor

mara-schulke commented Feb 6, 2024

FWIW @j-baker you can disable the git feature for the time being

@vsiles
Copy link
Contributor

vsiles commented Feb 6, 2024

I'm not familiar with these libs but that's a good way to get to know more of buffrs. I'll spend some time on it to assess if gix is a good substitute, and do the refactoring if that's the case. Thanks for flagging it

@vsiles
Copy link
Contributor

vsiles commented Feb 7, 2024

From what I understand of the usage of git2 in buffrs, it is mostly to check if the repo is "clean" (all files are either committed or ignored).

gix and gix_status don't seem to be "there yet":

  • using these crates, I managed to get information on any tracked files with non committed changes
  • however I can't find how to get information about untracked files. Looking at the project status it seems this is not supported at the moment.

The current code would complain if some untracked files are present. We could walk the file system and check if there are some files that are not tracked and not ignored to achieve our goal, but I don't know if gix can give me information about ignored files. I'll try to check that and be back at you.

EDIT: I just built gix which confirmed:

head -> index and untracked files aren't implemented yet

@tomkarw
Copy link
Contributor

tomkarw commented Feb 15, 2024

Completed in #220.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type::refactoring Changing the inner-workings of buffrs
Projects
None yet
Development

No branches or pull requests

4 participants