-
Notifications
You must be signed in to change notification settings - Fork 4
Fix packaging and tests across platforms #4
Conversation
@LiberalArtist This is great! Thank you so much. |
dbfa30c
to
db775d2
Compare
I'm delighted that you're working on this. Let me know when you think it's ready. |
Here's a bit of a progress report. I think the main blocker to this PR leaving things in better shape than I found them is the state of the platform-specific native packages. I set up a repository at https://github.com/LiberalArtist/native-libgit2-pkgs to try to build packages consistently across platforms, and it is working now for Mac OS and x86_64 GNU/Linux. (In addition to the considerations I mentioned above, I decided I'd like to package the Linux As I mentioned on the mailing list, I'm currently blocked on getting the Windows DLL to load: it builds, and I can open it from Python, but I can't open it from Racket. Hopefully this is something silly I'm doing wrong because I'm not a big Windows person, rather than a more serious issue. I'm going to try to borrow a Windows machine to do more debugging. I haven't addressed i386 packages yet. These aren't a big priority for me personally, but they'd be nice to have, especially since this repo does currently have an i386 Windows DLL checked in. The complication is that it doesn't look like either Travis or AppVeyor have i386 VMs for either Windows or GNU/Linux. (AppVeyor looked like it did, but apparently its "x86" platform is just an alias for its "x64" platform, confusingly.) I believe it should be possible to cross-compile the i386 versions from the x86_64 VMs, but I haven't tried this yet, and I'm slightly hesitant about packaging the binaries without a better story for testing that they actually work, especially given my current struggles with x86_64 Windows. @spdegabrielle and @jbclements, I'm very open to your thoughts on this: AFAIK you are the only other two people who have been trying to use or work on this package. (Also, @jbclements, since I'm now trying to package the x86_64 GNU/Linux Once this runs on Windows, I think it's at least arguable that this PR would be ready to merge, but there are some other things I'd like to do to this library. I'll leave it up to you whether any of these things should go in this PR or in (a) subsequent pull request(s):
|
Many thanks for the progress report. I'm inclined to defer to your judgment on this package's decisions and progress; I think you may be the only active user at this point, so anything that makes it better for you is probably the right thing. Actually, I'm curious about your use of CI instances to build Windows DLLs... the RSound DLLs are way out of date, and one of the obstacles for me is bringing my Windows machine back from the dead. |
@LiberalArtist are you still working on this? I think you have some really good thoughts about how this library should work. I brought up a cheeky Issue regarding naming conventions. To be clear, I don't mind the naming convention adhering strictly to the C API, but the few cases where the conventions are mixed concerns me. I would prefer this package remain the thinnest wrapper possible if that is its goal. I am willing to put in quite a bit of work. I am inexperienced with the FFI facilities in Racket, but I am familiar with C and Racket, so I don't expect to get confused. I do like the idea of having some racket tools automate the memory management, but I don't mind wrapping everything manually if necessary. If you are still interested in this project I would love to get your perspective now (more than a full year after your last comments that I can find). Thanks |
As @guygastineau says, I'd also like to find out whether we can merge this PR. I would hate to see this work go to waste. Guy, how does this pull request relate to yours? Would accepting your pull request make it harder to accept this one? (It seems likely to me.) |
@jbclements The two PRs I opened yesterday are minor, and even if they cause conflicts in this PR it is just tweaks in the .gitignore and the test suite. As for the further work I am interested in doing for this library: I don't have a clear vision of it yet, and I was hoping to reach out a bit in order to get feedback from folks who are more familiar with both this project and libgit2 (I am mostly just familiar with the command line tool Even though I use Linux, my motivations are actually to use this package to automate git workflows for my team (who are all using enterprise Windows at a school). I can just do it in PowerShell, but I don't like PowerShell; I figured it was a good excuse to work on something with a lot of vertical integration. The team all has racket installed too even though they aren't very familiar with it. Anyway, I suppose that is to say that having this package cleanly and easily install libgit2 on Windows with a simple Thank you for jumping back into the conversation here, jbclements. PS. My PR #8 that fixes the tests for me might break one test for Windows. If |
This is very much still on my radar, and I'm hoping one of my nascent projects for which I intend to use it will finally be ready this fall (a year and a half after I'd hoped …), so my attention had been turning back to this in the last few weeks anyway. I'll try to look over this in more detail in the next few days, but IIRC the only blocker to this being strictly an improvement over the status quo is figuring out the proper incantation to build libgit2 for Windows in a way that works with Racket's Some of the other changes I discussed above would be backwards-incompatible, but, if we can get the packaging set up properly, I think it would make sense to merge this and potentially address those in further PRs. It sounds like there's broad agreement on what we want from this package: a fairly low-level API but with correct ctypes and some Racket conveniences around memory safety etc. I still think it makes sense to consider this package unstable for now and come to consensus on a stable API consistent with upstream v1.0, which was released this spring (incidentally, also about a year after they'd intended). |
This eliminates a superfluous level of directory nesting. Also, remove accidentally committed editor backup and make a small tweak to the README.
Fixed test about paths by using `file-or-directory-identity` for comparison. Commented out failing tests saying: - "giterr_last: implementation not found; no arguments provided" - "git_buf_free: implementation not found; " There is more cleaning to do. Most tests can probably go into files with the corresponding implementations. FFI types should be changed to avoid returning paths as strings. Cleanup functions called automatically should not be part of the public API.
Maybe this time will finally work out?
Two tests using `git_signature_default` appear to fail when the test system does not have an existing Git configuration with `user.name` and `user.email` set. This change is an attempt at avoiding the issue.
The workaround in 53590c1 didn't work, so skip tests of `git_signature_default` for now on systems where `user.name` and `user.email` haven't been configured.
Remove `.travis.yml`.
If this works, it may mean we should try building with an older toolchain.
(It didn't work.) This reverts commit 233d741.
Some deprecated functionality, and several deprecated names, remain in enum and struct declarations that aren't accessed as symbols in the shared library. Additionally, some signature changes around the 1.0 release still need to be accommodated, as do functions that have been added (particularly replacements for deprecated functionality).
This should be the version of glibc used in Debian 11 (Bullseye) and Ubuntu 20.04 (Focal Fossa): we were previously building against versions from Nix and Guix that were too new. If this works out, hopefully we can move to even older glibc versions in due course. (Racket distributes generic Linux binaries built on Debian 9 (Stretch), which has glibc@2.24.) For further discussion, see commit 8d99f34081bcfcd141c74bf6fe967714bf58bce0 in the `build-scripts` branch of <https://github.com/LiberalArtist/native-libgit2-pkgs>.
Closes bbusching#6 Co-authored-by: guygastineau <strings.stringsandstrings@gmail.com>
Use `libgit2-native-libs` v0.1, which provides platform-specific native library packages for libgit2 v1.4.3. Closes bbusching#4
Use 'GIT_CONFIG_LEVLEL_GLOBAL for 'unix and 'macosx OSs, since they don't have %PROGRAM_DATA%. Closes bbusching#8
4d1d083
to
3d50ee8
Compare
It has taken years rather than weeks, but the commits I've just pushed fixed the final item on my "do no harm" checklist:
so I say this is ready to merge! I've effectively cherry-picked @guygastineau's repairs from #6 and #8 (specifically, 65a16b3), as well. I have gone through—um, maybe 4?—approaches to building the native libraries over at https://github.com/LiberalArtist/native-libgit2-pkgs before finding one that works reasonably, using a combination of Nix and Guix. The resulting packages support:
As far as:
I'm still taking this approach, at least for now. I think I should look again at what other distributors are doing, now that libgit2 itself has stabilized a bit more, but, regardless, I intend to keep building libgit2 so that it can be installed by non- There's still work to be done as far as:
The next thing I plan to address on that front is asking for some clarification from upstream on what language bindings should do about Unicode and what should be left to application programmers—in Racket terms, basically, where we should be using But none of that need delay this PR any longer! |
We install the native library as just "1.4", but "1.4.3" should be tried if our copy isn't there for some reason.
OH my goodness. Many thanks to @kengruven for bumping this PR. I will be honest with you, I have never been more than a caretaker on this project, which was written many years ago with a student of mine. I'm therefore going to merge this without anything that would really approximate a "review"; it does seem possible that I'll be a client of this package going forward, so perhaps I will have more of an opinion after I've actually tried it out. Many many thanks for all the work here! |
Not ready to merge.Finally ready to merge!I am trying to clean up the packaging of
libgit2
and get the test suite to run across platforms. This isn't done, but I thought I should open a pull request early to ask for input, especially if anyone is currently using this package successfully. (I have had some conversations about using this package and heard others on the mailing list, but I'm not sure how far anyone's gotten.)The first issue seems to me to be packaging the native libraries, as @jbclements started to do with
libgit2-x86_64-linux-natipkg
. Until this point there has been no native package for Mac, and Windows DLLs for i386 and x86_64 are checked into this repository, rather than being packaged in platform-specific dependencies with thecopy-foreign-libs
andinstall-platform
keys forraco setup
in theirinfo.rkt
files. (This repository also does not include a license or source code for upstreamlibgit2
, which seems like a GPL problem.)So far, I have packaged the binary for x86_64 Mac in
libgit2-x86_64-macosx
. Doing this exposed some further complications. The currently-checked-in Windows DLLs are for v0.26.0. When I tried to build that version, the corresponding test suite failed.On further investigation, I saw that[Update: libgit2 v0.28.0 has now been released.] They plan to release v1.0 around late March.libgit2
is about to release version v0.28.0 (as in, they've written the changelog and updated the version onHEAD
).To the extent we need to pick a version to develop against, my inclination is to target v1.0 (v0.28.0 for now) in getting this package working. There are a few breaking changes since v0.26.0, but they seem to be fairly few and well-documented. More significantly, there seem to have been several security updates since v0.26.0. I am optimistic that there shouldn't be too many changes needed in this package to support v1.0, and it seems like it would give a nice, stable target going forward.
A few other things that I hope to address:
natipkg
), rather than relying on a system version, because it sounds like system versions are often not up-to-date. Julia appears to take this approach. (I guess they uselibgit2
for their core package manager.)