-
Notifications
You must be signed in to change notification settings - Fork 8
Description
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) ofcacheboxavoids 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
cacheboxdependency: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?