conda-forge / perl-feedstock

A conda-smithy repository for perl.
BSD 3-Clause "New" or "Revised" License
3 stars 32 forks source link

Incorrectly compiled against nsl #54

Closed dpryan79 closed 2 years ago

dpryan79 commented 2 years ago

I've run into this rather obscure issue just now when migrating the Bioconda perl packages to 5.32.1. It turns out that perl is linked to so nsl library in sysroot. If you run perl -V | grep libs you'll get:

libs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc

That's not really a problem, except it's not actually linking against nsl from what I can tell and there's no obvious way to get this library. That wouldn't be an issue, except some perl packages, like xml-libxml run the check_lib from the Devel::CheckLib package. That compiles a test C program and appends the value of "libs" to the ${CC} command. Since "-lnsl" can't be found, since nothing provides it, that fails. Is there a flag that could be passed to make it not link against nsl? Alternatively, does anyone know what library in sysroot is providing this?

dfornika commented 2 years ago

Sorry that I can't offer much help on this but just wanted to note that this seems to be causing a problem for us as we're migrating our SARS-CoV-2 pipeline, (based on the popular connor-lab/ncov2019-artic-nf) to a new analysis cluster that doesn't have libnsl installed on the base system.

I'm seeing that libnsl-2.0.0 from conda-forge is being included in to the environment, but our trim_galore analysis is failing with the error message:

perl: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory

It isn't a trim_galore specific error, we get the same message when just running perl in that environment.

I noticed that there is a libnsl shared library in the environment under lib, but it is libnsl.so.3, not libnsl.so.1:

lrwxrwxrwx  1 dfornika dfornika   15 Feb 16 15:03 libnsl.so -> libnsl.so.3.0.0
lrwxrwxrwx  1 dfornika dfornika   15 Feb 16 15:03 libnsl.so.3 -> libnsl.so.3.0.0
-rwxrwxr-x  5 dfornika dfornika  31K Sep 30 15:14 libnsl.so.3.0.0

I've created another symlink:

lrwxrwxrwx  1 dfornika dfornika   15 Feb 16 15:03 libnsl.so -> libnsl.so.3.0.0
lrwxrwxrwx  1 dfornika dfornika   15 Feb 16 15:28 libnsl.so.1 -> libnsl.so.3.0.0
lrwxrwxrwx  1 dfornika dfornika   15 Feb 16 15:03 libnsl.so.3 -> libnsl.so.3.0.0
-rwxrwxr-x  5 dfornika dfornika  31K Sep 30 15:14 libnsl.so.3.0.0

...and that seems to at least sidestep the problem for us.

Our perl in the environment is perl-5.22.0.1-0 from conda-forge.

isuruf commented 2 years ago

You can rebuild this package with libnsl added to host and this error should go away.

isuruf commented 2 years ago

PRs welcome