You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem
While learning Rust, I created a simple CLI just to learn some core concepts. To build it, I run cargo build --release, and all goes well: code compiles and a binary is generated.
However, when trying to install it using cargo install --path . --locked, just after building it, Cargo triggers a new build, totally ignoring the build process that just occurred.
This is caused by cargo install using a different set of features than a normal cargo build. cargo install ignores dev-dependencies, so those don't influence the feature resolution.
This is caused by cargo install using a different set of features than a normal cargo build. cargo install ignores dev-dependencies, so those don't influence the feature resolution.
Should it be because of dev-dependencies, wouldn't this behavior also happen for projects like hyperfine (cited in my forum post, only compiles once with those same steps).
Hyperfine doesn't appear to have any dev-dependencies that add features to any shared dependencies, so the feature set ends up being the same with or without the dev-dependencies.
I'm going to close this as working as intended, though I understand that it can be surprising or confusing. Issue #2904 is tracking adding something that would help explain why this is happening.
Problem
While learning Rust, I created a simple CLI just to learn some core concepts. To build it, I run
cargo build --release
, and all goes well: code compiles and a binary is generated.However, when trying to install it using
cargo install --path . --locked
, just after building it, Cargo triggers a new build, totally ignoring the build process that just occurred.Steps
cargo build --release
cargo install --path . --locked
Possible Solution(s)
N/A
Notes
I posted this issue on the forums and was advised to open this issue here.
Output of
cargo version
:cargo 1.50.0 (f04e7fab7 2021-02-04)
The text was updated successfully, but these errors were encountered: