-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Linker error when installing wasm-bindgen-cli
in container rust:1.72.0-alpine
#115450
Comments
I'm getting the same error, works on 1.71 but not 1.72. But for me when I install |
I have a feeling this could be related to #115430 (i.e. a regression in cross compiling to musl) |
Are you using |
Yes, that solves it for me, thanks! |
I had a similar problem with the following Dockerfile: FROM rust:alpine
RUN apk update
RUN apk upgrade
RUN apk add --no-cache pkgconf openssl-dev musl-dev cmake make gcc g++ nodejs perl clang16 curl strace
RUN rustup default nightly-2023-09-06
RUN cargo install wasm-bindgen-cli My solution was to add the following line after the ENV OPENSSL_DIR=/usr |
This is most likely due to #111698: previously rustc would link to dynamic libraries while trying to build a static binary, which led to all sorts of problems, including crashes. Now we properly only link to static libraries when building a static binary, which is the default for the musl target. To build a dynamic binary which can link to dynamic libraries, you need to use |
RUSTFLAGSを付けることでコンパイルエラーを回避 以下のissueが情報源rust-lang/rust#115450
Code
I tried this code:
docker run --rm -it rust:1.72.0-alpine /bin/sh -c 'apk add pkgconfig musl-dev openssl-dev && cargo install wasm-bindgen-cli'
I expected to see this happen: Installation succeeds.
Instead, this happened: Installation fails with the output
Version it worked on
It most recently worked on:
rust:1.71.1-alpine
Version with regression
rust:1.72.0-alpine
Additional Context
Despite the linker output, one can check that the container does contain the
libssl
andlibcrypto
libraries which are installed byapk
in the command provided.The problem does not arise with Debian-based Rust containers.
This bug is reproducable on both
amd64
andarm64
architecture.The text was updated successfully, but these errors were encountered: