[Rpm-maint] [rpm-software-management/rpm] RFE: elfdeps: Filter Python subdirectories (#1227)

Miro Hrončok notifications at github.com
Sun May 17 09:30:40 UTC 2020


I'd like the [elfdeps](https://github.com/rpm-software-management/rpm/blob/master/tools/elfdeps.c) to filter out certain directories, namely anything in `/usr/lib(64)?/pythonX.Y/`.

Context:

 - historically, all Python extension modules needed to use `%filter_provides_in %{python_sitearch}/.*\.so$` to avoid getting useless provides
 - later, this practice shifted to `%global __provides_exclude_from ^(%{python_sitearch}/.*\\.so)$`
 - later (73bd9636d0e76a4d255776b7733667198b9ef585), Python extension modules that don't start with `lib...` are no longer needed to be filtered out, hence this practice slowly dies

But we cannot get rid of this historical cruft totally, because some packages have Python extension modules named "lib...":

```
/usr/lib64/python3.8/site-packages/libexiv2python.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libhivexmod.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libxtwrapper.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libiscsi.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libxml2mod.so
/usr/lib64/python3.8/site-packages/liblo.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libPyROOT.cpython-38-x86_64-linux-gnu.so
/usr/lib64/python3.8/site-packages/libtorrent.cpython-38-x86_64-linux-gnu.so
```

An in turn they either need to filter the provides (which most current Python packagers don't know, unless they have some historical background of 7+ years), or they have bogus provides:

```
libexiv2python.cpython-38-x86_64-linux-gnu.so()(64bit)
libhivexmod.cpython-38-x86_64-linux-gnu.so()(64bit)
libxtwrapper.cpython-38-x86_64-linux-gnu.so()(64bit)
libiscsi.cpython-38-x86_64-linux-gnu.so()(64bit)
libxml2mod.so()(64bit)
liblo.cpython-38-x86_64-linux-gnu.so()(64bit)
libPyROOT.so.6.20()(64bit)
libtorrent.cpython-38-x86_64-linux-gnu.so()(64bit)
```

I'd like that no such provides are generated. Easiest way forward is to simply ignore the directories. I am fine with working on a pull request for this, but I'd like to discuss first on what level we should have the directories defined. Would it work if the tool had an `--exclude` argument that would take a path regex to exclude and we would define that to `^%{_prefix}/lib(64)?/python\d+\.\d+/` in `elf.attr`?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/issues/1227
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20200517/729631e4/attachment.html>


More information about the Rpm-maint mailing list