-
Notifications
You must be signed in to change notification settings - Fork 895
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
Update libgit2 #1298
Update libgit2 #1298
Conversation
Update to NativeBinaries 1.0.137, update paths to `lib` from `NativeBinaries`. Update name of Windows 64-bit library to 'x64' to reflect Microsoft's recommended naming.
Make GitWriteStream a struct instead of a class so that we can accept a native `git_writestream`. Use `git_blob_fromstream` to stream data into a blob instead of the now-removed `git_blob_fromchunks`.
The issue in #1170 AFAICT is mono prepending |
Pretty sure that the problem is that it prepends lib if it's not already there. |
But yeah let's validate this before we merge this. I hate changing the name if it's not going to work. |
Can't you please merge this into an unstable branch and release it as a prerelease package on NuGet? That way, I can update to the prerelease package in GitTools/GitVersion#816 and confirm whether the changes fixes |
@asbjornu Please try this nuget package: |
@asbjornu Are you able to test this? |
@ethomson I just downloaded the file you linked so I could try it out myself, but it looks like that package only has the windows native binaries included! |
Oh FFS. I'll rev the libgit2 version without this libs change so that we can actually make progress on other things. |
@bording I see all the platforms in the NativeBinaries package that the aforementioned nupkg references:
|
@ethomson Ugh, nevermind, I'm dumb. Sorry for the trouble. I was looking at the wrong package. 😦 Let me test this real quick. |
Ok, I just created a quick sample and this looks to be working perfectly. I was able to successfully run my sample in Ubuntu while my current directory was not the same directory as the program! 👍 This change works! |
Thanks @bording ! 👯 |
Due to NuGet/Home#1874, I'm unable to update this on OS X, but I'm setting up a Windows VM to perform the necessary |
I've managed to update to your custom built package, @ethomson (as well as to NativeBinaries version 1.0.137) and this is the result on my end: System.TypeInitializationException : The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
----> System.DllNotFoundException : NativeBinaries/osx/libgit2-785d8c4.dylib
at LibGit2Sharp.Core.Proxy.git_repository_init_ext (LibGit2Sharp.Core.FilePath workdirPath, LibGit2Sharp.Core.FilePath gitdirPath, Boolean isBare) in <filename unknown>:line 0
at LibGit2Sharp.Repository.Init (System.String path, Boolean isBare) in <filename unknown>:line 0
at LibGit2Sharp.Repository.Init (System.String path) in <filename unknown>:line 0
at GitTools.Testing.EmptyRepositoryFixture.CreateNewRepository (System.String path) in <filename unknown>:line 0
at GitTools.Testing.RepositoryFixtureBase..ctor (System.Func`2 repoBuilder) in <filename unknown>:line 0
at GitTools.Testing.EmptyRepositoryFixture..ctor () in <filename unknown>:line 0
at PullRequestInTeamCityTest.GivenARemoteWithATagOnMaster_AndAPullRequestWithTwoCommits_AndBuildIsRunningInTeamCity_VersionIsCalculatedProperly (System.String pullRequestRef) in <filename unknown>:line 0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) in <filename unknown>:line 0
--DllNotFoundException
at (wrapper managed-to-native) LibGit2Sharp.Core.NativeMethods:git_libgit2_init ()
at LibGit2Sharp.Core.NativeMethods+LibraryLifetimeObject..ctor () in <filename unknown>:line 0
at LibGit2Sharp.Core.NativeMethods..cctor () in <filename unknown>:line 0 |
I'm not sure what the path |
@asbjornu If your code is still looking for |
@bording Yes, indeed. After a thorough clean and rebuild, it now seems to be working! When can I expect to see version |
@ethomson @carlosmn @nulltoken Anyone? A release of this on NuGet is the only thing I need now to get GitVersion working on Mono. 😄 |
Version 0.23.0 of libgit2sharp will likely come at the same time as the next libgit2 release in a few months. |
@carlosmn Ah, ok. Any chance of a pre-release on NuGet until then? It's a bit hard to change the reference from an external one on NuGet to a local one. |
Add a conditional on the GitVersionTask import so it's not imported on Unix, until GitTools/GitVersion#816 is fixed through a (pre-) release of libgit2/libgit2sharp#1298 on NuGet.
Add a conditional on the GitVersionTask import so it's not imported on Unix, until GitTools/GitVersion#816 is fixed through a (pre-) release of libgit2/libgit2sharp#1298 on NuGet.
@ethomson Brilliant, thanks! |
This depends on libgit2/libgit2#3724, as we were bombing one of the submodule status tests when looking for a submodule named
sm_changed_head/
with a trailing slash. (Sigh.)This uses the fancy new LibGit2Sharp.NativeBinaries where the native binaries now live in
lib
instead ofNativeBinaries
. That means that this should fix #1170. So please argue if you think this is a terrible idea.Otherwise, once libgit2/libgit2#3724 is merged, I will reroll a new LibGit2Sharp.NativeBinaries nuget package and update this to use that.