Skip to content

Update libgit2 to 19ae843#870

Closed
Therzok wants to merge 2 commits into
vNextfrom
therzok/upgradeBinaries
Closed

Update libgit2 to 19ae843#870
Therzok wants to merge 2 commits into
vNextfrom
therzok/upgradeBinaries

Conversation

@Therzok

@Therzok Therzok commented Nov 14, 2014

Copy link
Copy Markdown
Member

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git_status_file has been changed to make an exact match.

@Therzok

Therzok commented Nov 14, 2014

Copy link
Copy Markdown
Member Author

While AppVeyor passed, Travis failed. https://travis-ci.org/libgit2/libgit2sharp/builds/41021886

@Therzok

Therzok commented Nov 14, 2014

Copy link
Copy Markdown
Member Author

libgit2/libgit2@82374d9 added API which can replace Branch.RemoteNameFromLocalBranch but it seems to return -1 when it doesn't find anything and that's not safe to use when treating errors.

@Therzok

Therzok commented Nov 15, 2014

Copy link
Copy Markdown
Member Author

libgit2/libgit2#2709 is a PR to fix the travis issues.

@Therzok

Therzok commented Nov 15, 2014

Copy link
Copy Markdown
Member Author

Found the cause after a lot of debugging with console runner and when we unload the app domain in CanProbeForNativeBinariesFromAShadowCopiedAssembly we screw up and end up with a double free in openssl locks.

So after we have
init AppDomain1
init AppDomain2
shutdown AppDomain2
shutdown AppDomain1

We get an error in code. Phew, this was frustrating.

/cc @carlosmn @ethomson

@Therzok

Therzok commented Nov 15, 2014

Copy link
Copy Markdown
Member Author

The commit above is a horrible hack. We need a way to expose this initializing to the end user. And need to explicitly state that this is available and should be done once and only once.

@Therzok

Therzok commented Nov 15, 2014

Copy link
Copy Markdown
Member Author

/cc @nulltoken @dahlbyk

@nulltoken

Copy link
Copy Markdown
Member

And need to explicitly state that this is available and should be done once and only once.

Couldn't we query libgit2 to check if it has already been done? /cc @carlosmn

@Therzok

Therzok commented Nov 17, 2014

Copy link
Copy Markdown
Member Author

@nulltoken on the C# side, we've pretty much fixed this case. But I still consider it a hack and the end user should do it.

We should also look into moving the http(s) backends into managed code.

Comment thread LibGit2Sharp/Core/NativeMethods.cs Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when you have two app domains using libgit2sharp but neither is the default app domain?

Would making git_libgit2_init return the initialization state (ie, are you the first caller) help here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why I said it's a horrible hack. That could work also.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, do we have a solution for this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it took so long here, with libgit2/libgit2#2743 merged, I think we should have a solution here. Would you mind trying it out?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I will do that later today. <3

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact, windows machine is dead. Need to wait a bit more. (Tomorrow mornin'!)

@Therzok

Therzok commented Nov 19, 2014

Copy link
Copy Markdown
Member Author

I'll bump the native functions further and bind git_push too.

@ethomson

ethomson commented Dec 3, 2014

Copy link
Copy Markdown
Member

@Therzok I think that libgit2/libgit2#2743 should help with the first-time initialization?

@nulltoken

Copy link
Copy Markdown
Member

@ethomson 😍

@Therzok

Therzok commented Dec 8, 2014

Copy link
Copy Markdown
Member Author

I'm in the progress of updating. TODO:

Edit: Bumping the libs resulted in:
CanCloneBarely attempting to read or write protected memory on Windows.
The lack of know-how on my side to fix this PEEL mess.
DoesNotReportRemotesWithAlreadyExistingRefSpec dying in native land on Mono.

@Therzok
Therzok force-pushed the therzok/upgradeBinaries branch from d8e21a5 to 12ace0a Compare December 8, 2014 01:06
@Therzok Therzok changed the title Update libgit2 to 65f6c1c Update libgit2 to 19ae843 Dec 8, 2014
@Therzok
Therzok force-pushed the therzok/upgradeBinaries branch 2 times, most recently from 9df5e54 to 7f68afb Compare December 8, 2014 01:16
@Therzok

Therzok commented Dec 8, 2014

Copy link
Copy Markdown
Member Author

I need more eyes here, I must've missed something from 65f6c1c to 19ae843.

@Therzok

Therzok commented Dec 8, 2014

Copy link
Copy Markdown
Member Author

@nulltoken Sir, your expertise is required, Sir!

@Therzok

Therzok commented Dec 8, 2014

Copy link
Copy Markdown
Member Author

@nulltoken I don't know what you did, but this is me after seeing both CI statuses.

@nulltoken

Copy link
Copy Markdown
Member

@Therzok

Therzok commented Dec 8, 2014

Copy link
Copy Markdown
Member Author

@nulltoken Ah. I see. Now help! :D

@nulltoken

Copy link
Copy Markdown
Member

@Therzok I had kind of an emergency to deal with in the past hours and haven't been able to take a look at it yet. 😕

I'll take a look tomorrow!

@Therzok

Therzok commented Dec 8, 2014

Copy link
Copy Markdown
Member Author

@nulltoken I was just kidding. No worries, awaiting review patiently.

@ethomson

Copy link
Copy Markdown
Member

You need to pick up the change to git_remote_callbacks from libgit2/libgit2@3149547

@ethomson

Copy link
Copy Markdown
Member
diff --git a/LibGit2Sharp/Core/GitRemoteCallbacks.cs b/LibGit2Sharp/Core/GitRemoteCallbacks.cs
index 3aec0bf..805ba84 100644
--- a/LibGit2Sharp/Core/GitRemoteCallbacks.cs
+++ b/LibGit2Sharp/Core/GitRemoteCallbacks.cs
@@ -23,6 +23,12 @@ internal struct GitRemoteCallbacks

         internal NativeMethods.remote_update_tips_callback update_tips;

+        internal NativeMethods.git_packbuilder_progress pack_progress;
+
+        internal NativeMethods.git_push_transfer_progress push_transfer_progress;
+
+        internal IntPtr push_update_reference;
+
         internal IntPtr payload;
     }
 }

@Therzok

Therzok commented Dec 10, 2014

Copy link
Copy Markdown
Member Author

Should we close this if the new PR is up?

@Therzok Therzok closed this Dec 10, 2014
@nulltoken nulltoken added this to the UnmergedOrDoNotRequireAFix milestone Dec 22, 2014
@nulltoken
nulltoken deleted the therzok/upgradeBinaries branch June 11, 2015 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants