Improve handling of cases where llvm-tools-preview is not installed #219
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR: You no longer need to manually install
llvm-tools-preview
before running cargo-llvm-cov in most cases.Previously, cargo-llvm-cov exit with error suggesting the installation of
llvm-tools-preview
.The new logic is based on the logic used by Miri when
rust-src
component orxargo
is not installed.llvm-tools-preview
, and if the user allows it, cargo-llvm-cov will install thellvm-tools-preview
.llvm-tools-preview
without asking the user (interactive prompts don't work on CI).Additionally, this adds an environment variable to control the behavior here.
CARGO_LLVM_COV_SETUP=no
environment variable is set, cargo-llvm-cov exit with error suggesting the installation ofllvm-tools-preview
. This matches with the previous behavior.CARGO_LLVM_COV_SETUP=yes
environment variable is set, cargo-llvm-cov will install thellvm-tools-preview
without asking the user. This matches with the behavior on CI.EDIT: If a toolchain is installed without via rustup, this works like
CARGO_LLVM_COV_SETUP=no
.