-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Building with xmlsec fails on alpine when linking statically #37
Comments
I've seen that one, but not sure how it is related because that issue was fixed in bindgen 0.64 and |
You're compiling on alpine, which doesn't support dynamic loading. You have to build with bindgen set to statically link, as described in that ticket. It's not a bug, and it wasn't fixed in 0.64 |
Sorry for the misunderstanding and thanks for the explanation! I guess I just didn't fully understand that statically linking the musl libc implies not being able to load other dynamic libraries anymore. Linking dynamically worksI got things working by linking that dynamically with: FROM rust:alpine
# Disable static linking to enable loading xmlsec
ENV RUSTFLAGS -Ctarget-feature=-crt-static
RUN apk add --no-cache libc-dev openssl-dev xmlsec-dev clang-dev
COPY . .
RUN cargo install --path .
CMD ["saml-test"] Linking statically still doesn'tI tried to get static linking working by depending on Even after adding
I think that is because the |
When building on alpine and enabling the
xmlsec
feature, the build fails withUnable to find libclang: "the
libclangshared library at /usr/lib/llvm16/lib/libclang.so.16.0.6 could not be opened: Dynamic loading not supported"
.I don't think this is
bindgen
's fault necessarily, because I've been using bindgen successfully onalpine
many times and I've never seen this error, but I also don't understand enough to understand what's actually going on there.How to reproduce
Output
Full output: https://gist.github.com/FSMaxB/363e540739494c4cde6354370a2be8f3
The text was updated successfully, but these errors were encountered: