Skip to content

Commit bfb6bb7

Browse files
authored
Unrolled build for rust-lang#129605
Rollup merge of rust-lang#129605 - jieyouxu:needs-llvm-components, r=Mark-Simulacrum Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen Without suitable `needs-llvm-components` directives, some run-make tests exercising target-specific codegen can fail if the LLVM used is built without the necessary components. Currently, the list is: ``` tests\run-make\print-target-list tests\run-make\print-to-output tests\run-make\print-cfg tests\run-make\target-without-atomic-cas ``` This PR also skips tidy checks for revisions and `needs-llvm-components` for run-make tests since revisions are not supported. Fixes rust-lang#129390. Fixes rust-lang#127895. cc ``@petrochenkov`` who noticed this, thanks! Would be great if you could confirm that this fixes the test errors for you locally.
2 parents d571ae8 + beaf9d1 commit bfb6bb7

File tree

5 files changed

+40
-13
lines changed

5 files changed

+40
-13
lines changed

src/tools/tidy/src/target_specific_tests.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ struct RevisionInfo<'a> {
3636
llvm_components: Option<Vec<&'a str>>,
3737
}
3838

39-
pub fn check(path: &Path, bad: &mut bool) {
40-
crate::walk::walk(path, |path, _is_dir| filter_not_rust(path), &mut |entry, content| {
39+
pub fn check(tests_path: &Path, bad: &mut bool) {
40+
crate::walk::walk(tests_path, |path, _is_dir| filter_not_rust(path), &mut |entry, content| {
4141
let file = entry.path().display();
4242
let mut header_map = BTreeMap::new();
4343
iter_header(content, &mut |HeaderLine { revision, directive, .. }| {
@@ -65,6 +65,12 @@ pub fn check(path: &Path, bad: &mut bool) {
6565
}
6666
}
6767
});
68+
69+
// Skip run-make tests as revisions are not supported.
70+
if entry.path().strip_prefix(tests_path).is_ok_and(|rest| rest.starts_with("run-make")) {
71+
return;
72+
}
73+
6874
for (rev, RevisionInfo { target_arch, llvm_components }) in &header_map {
6975
let rev = rev.unwrap_or("[unspecified]");
7076
match (target_arch, llvm_components) {

tests/run-make/print-cfg/rmake.rs

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
//!
66
//! It also checks that some targets have the correct set cfgs.
77
8+
// ignore-tidy-linelength
9+
//@ needs-llvm-components: arm x86
10+
// Note: without the needs-llvm-components it will fail on LLVM built without the required
11+
// components listed above.
12+
813
use std::collections::HashSet;
914
use std::iter::FromIterator;
1015
use std::path::PathBuf;

tests/run-make/print-target-list/rmake.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
// Checks that all the targets returned by `rustc --print target-list` are valid
2-
// target specifications
1+
// Checks that all the targets returned by `rustc --print target-list` are valid target
2+
// specifications.
3+
4+
// ignore-tidy-linelength
5+
//@ needs-llvm-components: aarch64 arm avr bpf csky hexagon loongarch m68k mips msp430 nvptx powerpc riscv sparc systemz webassembly x86
6+
// FIXME(jieyouxu): there has to be a better way to do this, without the needs-llvm-components it
7+
// will fail on LLVM built without all of the components listed above.
38

49
use run_make_support::bare_rustc;
510

6-
// FIXME(127877): certain experimental targets fail with creating a 'LLVM TargetMachine'
7-
// in CI, so we skip them
11+
// FIXME(#127877): certain experimental targets fail with creating a 'LLVM TargetMachine' in CI, so
12+
// we skip them.
813
const EXPERIMENTAL_TARGETS: &[&str] = &["avr", "m68k", "csky", "xtensa"];
914

1015
fn main() {

tests/run-make/print-to-output/rmake.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
//! This checks the output of some `--print` options when
2-
//! output to a file (instead of stdout)
1+
//! This checks the output of some `--print` options when output to a file (instead of stdout)
2+
3+
// ignore-tidy-linelength
4+
//@ needs-llvm-components: aarch64 arm avr bpf csky hexagon loongarch m68k mips msp430 nvptx powerpc riscv sparc systemz webassembly x86
5+
// FIXME(jieyouxu): there has to be a better way to do this, without the needs-llvm-components it
6+
// will fail on LLVM built without all of the components listed above. If adding a new target that
7+
// relies on a llvm component not listed above, it will need to be added to the required llvm
8+
// components above.
39

410
use std::path::PathBuf;
511

tests/run-make/target-without-atomic-cas/rmake.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
// ARM Cortex-M are a class of processors supported by the rust compiler. However,
2-
// they cannot support any atomic features, such as Arc. This test simply prints
3-
// the configuration details of one Cortex target, and checks that the compiler
4-
// does not falsely list atomic support.
5-
// See https://github.com/rust-lang/rust/pull/36874
1+
// ARM Cortex-M are a class of processors supported by the rust compiler. However, they cannot
2+
// support any atomic features, such as Arc. This test simply prints the configuration details of
3+
// one Cortex target, and checks that the compiler does not falsely list atomic support.
4+
// See <https://github.com/rust-lang/rust/pull/36874>.
5+
6+
// ignore-tidy-linelength
7+
//@ needs-llvm-components: arm
8+
// Note: without the needs-llvm-components it will fail on LLVM built without all of the components
9+
// listed above. If any new targets are added, please double-check their respective llvm components
10+
// are specified above.
611

712
use run_make_support::rustc;
813

0 commit comments

Comments
 (0)