Skip to content

compiletest: clarify COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS error #125710

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

Merged
merged 1 commit into from
May 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --dist-compression-formats=xz"
if [ "$EXTERNAL_LLVM" = "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set build.optimized-compiler-builtins"
# Likewise, only demand we test all LLVM components if we know we built LLVM with them
export COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS=1
export COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS=1
elif [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
echo "error: dist builds should always use optimized compiler-rt!" >&2
exit 1
Expand Down
9 changes: 6 additions & 3 deletions src/tools/compiletest/src/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,7 @@ pub fn make_test_description<R: Read>(
if config.target == "wasm32-unknown-unknown" {
if config.parse_name_directive(ln, directives::CHECK_RUN_RESULTS) {
decision!(IgnoreDecision::Ignore {
reason: "ignored when checking the run results on WASM".into(),
reason: "ignored on WASM as the run results cannot be checked there".into(),
});
}
}
Expand Down Expand Up @@ -1577,8 +1577,11 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
.split_whitespace()
.find(|needed_component| !components.contains(needed_component))
{
if env::var_os("COMPILETEST_NEEDS_ALL_LLVM_COMPONENTS").is_some() {
panic!("missing LLVM component: {}", missing_component);
if env::var_os("COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS").is_some() {
panic!(
"missing LLVM component {}, and COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS is set",
missing_component
);
}
return IgnoreDecision::Ignore {
reason: format!("ignored when the {missing_component} LLVM component is missing"),
Expand Down
3 changes: 3 additions & 0 deletions src/tools/tidy/src/target_specific_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ pub fn check(path: &Path, bad: &mut bool) {
}
if let Some(llvm_components) = llvm_components {
for component in llvm_components {
// Ensure the given component even exists.
// This is somewhat redundant with COMPILETEST_REQUIRE_ALL_LLVM_COMPONENTS,
// but helps detect such problems earlier (PR CI rather than bors CI).
if !KNOWN_LLVM_COMPONENTS.contains(component) {
eprintln!(
"{}: revision {} specifies unknown LLVM component `{}`",
Expand Down
Loading