Skip to content
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

Can't run on Ubuntu 20.10 #40

Open
cszczepaniak opened this issue Mar 5, 2021 · 6 comments
Open

Can't run on Ubuntu 20.10 #40

cszczepaniak opened this issue Mar 5, 2021 · 6 comments
Labels

Comments

@cszczepaniak
Copy link

I get the error below when running on Ubuntu 20.10. I did a bit of research on this and it appears that LibGit2Sharp just doesn't support this version on Linux. Is there any way around this, or a way to make cross platform support more robust?

Unhandled exception. System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
 ---> System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgit2-106a5f2: cannot open shared object file: No such file or directory
   at LibGit2Sharp.Core.NativeMethods.git_libgit2_init()
   at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary()
   at LibGit2Sharp.Core.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at LibGit2Sharp.Core.NativeMethods.git_repository_discover(GitBuf buf, FilePath start_path, Boolean across_fs, FilePath ceiling_dirs)
   at LibGit2Sharp.Core.Proxy.<>c__DisplayClass219_0.<git_repository_discover>b__0(GitBuf buf)
   at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever)
   at LibGit2Sharp.Core.Proxy.git_repository_discover(FilePath start_path)
   at LibGit2Sharp.Repository.Discover(String startingPath)
   at GitIStage.Program.ResolveRepositoryPath() in /home/connor/src/git-istage/src/git-istage/Program.cs:line 37
   at GitIStage.Program.Main() in /home/connor/src/git-istage/src/git-istage/Program.cs:line 15
Aborted (core dumped)
@cszczepaniak
Copy link
Author

After a bit more research, it may be possible to also include a reference to LibGit2Sharp.NativeBinaries: https://stackoverflow.com/questions/35028958/not-able-to-run-libgit2sharp-on-mono-on-ubuntu

@giggio
Copy link

giggio commented Dec 31, 2021

I can confirm the problem, it also happens on Ubuntu 20.04.

@miko007
Copy link

miko007 commented Aug 15, 2022

this exact problem also happens on M1 Mac unter macOS "Monterey".

@terrajobst
Copy link
Owner

I can reproduce this; it seems the root cause is that LibGitSharp2 doesn't support Ubuntu 20.x yet. It seems they fixed this (libgit2/libgit2sharp#1747) but even latest preview didn't fix this yet. I'll need to take a closer look again.

@yurikus
Copy link
Contributor

yurikus commented Nov 29, 2022

FWIW I was able to make this work by creating a properly versioned directory under runtimes directory and copying the .so there.
It was some time ago and I doubt I have the VM still.

Overall yes, using raw git would be better

@ubhaya
Copy link
Contributor

ubhaya commented Apr 15, 2023

this error is throwing on Ubuntu 22.04.2 LTS. is there any solution or patch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants