Hide Forgot
Description of problem: rpm.addSign and rpm.delSign are not available in Fedora 24's rpm python modules (py2 or py3) due to an undefined symbol. The rpm module's __init__.py file attempts to import addSign and delSign from rpm._rpms [1], but is wrapped in a try/except to ignore import errors, which results in the methods just not being available. For reference, on EL7 those methods are successfully imported and are usable. Version-Release number of selected component (if applicable): rpm-4.13.0-0.rc1.27.fc24.x86_64 rpm-python-4.13.0-0.rc1.27.fc24.x86_64 rpm-python3-4.13.0-0.rc1.27.fc24.x86_64 How reproducible: This can be observed in both py2 and py3 by running the same import as the rpm modules's __init__.py file [1] outside of a try/except block. Actual results: # python2 -c 'from rpm._rpms import *' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: /usr/lib64/python2.7/site-packages/rpm/_rpms.so: undefined symbol: spec_Type # python3 -c 'from rpm._rpms import *' Traceback (most recent call last): File "<string>", line 1, in <module> ImportError: /usr/lib64/python3.5/site-packages/rpm/_rpms.cpython-35m-x86_64-linux-gnu.so: undefined symbol: spec_Type Expected results: # python2 -c 'from rpm._rpms import *' (successfully imported, no output) Additional info: [1]: https://github.com/rpm-software-management/rpm/blob/rpm-4.13.0-rc1/python/rpm/__init__.py#L55-L59
Confirm this bug on rawhide.
Yup, fixed upstream for some time, 4.13.1 material certainly: https://github.com/rpm-software-management/rpm/commit/eb632e5158fa4ef993b0e5df2a354f0be7a7a71d
That is odd, because that typo exists on EL7 as well, but everything works fine there. # yumdownloader --source rpm # rpm -i rpm-4.11.3-21.el7.src.rpm # cd rpmbuild/SOURCES # tar -xf rpm-4.11.3.tar.bz2 # grep -A6 rpm\._rpms rpm-4.11.3/python/setup.py.in rpmsign_mod = Extension('rpm._rpms', sources = ['rpmbmodule.c'], include_dirs = pkgconfig('--cflags'), libraries = pkgconfig('--libs') + ['rpmsign'], extra_compile_args = cflags, extra_link_args = additional_link_args ) # rpm -q rpm rpm-4.11.3-21.el7.x86_64 # python -c 'from rpm._rpms import *' #
(In reply to Panu Matilainen from comment #2) > Yup, fixed upstream for some time, 4.13.1 material certainly: > https://github.com/rpm-software-management/rpm/commit/ > eb632e5158fa4ef993b0e5df2a354f0be7a7a71d I think it's different thing.
In EL7 setup.py is not used for compiling the shipped python bindings. It *could* be something else too but I don't see what that would be.
Can https://github.com/rpm-software-management/rpm/commit/eb632e5158fa4ef993b0e5df2a354f0be7a7a71d be backported as a patch for Fedora 24 and/or 25?
I'm currently using rpm.addSign with Python 2 on EL7, but I would like to migrate to Python 3 on Fedora. This bug is preventing me from doing so. Can anyone comment on whether 4.13.1 is due to be released soon, or if that fix can be backported to Fedora 25?
This is broken in all current Fedora releases. Please backport that commit in order to fix it.
We get a similar error on Fedora Rawhide when we run pylint: Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/astroid/manager.py", line 129, in ast_from_module_name module = modutils.load_module_from_name(modname) File "/usr/lib/python3.6/site-packages/astroid/modutils.py", line 190, in load_module_from_name return load_module_from_modpath(dotted_name.split('.'), path, use_sys) File "/usr/lib/python3.6/site-packages/astroid/modutils.py", line 233, in load_module_from_modpath module = imp.load_module(curname, mp_file, mp_filename, mp_desc) File "/usr/lib64/python3.6/imp.py", line 242, in load_module return load_dynamic(name, filename, file) File "/usr/lib64/python3.6/imp.py", line 342, in load_dynamic return _load(spec) File "<frozen importlib._bootstrap>", line 675, in _load File "<frozen importlib._bootstrap>", line 648, in _load_unlocked File "<frozen importlib._bootstrap>", line 560, in module_from_spec File "<frozen importlib._bootstrap_external>", line 922, in create_module File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed ImportError: /usr/lib64/python3.6/site-packages/rpm/_rpms.cpython-36m-x86_64-linux-gnu.so: undefined symbol: spec_Type
I tested out adding https://github.com/rpm-software-management/rpm/commit/eb632e5158fa4ef993b0e5df2a354f0be7a7a71d as a patch in COPR https://copr.fedorainfracloud.org/coprs/carlgeorge/rpm-rhbz1393659/ for Fedora 25. It worked as expected. Please add the patch.
Created attachment 1281076 [details] Use correct source file for rpmsign module
This bug breaks anaconda tests for rawhide, so setting as a test blocker.
What on earth is anaconda doing with rpm's signing module?
Anyway... fixed in rpm-4.13.0.1-21.fc27
In our tests, we run pylint on anaconda and pylint fails to analyse code that imports rpm (see comment 9). Thank you!
This is broken in F26, F25, and F24 as well. Can it please be fixed in more than just Rawhide?
Hi, this bug now breaks anaconda tests on Fedora 26. Could you please fix it as well?
Opened new bug for Fedora 26: https://bugzilla.redhat.com/show_bug.cgi?id=1462671