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
WIP: andrioni's Libgit2 work #7339
Conversation
@andrioni have you pushed all your changes into your LibGit2.jl fork? |
I can confirm that this works for me so far. |
Are we going to use CMake or write a custom Makefile for libgit? |
0.21.0 was released today. I was scared this would be a nightmare on Windows until I built the package last night. Still needs a lot of work on tests, but building might not be too bad. For Windows we want Please make the path to |
I think there might be some changes yet to push, and the code is definitely still dirty and WIP-y, but it does include most changes. I haven't integrated @jakebolewski's test suite yet too. |
@tkelman libgit2sharp provides the Git integration for visual studio so a lot of work has gone into making it work well on Windows. |
I do have to update it to 0.21 too (which was released today), but libgit2's test suite should pass, except for one issue on OS X due to UTF-8 filename normalization. |
Oops, now the branch is up-to-date. |
@jakebolewski - yes, for Visual Studio. There's an enormous divide between Visual Studio and MinGW, and you can never quite tell whether MinGW is a priority after a project has gone with cmake. |
@andrioni unfortunately the way this is written will not work cross platform. I manully padded out the structs to get the ball rolling but this will fail on 32 bit systems. @tkelman also has said that most of the tests do not work on Windows as well. I also think we should drop the api module, it would be much cleaner and it didn't save much code duplication in the end. |
Is there a better way to deal with this other than handcoding the padding, especially since padding in C structs is (IIRC) implementation-defined? |
mtime_seconds::Int64 | ||
mtime_nanoseconds::Cuint | ||
|
||
#TODO: why is this necessary?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the following padding is actually part of git_index_time (on a 64-bit system)
you shouldn't try to manually expand recursive structs, just make immutable types containing only other bitstypes and Julia should work out the padding correctly to the C-API
I've just pushed more commits. It is now 0.21-based and passes the |
Will need to support cross-compile, for the sake of building the Windows nightlies. Unless we expect to just use a set of libgit binaries for everything, though we're not doing that for any other base deps (should we?) so it might be a little odd to do it here. It's only called |
Yep. I imagine a lot of that code will get shuffled around as the code gets further adapted from package into base module. |
Oh well, it builds |
Ah, I see @StefanKarpinski is making a to-do list up top, good idea. Also this should be cross-referenced, @quinnj is making headway on addressing the test failures over in https://github.com/jakebolewski/LibGit2.jl/pull/10 |
Credit where it is due: I think the todo list is @andrioni's, not mine. I just created the pull request. I've been largely MIA this week since I'm at a lake house in upstate New York. There's wifi, but it's hard not to spend the entire day on the lake given the gorgeous weather :-) |
Later today (probably after the game) I'll send to @jakebolewski the extra changes I made to |
I'll also try to work through the rest of the immutable type refactor work I had started today and tomorrow. |
Sometimes I get a weird error while cloning a package ("Error receiving socket data: Interrupted system call"), and from what I saw half of the error message comes from libuv. Any idea on why would it happen? |
I have been working on this over the past week and once we can get the test suite working on Windows the remainder of these open issues should be able to be closed. Thanks to @tkelman for the libgit2 Windows RPM and the BinDeps script as well as @quinnj for his help sorting through Windows issues. Git merge / clone issues still need to be worked out but I feel we are over the hump with the large changes that needed to happen on the LibGit side. |
I want to merge this into master now that we're in the dev window for 0.4. If I merge this as is, will I break everything or can we sort it out afterwards? I don't really care that we're not using it yet, I just want to start having people on master building libgit2 as part of Julia so that we can start sorting out build issues at least. |
likely breakages but yes we should start making progress here one way or another |
I suspect that merging is a great way to force the fixing of the 32-bit problems ;-) What's the cross compile issue? |
Cross compiling with cmake is an unmitigated disaster? I'm fiddling with it and am stuck at |
Ah, that. Since I don't cross-compile, I was blissfully unaware of this problem. |
Okay the queue wasn't too bad. Travis on osx says:
So, as I said in August, this is going to require somewhat serious OSX build system changes. The other alternative is pre-generating a custom set of Makefiles to avoid using cmake, maybe just on OSX where this is the biggest problem. But @Keno has done some other work on pieces of LLVM that could only be fully built with cmake, so I think getting things to work better with cmake is a better plan. |
Couldn't CC be unset/reset before CMake is invoked? |
I think setting |
I'm about to push a commit where I move all the |
Looks like it more or less worked, the OSX build on Travis (nice, hardly any queue at all) gets to the same bootstrap failure as on Linux. Still needs to be checked that the flags are getting sent everywhere they need to be (I tweaked the to-do list up top accordingly). |
It has taken quite awhile to remove all uses of CFLAGS, etc., so that system packagers (which expect to be able to override CFLAGS) work properly. Please don't break that |
Also, JCFLAGS is for flags only needed for the Julia system library, whereas CC has the flags we want set everywhere |
We might need a separate DEPSCFLAGS or something like that. I contemplated that for the libcxx cmake build, but since that was only once case it wasn't so bad. |
We can't do that anymore, not in |
And by necessity, this is going to break almost everything for a little while. That's the only way it'll ever actually happen. It's long overdue, let's just stumble our way through it. |
Hot damn, just commenting out the broken parts gave a green build on Travis (and for me locally). That's not too meaningful, but it's a start. Should we merge and pick up the pieces as we go then? Dibs on Also writing down so I don't forget this, an interesting thing to note is libgit2 bundles copies of zlib and http-parser, possibly the same version as we use in the package? We may be able to just use those dependencies from libgit in those packages once this is up and running. |
Can we separate out building libgit2 in base with switching Pkg to use libgit2? This branch uses a version of LibGit2.jl from May and much of the library has been completely rewritten to address some of the problems mentioned in this thread. These changes were never incorporated back into this branch. Once we have libgit2 the library being reliably built as a dependency (with some trivial checks for correctness) we can start to rewrite Pkg. LibGit2.jl is completely broken at the moment on 0.4. Tracking master has been a losing battle for awhile so I kind of gave up. Since it seems like no massively breaking changes are on the immediate horizon now seems like a good time to fix those problems and work on this again. |
@jakebolewski that's about what I thought. You know the most about what needs to be done to get the libgit julia bindings up to date and tested, then we can use them for Pkg. I do think this should build the library dependency everywhere now, with the caveat that the rearrangement of the makefile flags might not be perfectly kosher yet. |
This seems like a good plan. Would one of you be willing to take a crack at separating the build part out into a new PR? (I'm still traveling although I'm getting there...) |
as I said, you're potentially messing up the build for packagers and cross compilers. please don't do that. of course, Keno already broke it over the summer with f38b485 dropping
OK, but let's not break the build [some of the more esoteric and thus less tested ones, in this case] to do it. please? |
Git is fighting against me but I can do it.
The cross compile works (except for 32-bit Linux from 64-bit Linux because of the Packaging is a valid concern, as is the effect of moving the |
moving them to if you want to move them out of |
I'll try a different approach. Maybe make new variables |
Let's see how #8820 works for just adding the build dependency. None of the changes to base from here are included. |
Why should it affect packagers? Because of cross-compilation? For me at least, there's no cross-compilation involved when building packages. |
Closing. Build system parts merged in #8820, base parts to be superseded by @jakebolewski shortly |
with a fair bit of digging, it seems that the lack of support is probably due to there being an however, it seems unlikely that anyone will hit that assert in real-world usage -- did anyone actually use junction / reparse / mount points prior to vista, except perhaps for the julia build? Line 812 in bfa51bb
|
I seem to recall also seeing some unicode / locale related comments in a few PR's to libgit2 between 0.20 and 0.21. We should probably just ask the libgit2 devs via mailing list or IRC, they don't bite.
Don't think so, not commonly anyway.
Has Julia ever been compiled successfully from XP? IIRC something in LLVM failed to compile or link last time I tried, but it was months ago. Maybe it worked once upon a time, but I don't think it's been possible for at least a year or so. (ref #6002) |
i compiled most of julia in a piecemeal fashion on XP several months ago while doing some platform testing I saw there was a Vista-only flag in the unicode-conversion stuff, but it was conditional on a test for the windows version, so it didn't look like an issue. I tried asking on the IRC channel awhile back, but the right people weren't online |
I'm making this into a pull request for easier discussion and so that I can check it out more easily.
Edit: Hijacking to make a task list.
Todo list
libgit2.so
apparently is generated (lines 1303 and 1304).Base.add!
undefined variable error-stdlib=libc++ -mmacosx-version-min=10.7
flags getting added toCC
on Mac, which Cmake doesn't likeCC
toJCFLAGS
works everywhere it needs to