If find_library('erasurecode') in setup.py does not return a library version, try to append it

Bug #1780320 reported by Ehud Kaldor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PyECLib
Fix Released
Undecided
Unassigned

Bug Description

I am working with Alpine Linux, and their port of python returns the library name, with no version:

~/pyeclib # python
Python 2.7.14 (default, Dec 14 2017, 15:51:29)
[GCC 6.4.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes.util import find_library
>>> find_library('erasurecode')
'liberasurecode.so'
>>> find_library('c')
'libc.so'
>>>

I've opened a bug to Alpine as well (https://bugs.alpinelinux.org/issues/9058), but until that is fixed, it's probably easy to check if the library name contains the version, and append it if not.

Revision history for this message
clayg (clay-gerrard) wrote :

That's weird, but I'm not sure this is a valid bug or not?

What do the library installation look like on this system?

vagrant@saio:~$ ls -alhF /usr/local/lib/ | grep erasurecode
-rw-r--r-- 1 root root 539K Aug 8 16:55 liberasurecode.a
-rwxr-xr-x 1 root root 1.1K Aug 8 16:55 liberasurecode.la*
-rw-r--r-- 1 root root 67K Aug 8 16:55 liberasurecode_rs_vand.a
-rwxr-xr-x 1 root root 1.1K Aug 8 16:55 liberasurecode_rs_vand.la*
lrwxrwxrwx 1 root root 31 Aug 8 16:55 liberasurecode_rs_vand.so -> liberasurecode_rs_vand.so.1.0.1*
lrwxrwxrwx 1 root root 31 Aug 8 16:55 liberasurecode_rs_vand.so.1 -> liberasurecode_rs_vand.so.1.0.1*
-rwxr-xr-x 1 root root 47K Aug 8 16:55 liberasurecode_rs_vand.so.1.0.1*
lrwxrwxrwx 1 root root 23 Aug 8 16:55 liberasurecode.so -> liberasurecode.so.1.5.0*
lrwxrwxrwx 1 root root 23 Aug 8 16:55 liberasurecode.so.1 -> liberasurecode.so.1.5.0*
-rwxr-xr-x 1 root root 268K Aug 8 16:55 liberasurecode.so.1.5.0*

Revision history for this message
Kota Tsuyuzaki (tsuyuzaki-kota) wrote :

It looks like what the bug report says can happen actually.

I tested the situation with a docker file (https://gist.github.com/bloodeagle40234/03d8d91f09b24786aa00fa8558cad597#file-dockerfile) then, liberasurecode was installed to

liberasurecode.so
liberasurecode.so.1
liberasurecode.so.1.5.0

under /usr/local/lib dir but the python doesn't report the version number and it causes installation failure with python-pip (See [1] in detail)

1: https://gist.github.com/bloodeagle40234/03d8d91f09b24786aa00fa8558cad597#file-result-L34-L64

Revision history for this message
Thiago da Silva (thiagodasilva) wrote :

Here's a slightly modifed Dockerfile used to test patch https://review.openstack.org/#/c/636748/3 to fix this bug:
https://gist.github.com/thiagodasilva/523261f13740b7616186168bec1e0b25

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to pyeclib (master)

Reviewed: https://review.openstack.org/636748
Committed: https://git.openstack.org/cgit/openstack/pyeclib/commit/?id=931c4e4559afeeaf1ea5867b1d44132626f2b575
Submitter: Zuul
Branch: master

commit 931c4e4559afeeaf1ea5867b1d44132626f2b575
Author: Tim Burke <email address hidden>
Date: Wed Feb 13 11:56:24 2019 -0800

    Use liberasurecode_get_version()

    ... to determine whether we have a supported version. If not
    available, fall back to file name parsing to check the version,
    keeping in mind that we haven't yet released a v2.

    Change-Id: I5f81ddd6df1970bef3a2614126bce0eb78f44473
    Closes-Bug: 1780320

Changed in pyeclib:
status: New → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on pyeclib (master)

Change abandoned by Tim Burke (<email address hidden>) on branch: master
Review: https://review.openstack.org/580754
Reason: Resolved by https://review.openstack.org/#/c/636748/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Change abandoned by Tim Burke (<email address hidden>) on branch: master
Review: https://review.openstack.org/580753
Reason: Resolved by https://review.openstack.org/#/c/636748/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.