Problem description
Importing cachebox v5.2.0 inside an Alpine (musl) container raises an error:
ImportError: Error relocating /venv/lib/python3.12/site-packages/cachebox/_core.cpython-312-x86_64-linux-musl.so: (null): initial-exec TLS resolves to dynamic definition in /venv/lib/python3.12/site-packages/cachebox/_core.cpython-312-x86_64-linux-musl.so
Some initial workarounds I already tested
- Same application loads fine on Debian-based container base image.
- Reverting to an earlier version (e.g.,
v5.1.0) of cachebox avoids the error on Alpine.
Environment
- Base image:
python:3.12-alpine (musl libc)
- Python: 3.12
- cachebox: 5.2.0 (wheel from PyPI)
- Package with the
cachebox dependency: openfeature-provider-flagd v0.2.6
Details
From the cachebox v.5.2.0 release changelog we can see:
Starting now, cachebox uses mimalloc as the default allocator for some targets ( thanks to @chirizxc, #37)
Mimalloc’s TLS model (initial-exec) is known to break with musl when the library is dlopened; upstream recommends rebuilding with -DMI_LOCAL_DYNAMIC_TLS=ON or switching to the local-dynamic model.
Summary
The published cachebox v5.2.0 wheel seems to fail consistently on the Alpine-based image.
Would it be possible to disable the mimalloc feature for musllinux wheels or adjust the mimalloc build flags so the extension can load on musl?
References
Problem description
Importing
cachebox v5.2.0inside an Alpine (musl) container raises an error:ImportError: Error relocating /venv/lib/python3.12/site-packages/cachebox/_core.cpython-312-x86_64-linux-musl.so: (null): initial-exec TLS resolves to dynamic definition in /venv/lib/python3.12/site-packages/cachebox/_core.cpython-312-x86_64-linux-musl.soSome initial workarounds I already tested
v5.1.0) ofcacheboxavoids the error on Alpine.Environment
python:3.12-alpine(musl libc)cacheboxdependency:openfeature-provider-flagd v0.2.6Details
From the cachebox v.5.2.0 release changelog we can see:
Mimalloc’s TLS model (initial-exec) is known to break with
muslwhen the library is dlopened; upstream recommends rebuilding with -DMI_LOCAL_DYNAMIC_TLS=ON or switching to the local-dynamic model.Summary
The published
cachebox v5.2.0wheel seems to fail consistently on the Alpine-based image.Would it be possible to disable the
mimallocfeature for musllinux wheels or adjust themimallocbuild flags so the extension can load on musl?References