Bug 1312590 - building python-qpid-proton fails under rh-python34
building python-qpid-proton fails under rh-python34
Status: CLOSED UPSTREAM
Product: Red Hat Software Collections
Classification: Red Hat
Component: rh-python34 (Show other bugs)
unspecified
Unspecified Unspecified
unspecified Severity unspecified
: alpha
: 2.2
Assigned To: Robert Kuska
BaseOS QE - Apps
:
: 1312586 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-27 12:02 EST by Matthew Farrellee
Modified: 2016-04-18 06:17 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-02 09:46:38 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Apache JIRA PROTON-1150 None None None 2016-03-02 08:56 EST

  None (edit)
Description Matthew Farrellee 2016-02-27 12:02:25 EST
Description of problem:

python-qpid-proton build invokes python during its build to generate C header encodings.h. the invocation of python fails resulting in missing types later in the build.


Version-Release number of selected component (if applicable):

EL7, rh-python34


How reproducible:

100%


Steps to Reproduce:
0. (following https://www.softwarecollections.org/en/scls/rhscl/rh-python34/)
1. yum install scl-utils
2. yum install https://www.softwarecollections.org/en/scls/rhscl/rh-python34/epel-7-x86_64/download/rhscl-rh-python34-epel-7-x86_64.noarch.rpm
3. yum install rh-python34
4. scl enable rh-python34 -- pip install python-qpid-proton


Actual results:

python-qpid-proton build failures after python invocation fails with

 Bundling qpid-proton into the extension
 fetching http://www.apache.org/dist/qpid/proton/0.12.0/qpid-proton-0.12.0.tar.gz into build/bundled
 /opt/rh/rh-python34/root/usr/bin/python3: error while loading shared libraries: libpython3.4m.so.rh-python34-1.0: cannot open shared object file: No such file or directory
 /opt/rh/rh-python34/root/usr/bin/python3: error while loading shared libraries: libpython3.4m.so.rh-python34-1.0: cannot open shared object file: No such file or directory
 ...
 /tmp/pip-build-pazpj1by/python-qpid-proton/build/bundled/qpid-proton/proton-c/src/codec/decoder.c: In function 'pn_code2type':
 /tmp/pip-build-pazpj1by/python-qpid-proton/build/bundled/qpid-proton/proton-c/src/codec/decoder.c:122:8: error: 'PNE_DESCRIPTOR' undeclared (first use in this function)
    case PNE_DESCRIPTOR:
         ^
 ...



Expected results:

python-qpid-proton installed under rh-python34


Additional info:

this also fails under python33
Comment 1 Robert Kuska 2016-03-01 11:08:43 EST
I've checked prelinked libraries of python binary:
[root@deimos /]# ldd /opt/rh/rh-python34/root/usr/bin/python
	linux-vdso.so.1 =>  (0x00007ffc16872000)
	libpython3.4m.so.rh-python34-1.0 => /opt/rh/rh-python34/root/usr/lib64/libpython3.4m.so.rh-python34-1.0 (0x00007fddeb0e8000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fddeaec5000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007fddeacc1000)
	libutil.so.1 => /lib64/libutil.so.1 (0x00007fddeaabe000)
	libm.so.6 => /lib64/libm.so.6 (0x00007fddea7bb000)
	libc.so.6 => /lib64/libc.so.6 (0x00007fddea3fa000)
	/lib64/ld-linux-x86-64.so.2 (0x0000563bd0b4c000)

Also checked user rights and if the library mentioned above exists:
[root@deimos /]# ls -l /opt/rh/rh-python34/root/usr/lib64/libpython3.4m.so.rh-python34-1.0
-rwxr-xr-x. 1 root root 2594992 Mar 25  2015 /opt/rh/rh-python34/root/usr/lib64/libpython3.4m.so.rh-python34-1.0

LD_LIBRARY_PATH seems to be also correct:
[root@deimos /]# echo $LD_LIBRARY_PATH
/opt/rh/rh-python34/root/usr/lib64
Comment 2 Robert Kuska 2016-03-01 11:20:35 EST
Diggin into this deeper this seems to be python-qpid-proton issue as it does modify environment variables.

See its setup.py@183
            subprocess.Popen([sys.executable, os.path.join(proton_src, 'protocol.h.py')],
                              env={'PYTHONPATH': proton_base}, stdout=header)

env override our LD_LIBRARY_PATH variable, see:

>>> subprocess.Popen('/usr/bin/echo $LD_LIBRARY_PATH', shell=True, env={'PYTHONPATH': '.'}, stdout=subprocess.PIPE).stdout.read()
b'\n'
>>> subprocess.Popen('/usr/bin/echo $LD_LIBRARY_PATH', shell=True, stdout=subprocess.PIPE).stdout.read()
b'/opt/rh/rh-python34/root/usr/lib64\n'


Correct way for qpid proton to handle env variables is to pass os.environ.copy() with modified 'PYTHONPATH' (according their needs).

I will submit PR to upstream.
Comment 3 Robert Kuska 2016-03-01 11:22:34 EST
Possible workaround for you could be `sudo ldconfig /opt/rh/rh-python34/root/usr/lib64/ -v`.
Comment 4 Robert Kuska 2016-03-02 04:36:30 EST
I've submited a PR to upstream.

https://github.com/apache/qpid-proton/pull/69


I will close this issue as NOTABUG if you don't mind.
Comment 6 Robert Kuska 2016-03-02 09:37:39 EST
*** Bug 1312586 has been marked as a duplicate of this bug. ***
Comment 7 Ken Giusti 2016-03-02 09:41:26 EST
FYI:  I've pushed Robert's fix upstream.  Thanks Robert for your help with this.


https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;a=commit;h=b9cd200c532e968bc349145b957c586684b08f02

-K
Comment 8 Robert Kuska 2016-03-02 09:46:38 EST
No problem, glad to help :) I am closing this as it is fixed in upstream and there's nothing more to do.
Comment 9 Matthew Farrellee 2016-03-05 12:34:22 EST
closing this is fine, but please link the mrg qpid-proton bz to track this fix getting into product
Comment 10 Robert Kuska 2016-03-07 04:26:19 EST
It's already merged and should be part of v0.13.0 according to Jira[0].

[0]https://issues.apache.org/jira/browse/PROTON-1150

Note You need to log in before you can comment on or make changes to this bug.