-
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
Linking error on Rust 1.72.0 x86_64-unknown-linux-musl toolchain #115430
Comments
@ogarcia can you try reducing the number of dependencies towards an easier way to reproduce? Probably the issue is with the crate directly trying to use @rustbot label +E-needs-mcve +E-needs-bisection |
Nothing special. Only As for the reduction of dependencies, it is implosible in this project because it is already at a minimum. However I have found that with the sqlite example 1 that has the Diesel library exactly the same error happens, maybe it is better because it is much simpler and has almost no dependencies. To reproduce it I simply downloaded the contents of that directory ( [package]
name = "diesel_demo_step_1_sqlite"
version = "0.1.0"
license = "MIT OR Apache-2.0"
authors = ["Taryn Hill <taryn@phrohdoh.com>"]
edition = "2018"
publish = false
[dependencies]
diesel = { version = "2.1.0", features = ["sqlite"] }
dotenvy = "0.15"
[[bin]]
name = "show_posts"
doc = false
[lib]
doc = false |
@ogarcia unsure if related to your issue, but are you also compiling with |
@apiraino sorry for the delay, I was on holidays. The bug is still present in version 1.72.1. Using |
I have uploaded a minimal example to https://github.com/flash-freezing-lava/rust-link-alpine-error that gives the same error on |
Experiencing a similar linker error here, except with libbz2 (ld: can't find -lbz2) when trying to build maturin 0.11.5 on Alpine Linux 3.18 x86_64. The bundled rust 1.71.1 works fine. |
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 |
@ogarcia So the issue can be closed, you think? |
sure, I'll close it. thanks for reporting it! @rustbot label -I-prioritize -E-needs-mcve -E-needs-bisection |
I have a project that currently compiles and links with Rust 1.71.0 and earlier but gives a linking error in version 1.72.0 with x86_64-unknown-linux-musl toolchain.
The failure occurs both when creating the debug version and the release version, in both versions it is not able to locate the sqlite3 library.
This error does not occur with the toolchain x86_64-unknown-linux-gnu.
The text was updated successfully, but these errors were encountered: