roslyn: Cannot build on Ubuntu 18.04 TLS
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:
- Clone
- Run
./build.sh --restore --build --test
CC @tmat
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 36 (19 by maintainers)
Commits related to this issue
- sourcelink * See: https://github.com/dotnet/roslyn/issues/29289 — committed to dotnet/nuget-trends by bruno-garcia 5 years ago
- Bumped source link - Was causing issues building on ubuntu 18.04 https://github.com/dotnet/roslyn/issues/29289 — committed to JeringTech/Javascript.NodeJS by JeremyTCD 5 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.
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 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.Work has begun!
https://github.com/libgit2/libgit2sharp.nativebinaries/pull/77 https://github.com/libgit2/libgit2sharp/pull/1618
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:
HttpWebResponse
. This would allow us to build a version of libgit2 without an OpenSSL dependency, but use .NET’s functionality to fetch and push.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.@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.