Support for Alpine Linux
FROM python:3.12.4-alpine3.20 RUN python3.12 -m pip install --upgrade pip && python3.12 -m pip install rocksdict
Successfully installed pip-24.1.2
Same error here - ERROR: No matching distribution found for rocksdict or - Could not find a version that satisfies the requirement rocksdict (from versions: none)
Connected issue: https://github.com/Congyuwang/RocksDict/discussions/86
compiled on x86
How to solve it?
Perfectly works only on Debian image
Okay. I did some research. Alpine linux does not use glibc but uses musl libc. Currently all our wheels use glibc.
Quote google AI:
The problem: Alpine Linux uses the musl C library, while most Linux distributions (and the manylinux wheels on PyPI) use glibc. This means that standard wheels often don't work on Alpine. The solution: PEP 656 introduced the musllinux wheel tag, specifically for musl-based systems like Alpine. The cibuildwheel project can build musllinux wheels for your projects. PyPI now hosts musllinux wheels for many popular packages, including NumPy and SciPy.
Currently we are using manylinux image to build wheels, that's why no wheel works for alpine for now.
https://github.com/rocksdict/RocksDict/pull/155
Can't build musl wheels for the moment due to dynamic linking of clang-sys.
thread 'main' panicked at /root/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bindgen-0.69.5/lib.rs:622:31:
Unable to find libclang: "the `libclang` shared library at /usr/local/lib/libclang.so.19.1.3 could not be opened: Dynamic loading not supported"
LLVM needs to be built as static lib, first of all. Then, bindgen of rust-rocksdb should use static feature instead of runtime. But that's just some guessing.
Related issues:
https://github.com/rust-lang/rust-bindgen/issues/2360 https://github.com/KyleMayes/clang-sys/issues/189 https://github.com/tikv/grpc-rs/issues/477 https://github.com/njaremko/samael/issues/37 https://github.com/apache/skywalking/issues/10439 https://gitlab.alpinelinux.org/alpine/aports/-/issues/12226
@1Const1 Pull requests are welcome.
https://github.com/rust-rocksdb/rust-rocksdb/pull/939
Completed via #155