Rollup merge of #77280 - petrochenkov:llvmcomp, r=Mark-Simulacrum

Ensure that all LLVM components requested by tests are available on CI

Addresses https://github.com/rust-lang/rust/pull/75064#issuecomment-667722652

I used an environment variable because passing a command line option all the way from CI to compiletest would be just too much hassle for this task.
I added a new variable, but any of the already existing ones defined by CI could be used instead.
r? @Mark-Simulacrum
This commit is contained in:
Jonas Schievink 2020-09-30 20:56:09 +02:00 committed by GitHub
commit a4dc8dae02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -104,6 +104,8 @@ if [ "$RUST_RELEASE_CHANNEL" = "nightly" ] || [ "$DIST_REQUIRE_ALL_TOOLS" = "" ]
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-missing-tools" RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-missing-tools"
fi fi
export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1
# Print the date from the local machine and the date from an external source to # Print the date from the local machine and the date from an external source to
# check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure # check for clock drifts. An HTTP URL is used instead of HTTPS since on Azure
# Pipelines it happened that the certificates were marked as expired. # Pipelines it happened that the certificates were marked as expired.

View file

@ -208,10 +208,13 @@ impl EarlyProps {
config.parse_name_value_directive(line, "needs-llvm-components") config.parse_name_value_directive(line, "needs-llvm-components")
{ {
let components: HashSet<_> = config.llvm_components.split_whitespace().collect(); let components: HashSet<_> = config.llvm_components.split_whitespace().collect();
if !needed_components if let Some(missing_component) = needed_components
.split_whitespace() .split_whitespace()
.all(|needed_component| components.contains(needed_component)) .find(|needed_component| !components.contains(needed_component))
{ {
if env::var_os("COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS").is_some() {
panic!("missing LLVM component: {}", missing_component);
}
return true; return true;
} }
} }