Bug 2231686 - python-tables is not importable when blosc2-devel is not installed
Summary: python-tables is not importable when blosc2-devel is not installed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-tables
Version: 39
Hardware: Unspecified
OS: Linux
unspecified
urgent
Target Milestone: ---
Assignee: Zbigniew Jędrzejewski-Szmek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 2186901
TreeView+ depends on / blocked
 
Reported: 2023-08-13 09:06 UTC by Elliott Sales de Andrade
Modified: 2023-08-16 16:42 UTC (History)
5 users (show)

Fixed In Version: python-tables-3.8.0-6.fc40 python-tables-3.8.0-6.fc39
Clone Of:
Environment:
Last Closed: 2023-08-16 16:39:48 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Elliott Sales de Andrade 2023-08-13 09:06:32 UTC
On Rawhide and (now-branched) F39, python-tables cannot be imported due to missing libblosc2.so.

Reproducible: Always

Steps to Reproduce:
1. mock -r fedora-rawhide-x86_64 --install python3-tables
2. mock -r fedora-rawhide-x86_64 --shell
3. python3 -c 'import tables'
Actual Results:  
Traceback (most recent call last):
  File "/usr/lib64/python3.12/site-packages/tables/__init__.py", line 26, in <module>
    cdll.LoadLibrary(blosc2_lib)
  File "/usr/lib64/python3.12/ctypes/__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/ctypes/__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: libblosc2.so: cannot open shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python3.12/site-packages/tables/__init__.py", line 28, in <module>
    cdll.LoadLibrary(os.path.join(current_dir, blosc2_lib))
  File "/usr/lib64/python3.12/ctypes/__init__.py", line 460, in LoadLibrary
    return self._dlltype(name)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/ctypes/__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: /usr/lib64/python3.12/site-packages/tables/libblosc2.so: cannot open shared object file: No such file or directory


Expected Results:  
Command completes without error.

Comment 1 Ben Beasley 2023-08-13 14:34:08 UTC
Because python-tables uses the blosc2 C library via ctypes/dlopen(), no automatic dependency can be generated. I don’t have time to make a PR right now, but it looks like simply adding a manual dependency will be the way to go.

Comment 2 Elliott Sales de Andrade 2023-08-13 20:41:44 UTC
blosc2 is already required:

```
$ rpm -q --requires python3-tables | grep blosc
libblosc.so.1()(64bit)
libblosc2.so.2()(64bit)
python3.12dist(blosc2) >= 2
```

But it's trying to load a soversion-less name, and failing since there's no dependency on the devel library (which there shouldn't be.)

Since the Python extensions are already linked with blosc and blosc2, I'm not sure that this package really needs the manual loading of the blosc2 library at all.

Comment 3 Ben Beasley 2023-08-13 21:49:58 UTC
Hmm, you’re right. It needs closer investigation, but it looks like the check for libblosc2.so in __init__.py may be unnecessary and harmful in the RPM package. It may be best to patch the initial “blosc2_found = False” to “blosc2_found = True”.

Comment 4 Ben Beasley 2023-08-14 12:18:46 UTC
While the blosc2 library search check is still useless in the RPM package, upstream has made it workable in an unreleased commit: https://github.com/PyTables/PyTables/commit/bbb02dd0b2f137ab52b447fe5be304805c2dc7ea

The following PR backports that commit as a patch: https://src.fedoraproject.org/rpms/python-tables/pull-request/5

However, there are two unrelated errors that prevent this from building. These appear in Rawhide too (https://koschei.fedoraproject.org/package/python-tables), and appear to be due to the upgrade of python-numexpr from 2.8.4. to 2.8.5.

Comment 5 Fedora Release Engineering 2023-08-16 08:07:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 39 development cycle.
Changing version to 39.

Comment 6 Fedora Update System 2023-08-16 16:37:15 UTC
FEDORA-2023-18dd57e0e3 has been submitted as an update to Fedora 40. https://bodhi.fedoraproject.org/updates/FEDORA-2023-18dd57e0e3

Comment 7 Fedora Update System 2023-08-16 16:39:48 UTC
FEDORA-2023-18dd57e0e3 has been pushed to the Fedora 40 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 8 Fedora Update System 2023-08-16 16:40:44 UTC
FEDORA-2023-03e0a07474 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-03e0a07474

Comment 9 Fedora Update System 2023-08-16 16:42:47 UTC
FEDORA-2023-03e0a07474 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


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