dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
19.02k stars 4.03k forks source link

Cannot build on Ubuntu 18.04 TLS #29289

Closed jaredpar closed 5 years ago

jaredpar commented 6 years ago

When I attempt to execute the build scripts which publish, as does test.sh, I get the following error

/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly. [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.GitLoaderContext.LoadUnmanagedDll(String unmanagedDllName) in /_/src/Microsoft.Build.Tasks.Git/GitLoaderContext.cs:line 48 [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods..cctor() [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    --- End of inner exception stack trace --- [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Repository.Discover(String startingPath) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 50 [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.LocateRepository.Execute() in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:line 22 [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]
/home/jaredpar/.nuget/packages/microsoft.build.tasks.git/1.0.0-beta-63119-01/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/jaredpar/code/roslyn/src/Tools/ILAsm/IlAsmDeploy.csproj]

Repro Steps:

CC @tmat

tmat commented 6 years ago

Have you tried updating to 1.0.0-beta-63127-02?

jaredpar commented 6 years ago

@tmat this comes bundled with RepoToolset in other repositories where I'm also hitting this hence I can't update the individual package.

tmat commented 6 years ago

The default version can be overridden by specifying <MicrosoftSourceLinkVersion> in the props file.

jaredpar commented 6 years ago

@tmat

That does not fix it. How can I disable source link entirely until we find a wokr around here? Completely blocked at the moment.

/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly. [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.GitLoaderContext.LoadUnmanagedDll(String unmanagedDllName) in /_/src/Microsoft.Build.Tasks.Git/GitLoaderContext.cs:line 48 [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods..cctor() [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    --- End of inner exception stack trace --- [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Repository.Discover(String startingPath) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 50 [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.LocateRepository.Execute() in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:line 22 [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/jaredpar/code/diagnostics/src/SOS/SOS.NETCore/SOS.NETCore.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly. [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.GitLoaderContext.LoadUnmanagedDll(String unmanagedDllName) in /_/src/Microsoft.Build.Tasks.Git/GitLoaderContext.cs:line 48 [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods..cctor() [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    --- End of inner exception stack trace --- [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Repository.Discover(String startingPath) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 50 [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.LocateRepository.Execute() in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:line 22 [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/jaredpar/code/diagnostics/src/Microsoft.Diagnostic.TestHelpers/Microsoft.Diagnostic.TestHelpers.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: The "Microsoft.Build.Tasks.Git.LocateRepository" task failed unexpectedly. [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018: System.TypeInitializationException: The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an exception. ---> System.DllNotFoundException: Unable to load shared library '/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: /usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by /home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/../tools/netcoreapp2.0/runtimes/linux-x64/native/libgit2-b0d9952.so) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.InternalLoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.LoadUnmanagedDllFromPath(String unmanagedDllPath) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.GitLoaderContext.LoadUnmanagedDll(String unmanagedDllName) in /_/src/Microsoft.Build.Tasks.Git/GitLoaderContext.cs:line 48 [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at System.Runtime.Loader.AssemblyLoadContext.ResolveUnmanagedDll(String unmanagedDllName, IntPtr gchManagedAssemblyLoadContext) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_libgit2_init() [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.InitializeNativeLibrary() [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods..cctor() [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    --- End of inner exception stack trace --- [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.NativeMethods.git_buf_free(GitBuf buf) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Core.Proxy.ConvertPath(Func`2 pathRetriever) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at LibGit2Sharp.Repository.Discover(String startingPath) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.RepositoryTasks.LocateRepository(LocateRepository task) in /_/src/Microsoft.Build.Tasks.Git.Operations/RepositoryTasks.cs:line 50 [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.Tasks.Git.LocateRepository.Execute() in /_/src/Microsoft.Build.Tasks.Git/LocateRepository.cs:line 22 [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
/home/jaredpar/code/diagnostics/.packages/microsoft.build.tasks.git/1.0.0-beta-63127-02/build/Microsoft.Build.Tasks.Git.targets(20,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask) [/home/jaredpar/code/diagnostics/src/SOS/lldbplugin.tests/TestDebuggee/TestDebuggee.csproj]
tmat commented 6 years ago

This should do /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false

tmat commented 6 years ago

Is OpenSSL installed on that machine?

tmat commented 6 years ago

@bording Any idea?

bording commented 6 years ago

It's possible that there are some issues with the bundled native library that gets chosen for Ubuntu 18.04. I might need to update the package to include an 18.04-specific lib.

I'll have to test a few things and see if that's the problem.

bording commented 6 years ago

/usr/lib/x86_64-linux-gnu/libcurl.so.4: version `CURL_OPENSSL_3' not found

Ah, yeah that's going to be the problem. I think Ubuntu 18.04 updated the version of curl they ship, so we're going to need a new lib built against 18.04's curl.

tmat commented 6 years ago

Can libgit2 bundle the curl library?

tmat commented 6 years ago

It's unfortunate that OS updates like these break it.

tmat commented 6 years ago

I guess the benefit is that we get security fixes for "free", so bundling is not ideal.

tmat commented 6 years ago

Still, it would be good if it could be more resilient against updates.

bording commented 6 years ago

Can libgit2 bundle the curl library?

That would be a call I can't make. @ethomson would be the person to ask that. In general, I know that the idea of bundling other libraries is frowned on, especially things that have security concerns, OpenSSL for example.

bording commented 6 years ago

Another workaround for now would be to make sure libcurl3 is installed. Looks like 18.04 only includes libcurl4 by default.

bording commented 6 years ago

Still, it would be good if it could be more resilient against updates.

This is not likely something that would break because of an update, but a whole new major version of a distro.

jaredpar commented 6 years ago

In the case libgit2 can't be loaded is it possible to have the task fail with a warning instead of a hard error? I wouldn't have shippable binaries but at least I'd be able to continue coding until the fix was available.

It's unfortunate that OS updates like these break it.

This worries me about. Consider servicing. It's common that we must build old repositories on significantly newer operating systems. Are we putting ourselves in a position that in order to service our binaries we first have to update our toolsets?

ethomson commented 6 years ago

Can libgit2 bundle the curl library?

As you mentioned - we wouldn't want to put people in a position where libgit2 was shipping a vulnerable version of OpenSSL. It's not obvious to users that we would be shipping SSL libraries ourselves and that they need to update it.

I'm dismayed by this situation, though. We're continuing to bundle more native binaries, increasing the size of the package and the complexity of our native loaders - all to support minor differences in the distributions of OpenSSL. Taking a step back, I see three options:

  1. Build a version of LibGit2Sharp without networking Do you need to fetch or push? If not, you don't need networking and you don't need an OpenSSL dependency. We could easily build a LibGit2Sharp.LocalOnly package (or LibGit2Sharp.NoHTTPS, or whatever the name is) and you can quit worrying about libcurl and OpenSSL.
  2. Use .NET's HTTP library libgit2 can use arbitrary transports, including user-provided ones. This is exposed in LibGit2Sharp, and our tests do exactly this, providing a transport layer using .NET HttpWebResponse. This would allow us to build a version of libgit2 without an OpenSSL dependency, but use .NET's functionality to fetch and push.
  3. Dynamically load the transport libraries in libgit2 Instead of linking directly against curl and OpenSSL and the like, dyload them. This means that we don't have to worry about distributions that have decided to rename the SSL libraries to something random, but it's more complexity and rather disappointing.
bording commented 6 years ago

@ethomson Option 2 certainly sounds like the best choice to me! Getting rid of any additional native dependencies that libgit2 has drastically simplifies things.

tmat commented 6 years ago

@ethomson @bording When do you think [2] can be done?

ethomson commented 6 years ago

@tmat I won't have time to dig into this any time soon, regrettably. I'm completely booked for the next two weeks. I should have some time after labor day.

bording commented 6 years ago

I might have some time this weekend to start looking at it.

tmat commented 6 years ago

Thanks!

tmat commented 6 years ago

@bording @ethomson Have you had a chance to make some progress on this?

bording commented 6 years ago

@tmat Unfortunately, I haven't had time to get to it yet.

tmat commented 6 years ago

@bording Any eta? More and more folks are running into this issue with SourceLink :(

bording commented 6 years ago

Nothing new to report yet, hopefully soon!

tmat commented 6 years ago

@bording Any updates? It's been a while...

bording commented 6 years ago

Work has begun!

https://github.com/libgit2/libgit2sharp.nativebinaries/pull/77 https://github.com/libgit2/libgit2sharp/pull/1618

tmat commented 6 years ago

Very nice!

bording commented 5 years ago

@tmat While waiting for the real fix (removing the native dependencies on curl and OpenSSL) to be ready, I've gone ahead and pushed up LibGit2Sharp 0.26.0-preview-0062 that has an ubuntu.18.04-x64 binary as well, so you should be able to get this working now.

rvdginste commented 5 years ago

@ethomson @bording

From the 3 options @ethomson listed, is option 1, a LibGit2Sharp.LocalOnly package, still being considered? Maybe I'm missing something, but it would seem that for Microsoft.Build.Tasks.Git in the context of SourceLink, no actual network access is needed. If a 'local-only' package would avoid some of the problems with supporting multiple linux distros, then this seems a good solution. For the last half year, the only way I ever got Microsoft.Build.Tasks.Git to work on my machine (Debian Buster), is by building the libg2sharp.nativebinaries myself locally and replacing the binaries that are included in the nuget package by my own....

ethomson commented 5 years ago

@rvdginste libgit2 no longer takes a dependency on libcurl. The latest 0.26.0-preview packages don't require it.

In addition, some work began on option #2 mentioned above, using the .NET HTTP stack: https://github.com/libgit2/libgit2sharp/pull/1618. I'm working on a libgit2 release so I haven't had much time to work on this.

Removing networking entirely is not impossible, of course, but has rather limited use. I'd encourage you to try one of the latest LibGit2Sharp package. Producing some bespoke non-networking version is possible, but not particularly satisfying.

Most importantly, LibGit2Sharp is chronically underfunded with contributors, so it's unlikely to make any progress in the near future.

rvdginste commented 5 years ago

@ethomson Thanks for explaining. I will try the binaries of the 0.26.0-preview packages and check whether those work for me.

Update: I tried with those binaries, but they also do not work out-of-the-box for me. The RID for my system is "debian-x64". In Microsoft.Build.Tasks.Git this is not provided, and it falls back on the binaries for "linux-x64", which do not work on my system. The binaries for "debian.9-x64" that are provided, do work. Is there a way to override the to-be-used RID?

yetanotherchris commented 5 years ago

I had this same issue on Ubuntu 18 LTS with 2.2;

dotnet build /p:EnableSourceControlManagerQueries=false /p:EnableSourceLink=false /p:DeterministicSourcePaths=false

(mentioned above) fixed it for now.

tmat commented 5 years ago

Source Link does no longer depend on a native library, so this shouldn't be a problem anymore.