-
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 exits with success code on partial failures #9180
Comments
Hm, I just ran
The important part is at the end |
thanks for looking at this. fish on OSX (it uses
I also combined the command with "echo yes" and I see the echoed message:
we can ignore fish if that's not common enough.
and I also tried
and finally
Running I'm running out of ideas, everything I try seems to indicate the command is exiting with status code 0? |
tried deleting
|
in case this is relevant, I see you're getting a We both see the |
last attempt using an official docker image, in case the problem is with my setup.
|
My apologies, I see what is wrong. If the destination is in PATH, it is exiting prematurely. This line needs to change. |
thanks! let's see if this PR helps. |
Do not exit prematurely if anything failed installing. #9180
Do not exit prematurely if anything failed installing. rust-lang#9180
Problem
cargo install
exits with success code when installing a list of crates, even if some of them failed.As a result, anybody running
cargo install crate1 crate2
will get a false sense of success if one of the crates failed to install. For example Dockerfiles running such commands will not fail to build, which means the resulting container image does not contain all the crates one hopes to find installed, sincecargo install
still exited with success code.Steps
cargo install
a list of crates where at least 1 fails and at least 1 succeeds. Right now I usedcargo install --force cargo-sweep cargo-deny
for example (as cargo-deny has issues installing without --locked; see Build failure due to bitvec dependency EmbarkStudios/cargo-deny#331 for details although the reason for failure is irrelevant to the issue reported here)Possible Solution(s)
Perhaps it's better to succeed only if all requested crates were successfully installed.
As a side note, documentation for
cargo install
should be updated to reflect the behaviour, either current or future.Notes
Output of
cargo version
:cargo 1.49.0 (d00d64d 2020-12-05)
OSX using stable channel
The text was updated successfully, but these errors were encountered: