Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 610780 - sys-cluster/ceph-10.2.5-r1: ImportError: /usr/lib64/python3.4/site-packages/rados.cpython-34m.so: undefined symbol: _Py_ZeroStruct
Summary: sys-cluster/ceph-10.2.5-r1: ImportError: /usr/lib64/python3.4/site-packages/r...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-02-24 08:52 UTC by Zac Medico
Modified: 2017-02-28 00:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix ceph-10.2.5-r1.ebuild to re-configure Makefile for each python implementation (ceph-10.2.5-r1.ebuild.patch,1.05 KB, patch)
2017-02-24 09:57 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2017-02-24 08:52:25 UTC
Importing the rados module fails as follows:

$ python3.4 -c 'import rados'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: /usr/lib64/python3.4/site-packages/rados.cpython-34m.so: undefined symbol: _Py_ZeroStruct

I was able to solve the problem by modifying the ebuild to allow a python3.4-only build (and patching man/conf.py for python3 compatibility).

The reason it fails with the current ceph-10.2.5-r1 ebuild is that src_configure generates a Makefile containing PYTHON_CFLAGS and PYTHON_LDFLAGS settings which are appropriate only for python2.7, causing rados.cpython-34m.so to be built with inappropriate CFLAGS and LDFLAGS.
Comment 1 Zac Medico gentoo-dev 2017-02-24 09:15:13 UTC
Meanwhile, ceph-11 and later has explicit support for python2 and python3 in the same build, where python3 is enabled by -DWITH_PYTHON3=ON:

https://github.com/ceph/ceph/commit/7d7a98484664bcb725fdb8691e75fd1c35493bc3
Comment 2 Zac Medico gentoo-dev 2017-02-24 09:57:37 UTC
Created attachment 464980 [details, diff]
fix ceph-10.2.5-r1.ebuild to re-configure Makefile for each python implementation

This patch works, but it can probably be improved somehow. It causes emake_python_bindings to call econf for each python implementation during src_install, which triggers this QA Notice:

 * QA Notice: econf called in src_install instead of src_configure
Comment 3 Patrick McLean gentoo-dev 2017-02-28 00:16:29 UTC
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3ed284557758a1d2e86ea8eea96a4ad4f49d514

Fixed upstream, unfortunately there is no good way to fix the QA notices aside from calling python_copy_sources and building all of ceph multiple times, but that is very CPU and disk space intensive for no good reason.