Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release static binaries #2656

Closed
timvisee opened this issue Sep 13, 2023 · 2 comments
Closed

Release static binaries #2656

timvisee opened this issue Sep 13, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@timvisee
Copy link
Member

Is your feature request related to a problem? Please describe.
With each release we provide a set of prebuilt binaries. For example: https://github.com/qdrant/qdrant/releases/tag/v1.5.1

These binaries are dynamically linked. This is problematic, especially on Linux systems, because different distributions and systems have wildly different dependency versions.

Describe the solution you'd like
We should probably release static binaries, at least for Linux. This would remove specific runtime glibc requirements.

Describe alternatives you've considered
Maybe we can pin a specific glibc version (and other dynamic libraries) that is most compatible with most systems and keep dynamic linking. But this is still a lot more fragile than delivering static binaries.

Additional context
I figured the easiest way to build statically is to build on musl. Sadly, some of our dependencies are incompatible with this.

For example, jemalloc must be removed in musl builds. We should probably do this with compile time conditionals.

I've done some local experimenting in an Alpine Docker image which uses musl. After removing jemalloc code, the following still fails to build with librocksdb-sys due to dynamic linking:

docker run --rm -it rust:alpine3.17

apk update && apk upgrade
apk add git musl-dev protoc clang15-dev protobuf-dev

git clone https://github.com/qdrant/qdrant && cd qdrant

export LIBCLANG_PATH=/usr/lib/libclang-*.so.*

cargo build
@timvisee timvisee added the enhancement New feature or request label Sep 13, 2023
@AbrahamLopez10
Copy link

Hi! Now that MUSL binary builds are implemented in the dev branch after the PR #3334 was merged, are static binaries something that can now be made available? Thanks!

@timvisee
Copy link
Member Author

Hi! Now that MUSL binary builds are implemented in the dev branch after the PR #3334 was merged, are static binaries something that can now be made available? Thanks!

Yes!

In fact, things are already set up to do this automatically based on this here: https://github.com/qdrant/qdrant/pull/3342/files

You'd be right saying that we don't have MUSL binaries for 1.7.4 yet. That is because it was a small patch release. Our next minor release should have them though.

Closing this now, as I believe it is properly implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants