Comments (5)
A bug report has been filled @ http://bugzilla.xamarin.com/show_bug.cgi?id=2266
from libgit2sharp.
- Updated the bugzilla with a repro case
- Had a (very cool) chat session with @joncham on this topic.
from libgit2sharp.
So, I think I tracked down the issue. The problem is here: https://github.com/libgit2/libgit2sharp/blob/vNext/LibGit2Sharp/Core/NativeMethods.cs#L30
A call to a pinvoke method is in the same method that sets the PATH variable. When mono attempts to JIT the .cctor of NativeMethods it tries to load git2.dll. Note this is when JIT'ing the method itself. That means the body of the method has not yet executed, and the PATH variable has not been adjusted. I think the easiest way to solve this is to extract the pinvoke call, git_threads_init, into a separate method that can be called from the .cctor and mark it with the NoInlining option. This should give the JIT the chance to run the body of the .cctor before trying to resolve the native library for the pinvoke call.
[MethodImpl(MethodImplOptions.NoInlining)]
static void InitGit()
{
NativeMethods.git_threads_init();
}
from libgit2sharp.
And I created a pull request: #190
from libgit2sharp.
And I created a pull request: #190
@joncham And I (gladly) merged it...
...And you're fantastic!
from libgit2sharp.
Related Issues (20)
- Certificate Verification Failed "unknown certificate lookup failure" HOT 1
- Replace <PackageLicenseFile> with <PackageLicenseExpression>
- CommitLog order does not reflect order of commits.
- Error pushing to github using 0.26.2 HOT 4
- Unable to push the commit to the Bitbucket Repository in C# using LibGit2Sharp
- Exception when using it inside a Visual Studio 2022 Extensibility project HOT 6
- SSL error; syscall failure: Connection reset by peer when push 1.3 GB filesize
- Capture error details of "remote unpack failed"
- Disable SSL Certificate Check: 'unknown certificate lookup failure: 33'
- "LibGit2Sharp.LibGit2SharpException: could not initialize security context" while cloning HOT 6
- LibGit2Sharp throws an exception when discovering a git config with setting core.repositoryformatversion=1 and extensions.worktreeconfig=true HOT 1
- The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
- Consider using SafeHandle in Libgit2Object instead of void*
- Is there a way to apply a patch file into a repository by using this lib?
- LibGit2Sharp.LibGit2SharpException: could not set credentials: could not open libssl
- "remote authentication required but no callback set" in pull after upgrading from 0.28 to 0.29
- Git clone causes an "SSL error: syscall failure:" with a specific repo HOT 4
- LibGit2Sharp.LibGit2SharpException | too many redirects or authentication replays HOT 2
- LibGit2Sharp.LibGit2SharpException:“too many redirects or authentication replays”
- Failed to load native git library inside a powershell module
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libgit2sharp.