-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo install
uses my project's .cargo/config
target triple and it shouldn't?
#5441
Comments
Hi, I will work on this bug. I have explored the relevant code a bit. https://github.com/rust-lang/cargo/blob/master/src/bin/cargo/commands/install.rs#L75 Setting the BuildConfig.target to host triplet fixes the bug if I understand it correctly.
How should I add test for this bug? |
`cargo install` will ignore the target triple specified in a project directory Fixes #5441
Is it really solved ? # in .cargo/config.toml
[build]
target = "wasm32-unknown-unknown" And when I use |
TL;DR: I spent multiple hours trying to figure out why I couldn't
cargo install
some tools. It turned out that the reason I couldn't was because, unbeknownst to me,cargo install
was trying to build the tools for the wrong target due to.cargo/config
in my project directory!Full explanation
.cargo/config
file to build for a wasm target triple since my project is wasm only:I ran
cargo install cargo-web
from my project's working directory. It failed due to a bunch of obscure errors about dependencies being unable to compile. This made me think the dependencies had been really broken, which gave me a really sour taste in my mouth for Rust.After cloning the dependencies and trying to fix them, I finally realized:
cargo install cargo-web
is for some reason building forwasm32-unknown-emscripten
on my system! 😢As it turned out,
cargo install
is respecting my project's.cargo/config
target triple.What I expected
I think that
cargo install
should ignore the target triple specified in a project directory.I imagine that at some point or another, most users developing projects primarily targeting wasm/asmjs will run into this issue, and it is incredibly annoying to debug.
I'm using:
The text was updated successfully, but these errors were encountered: