jedisct1/libsodium

CentOS 6 / RHEL 6 nuget libsodium Runtime ID

Closed this issue · 5 comments

Hi there,

Deploying a .NET Core 2.1 application on CentOS 6 (technically with a small curveball since it's the runtime id of RHEL 6) throws a bunch of libsodium errors (note the weird liblibsodium).

Unhandled Exception: System.DllNotFoundException: Unable to load shared library 'libsodium' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: liblibsodium: cannot open shared object file: No such file or directory

From what we figured out it's because the .so from the nuget package isn't compatible with CentOS 6 (building a libsodium.so on centos6 and copying it over the build output works perfectly).

Looking over prepare.py I see there's only a generic linux-x64.
Would it be fine to send a pull request adding rhel.6-x64 with the docket centos 6 container ? (or maybe try the generic centos-x64 to see if it helps)

Hmm, let's see. In the .NET Core RID Catalog, there is no RID for CentOS 6. So it falls back to "centos-x64", which falls back to "rhel-x64", which falls back to "linux-x64", which is provided in the nuget package. From that point of view it should work1.

However, the Supported OS versions page for .NET Core 2.1 says that CentOS 6 is not supported. No effort is made to provide the libsodium nuget package for platforms that are not officially supported by .NET Core.

(1 provided that CentOS 6 comes with a sufficiently recent glibc)

@ektrah I understand your reasoning but there are a few 'weird' things that seem to happen in production.

  1. On CentOS 6 it works perfectly well with the rhel.6 RID (that's on the supported page since .NET Core 2.1)
  2. "rhel.6" has a fallback on "rhel" that has a fallback on "linux" (same for the -x64 versions).

Since it works with rhel.6 but not centos-linux makes me believe there are some specific fixes for rhel.6 (that apply to centos6) so the question is mostly if a RID for rhel.6 can be supported (since that's with what we're building the deployment app anyway).

With the compiled libsodium.so on centos6 it does work correctly (seems we're fortunate to have a recent enough glibc).

I tried to reproduce the issue but couldn't get .NET Core 2.1 to install on CentOS 6.

@ektrah would it help if I created a POC code for encoding/decoding with a release target build as RHEL6 ?

Not really.

Could you please provide the output of ldd --version (which should provide the glibc version) and of dotnet --info both on your CentOS 6 and your RHEL 6 system?