Bug 1312590 - building python-qpid-proton fails under rh-python34
Summary: building python-qpid-proton fails under rh-python34
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Software Collections
Classification: Red Hat
Component: rh-python34
Version: unspecified
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: alpha
: 2.2
Assignee: Robert Kuska
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
: 1312586 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-27 17:02 UTC by Matthew Farrellee
Modified: 2016-04-18 10:17 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-02 14:46:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Apache JIRA PROTON-1150 0 None None None 2016-03-02 13:56:07 UTC

Description Matthew Farrellee 2016-02-27 17:02:25 UTC
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 16:08:43 UTC
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 16:20:35 UTC
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 16:22:34 UTC
Possible workaround for you could be `sudo ldconfig /opt/rh/rh-python34/root/usr/lib64/ -v`.

Comment 4 Robert Kuska 2016-03-02 09:36:30 UTC
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 14:37:39 UTC
*** Bug 1312586 has been marked as a duplicate of this bug. ***

Comment 7 Ken Giusti 2016-03-02 14:41:26 UTC
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 14:46:38 UTC
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 17:34:22 UTC
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 09:26:19 UTC
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.