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

Libgit2 error on Mac OSX (12.2.1) #735

Open
bondpp7-2 opened this issue Apr 13, 2022 · 1 comment
Open

Libgit2 error on Mac OSX (12.2.1) #735

bondpp7-2 opened this issue Apr 13, 2022 · 1 comment
Labels

Comments

@bondpp7-2
Copy link

bondpp7-2 commented Apr 13, 2022

Trying to run nbgv set-version fails when run on a Max with OSX version 12.2.1, but works on our Windows machines.
With NBGV version 3.4.255, for a .NET 6 app.

The following error was recorded:

Unhandled exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception.
---> System.DllNotFoundException: Unable to load shared library 'git2-6777db8' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(libgit2-6777db8, 0x0001): tried: 'libgit2-6777db8' (no such file), '/usr/local/lib/libgit2-6777db8' (no such file), '/usr/lib/libgit2-6777db8' (no such file), '/Users/{user}/Documents/Git.nosync/Streamline/SL.Magellan/libgit2-6777db8' (no such file), '/usr/local/lib/libgit2-6777db8' (no such file), '/usr/lib/libgit2-6777db8' (no such file)
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_libgit2_opts(Int32 option, UInt32 level, String path)
at LibGit2Sharp.Core.Proxy.git_libgit2_opts_set_search_path(ConfigurationLevel level, String path)
at LibGit2Sharp.GlobalSettings.SetConfigSearchPaths(ConfigurationLevel level, String[] paths)
at Nerdbank.GitVersioning.LibGit2.LibGit2Context.OpenGitRepo(String path, Boolean useDefaultConfigSearchPaths)
at Nerdbank.GitVersioning.LibGit2.LibGit2Context..ctor(String workingTreeDirectory, String dotGitPath, String committish)
at Nerdbank.GitVersioning.GitContext.Create(String path, String committish, Boolean writable)
at Nerdbank.GitVersioning.Tool.Program.OnSetVersionCommand(String project, String version) in D:\a\1\s\src\nbgv\Program.cs:line 461
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Span`1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at System.Delegate.DynamicInvoke(Object[] args)
at System.CommandLine.Invocation.ModelBindingCommandHandler.InvokeAsync(InvocationContext context)
at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseErrorReporting>b__21_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass25_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass23_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__22_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseParseDirective>b__20_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<UseDebugDirective>b__11_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__10_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.Builder.CommandLineBuilderExtensions.<>c__DisplayClass14_0.<<UseExceptionHandler>b__0>d.MoveNext()
@AArnott
Copy link
Collaborator

AArnott commented May 12, 2022

The nbgv commands that must author git commits rely on libgit2 which has to be unique for every linux distro and probably every mac version. We haven't updated to add newer versions/distros in a while so this might be why. I wonder if libgit2sharp has support for this mac osx version.

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

2 participants