Skip to content

Commit

Permalink
Migrate print-target-list to rmake
Browse files Browse the repository at this point in the history
  • Loading branch information
Rejyr committed Aug 4, 2024
1 parent 3a41a11 commit 1ca959e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/tools/tidy/src/allowed_run_make_makefiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ run-make/no-alloc-shim/Makefile
run-make/pdb-buildinfo-cl-cmd/Makefile
run-make/pgo-gen-lto/Makefile
run-make/pgo-indirect-call-promotion/Makefile
run-make/print-target-list/Makefile
run-make/raw-dylib-alt-calling-convention/Makefile
run-make/raw-dylib-c/Makefile
run-make/redundant-libs/Makefile
Expand Down
8 changes: 0 additions & 8 deletions tests/run-make/print-target-list/Makefile

This file was deleted.

21 changes: 21 additions & 0 deletions tests/run-make/print-target-list/rmake.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Checks that all the targets returned by `rustc --print target-list` are valid
// target specifications

use run_make_support::bare_rustc;

// FIXME(127877): certain experimental targets fail with creating a 'LLVM TargetMachine'
// in CI, so we skip them
const EXPERIMENTAL_TARGETS: &[&str] = &["avr", "m68k", "csky", "xtensa"];

fn main() {
let targets = bare_rustc().print("target-list").run().stdout_utf8();

for target in targets.lines() {
// skip experimental targets that would otherwise fail
if EXPERIMENTAL_TARGETS.iter().any(|experimental| target.contains(experimental)) {
continue;
}

bare_rustc().target(target).print("sysroot").run();
}
}

0 comments on commit 1ca959e

Please sign in to comment.