libgit2 / libgit2sharp.nativebinaries

MIT License
29 stars 63 forks source link

How to find out Linux dependencies? #59

Closed JoshuaBStevens closed 3 years ago

JoshuaBStevens commented 6 years ago

I need a version of this package that supports libssl.so.1.0.2. Is there somewhere in the sources that the libssl dependency is expressed so I can check? Or can someone tell me if there is a version available on Nuget that does support that libssl version?

Thanks! -Josh

bording commented 6 years ago

@JoshuaBStevens The version of the library that ships in the NuGet package is built on Ubuntu 14.04 (from Travis CI), so it doesn't work with OpenSSL 1.0.2.

The plan is to eventually ship multiple binaries built against the default versions for the various repos that .NET Core supports: #51, but that hasn't been finished yet.

In the mean time, if you clone this repo and run build.libgit2.sh, it will pick up the version of OpenSSL you have installed. You'll then need to install that version and not use the version that comes in the NuGet package.

ctaggart commented 6 years ago

I think @bording is going to be able to close this soon.

based on https://github.com/libgit2/libgit2sharp.nativebinaries/pull/71 & https://github.com/libgit2/libgit2sharp.nativebinaries/pull/72

bording commented 6 years ago

Yep, things are getting very close. I was about to push up a new native binaries package, but released I forgot to update the props file in #71, so once #73 is merged, I'll be able to do that.

Then I'll need to open a LibGit2Sharp PR to use the new package. Once that's done, we should be able to get a new LibGit2Sharp prerelease up as well.

I'm fairly confident the new native binaries package should cover the all the operating systems supported by .NET Core, but there's always a chance I've missed something and will need to do another round of tweaking of the binaries included in the package. 🤞

kll commented 6 years ago

Did something change with how it was built between the versions 6311e88 (used in LibGit2Sharp 0.25.2) and 8e0b172 (used in LibGit2Sharp 0.25.3) for linux-x64? Long story short I can get 0.25.2 to work on my Arch Linux box but not 0.25.3. It appears that 6311e88 uses libcurl-gnutls.so.4 and 8e0b172 uses libcurl.so.4 based on the output from ldd on both versions of the library.

$ ldd libgit2-6311e88.so 
./libgit2-6311e88.so: /usr/lib/libcurl-gnutls.so.4: no version information available (required by ./libgit2-6311e88.so)
    linux-vdso.so.1 (0x00007ffcf01bf000)
    librt.so.1 => /usr/lib/librt.so.1 (0x00007f02585ca000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007f02585a9000)
    libcurl-gnutls.so.4 => /usr/lib/libcurl-gnutls.so.4 (0x00007f025852e000)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007f02584c1000)
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007f0258255000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007f025803e000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007f0257e78000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007f025893b000)
    libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x00007f0257e50000)
    libidn2.so.0 => /usr/lib/libidn2.so.0 (0x00007f0257c33000)
    libpsl.so.5 => /usr/lib/libpsl.so.5 (0x00007f0257a23000)
    libnettle.so.6 => /usr/lib/libnettle.so.6 (0x00007f02577ec000)
    libgnutls.so.30 => /usr/lib/libgnutls.so.30 (0x00007f025767d000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007f0257676000)
    libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007f02572f6000)
    libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x00007f02571c6000)
    libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x00007f0256fb3000)
    libhogweed.so.4 => /usr/lib/libhogweed.so.4 (0x00007f0256d7d000)
    libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f0256aea000)
    libffi.so.6 => /usr/lib/libffi.so.6 (0x00007f02568df000)
$ ldd libgit2-8e0b172.so 
./libgit2-8e0b172.so: /usr/lib/libcurl.so.4: version `CURL_OPENSSL_3' not found (required by ./libgit2-8e0b172.so)
    linux-vdso.so.1 (0x00007ffd44d85000)
    librt.so.1 => /usr/lib/librt.so.1 (0x00007fdc75cf5000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fdc75cd4000)
    libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007fdc75c4a000)
    libssl.so.1.0.0 => /usr/lib/libssl.so.1.0.0 (0x00007fdc75bdd000)
    libcrypto.so.1.0.0 => /usr/lib/libcrypto.so.1.0.0 (0x00007fdc75971000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007fdc7575a000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007fdc75594000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007fdc76067000)
    libnghttp2.so.14 => /usr/lib/libnghttp2.so.14 (0x00007fdc7556c000)
    libidn2.so.0 => /usr/lib/libidn2.so.0 (0x00007fdc7534f000)
    libssh2.so.1 => /usr/lib/libssh2.so.1 (0x00007fdc75121000)
    libpsl.so.5 => /usr/lib/libpsl.so.5 (0x00007fdc74f11000)
    libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007fdc74e81000)
    libcrypto.so.1.1 => /usr/lib/libcrypto.so.1.1 (0x00007fdc74bad000)
    libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00007fdc7495f000)
    libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00007fdc74676000)
    libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00007fdc74443000)
    libcom_err.so.2 => /usr/lib/libcom_err.so.2 (0x00007fdc7443d000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fdc74438000)
    libunistring.so.2 => /usr/lib/libunistring.so.2 (0x00007fdc740b6000)
    libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00007fdc73ea9000)
    libkeyutils.so.1 => /usr/lib/libkeyutils.so.1 (0x00007fdc73ea3000)
    libresolv.so.2 => /usr/lib/libresolv.so.2 (0x00007fdc73e8a000)

I know I'm running on an unsupported version of Linux but it WAS working. :)

bording commented 6 years ago

@kll There have been some changes in how the binaries are built, and it looks like the specific curl library has changed. Based on a quick search, it looks like you should be able to install the libcurl-compat package to get the required library.

Because this is such a hassle for so many people, we are looking at removing the OpenSSL & curl requirements from the native library altogether in the future. Instead, we'll handle that with managed code in LibGit2Sharp directly.

kll commented 6 years ago

I've already got that installed. It is why it worked at all before. :) Using ldd on all the various native binaries shows that if I could get it to try to use the fedora or rhel versions included in 0.25.3 it would work great and not even require libcurl-compat. I've thought about trying to do my own custom compile of the dotnet sdk to make it use fedora-x64 but that seems kinda overkill. Eliminating the native dependency on curl would certainly help. Or at least let the fallback linux-x64 RID use something a bit more modern and leave the super old insecure versions for specific RIDs that require them.

bording commented 3 years ago

Curl and OpenSSL have been removed as dependencies now, so this should be considered fixed.