Skip to content

Commit

Permalink
Ensure that all LLVM components requested by tests are available on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
petrochenkov committed Sep 29, 2020
1 parent 26373fb commit 9340ee4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ if [ "$RUST_RELEASE_CHANNEL" = "nightly" ] || [ "$DIST_REQUIRE_ALL_TOOLS" = "" ]
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-missing-tools"
fi

export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1

# 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
# Pipelines it happened that the certificates were marked as expired.
Expand Down
7 changes: 5 additions & 2 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,13 @@ impl EarlyProps {
config.parse_name_value_directive(line, "needs-llvm-components")
{
let components: HashSet<_> = config.llvm_components.split_whitespace().collect();
if !needed_components
if let Some(missing_component) = needed_components
.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;
}
}
Expand Down

0 comments on commit 9340ee4

Please sign in to comment.