Closed imphil closed 2 years ago
Looking at the code I guess we could either attach the soname to the suffix and see if that file exists (I don't think anything other than "1.0" exists), or use the config var INSTSONAME. I wonder why that wasn't used before? @ktbarrett you have the best overview on the options you tried and the mess surrounding it, so maybe you could have a look?
As data point, here's what I get on RHEL8, which in both cases is exactly the right library.
python3.8 -c 'from distutils.sysconfig import get_config_var; print("%s/%s" % (get_config_var("LIBDIR"), get_config_var("INSTSONAME")))'
/usr/lib64/libpython3.8.so.1.0
python3.6 -c 'from distutils.sysconfig import get_config_var; print("%s/%s" % (get_config_var("LIBDIR"), get_config_var("INSTSONAME")))'
/usr/lib64/libpython3.6m.so.1.0
Looks like something may have changed recently? https://github.com/ktbarrett/find_libpython/actions was passing RHEL8, then started failing. And the action stopped working for some reason...
Seems like a good way to reliably find the library on some systems, not sure why it wasn't used in the original code. Could you open a PR to add it somewhere?
Looks like something may have changed recently? ktbarrett/find_libpython/actions was passing RHEL8, then started failing. And the action stopped working for some reason...
The action only tested the system Python (3.6), not the additional Python versions available on RHEL7 and 8 throgh SCLs (https://github.com/ktbarrett/find_libpython/blob/master/.github/workflows/tests.yml#L118). Python 3.6 as shipped with RHEL8 has the symlinks from .so.1.0 -> .so in place, only the AppStream versions don't.
find_libpython does not find libpython currently if only a shared object with a SONAME exists, i.e. only "libpython3.8.so.1.0", but no "libpython3.8.so". That's the case in RHEL8 with the Red Hat python38 package installed, so a rather common scenario.
Here's how it looks on my RHEL8 machine:
See also https://github.com/cocotb/cocotb/issues/3097