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

Support Ubuntu 20.04 (Focal) #1747

Closed
gitfool opened this issue Dec 29, 2019 · 4 comments
Closed

Support Ubuntu 20.04 (Focal) #1747

gitfool opened this issue Dec 29, 2019 · 4 comments

Comments

@gitfool
Copy link

gitfool commented Dec 29, 2019

Not sure if this is related to #1585, so creating a separate issue.

See Cake.Dungeon Docker build where I'm doing a Cake build in a Docker container based on Ubuntu 20.04 (Focal) using the .NET Core 3.1 SDK nightly preview (Dockerfile). The build fails with error:

System.DllNotFoundException: Unable to load shared library 'git2-106a5f2' or one of its dependencies...

I'm using GitVersion 5.1.3, which is already using the latest LibGit2Sharp libraries AFAICT.

gitfool added a commit to gitfool/cake-docker that referenced this issue Dec 29, 2019
@patrolez
Copy link

patrolez commented Mar 30, 2020

I can see that this is related to OpenSSL version.

Since Ubuntu Eoan the OpenSSL 1.0 was taken out from the repository in favour of OpenSSL 1.1.

$ ldd bin/Debug/netcoreapp3.1/runtimes/linux-x64/native/libgit2-106a5f2.so 
        linux-vdso.so.1 (0x00007ffdcbfc0000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f5937950000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f593792d000)
        libssl.so.1.0.0 => not found
        libcrypto.so.1.0.0 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f593773c000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f5937ca2000)

@patrolez
Copy link

@gitfool It looks like #1714 solves this issue. It is included in 0.27-preview releases in NuGet.

Nope. It is not. Publishing packages still bundles wrong library - linked against OpenSSL 1.0 instead of 1.1 if target is linux-x64.

The solution is to target Ubuntu bionic runtime: dotnet publish -r ubuntu.18.04-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true

@dnperfors
Copy link

Any change that this bug will be fixed soon? Github will move their default linux agents to Ubuntu 20.04 which means that a lot of people will get breaking builds soon.

@ethomson
Copy link
Member

libssl is no longer a dependency for the LibGit2Sharp builds, thanks to #1618. Upgrading to the latest nuget package will fix this. https://www.nuget.org/packages/LibGit2Sharp/0.27.0-preview-0096

Viir added a commit to pine-vm/pine that referenced this issue Jan 1, 2021
Integrate new implementations from libgit2/libgit2sharp#1618

With the previous version, in deployments on Docker found the 'load from git' function in the Elm Editor did not work. The backend returned this error with the HTTP response:
```
Exception in volatile host:
System.AggregateException: One or more errors occurred. (The type initializer for 'LibGit2Sharp.Core.NativeMethods' threw an 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_clone(git_repository*& repo, String origin_url, FilePath workdir_path, GitCloneOptions& opts)
   at LibGit2Sharp.Core.Proxy.git_clone(String url, String workdir, GitCloneOptions& opts)
   at LibGit2Sharp.Repository.Clone(String sourceUrl, String workdirPath, CloneOptions options)
   at Kalmit.LoadFromGithub.LoadFromUrl(String sourceUrl) in /app/PersistentProcess/PersistentProcess.Common/LoadFromGithub.cs:line 109
   at Kalmit.LoadFromPath.LoadTreeFromPath(String path) in /app/PersistentProcess/PersistentProcess.Common/LoadFromPath.cs:line 11
[...]
```

See the discussion of the problem at libgit2/libgit2sharp#1798 and libgit2/libgit2sharp#1747

Another workaround found in the discussion was switching to the bionic flavor of the .net docker image.
8 added a commit to 8/git-contributors that referenced this issue Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants