@@ -15,6 +15,7 @@ use std::fs;
15
15
use std:: path:: PathBuf ;
16
16
use std:: process:: Command ;
17
17
18
+ use crate :: builder:: Kind ;
18
19
use crate :: core:: config:: Target ;
19
20
use crate :: utils:: helpers:: output;
20
21
use crate :: Build ;
@@ -64,6 +65,8 @@ pub fn check(build: &mut Build) {
64
65
let mut skip_target_sanity =
65
66
env:: var_os ( "BOOTSTRAP_SKIP_TARGET_SANITY" ) . is_some_and ( |s| s == "1" || s == "true" ) ;
66
67
68
+ skip_target_sanity |= build. config . cmd . kind ( ) == Kind :: Check ;
69
+
67
70
// Skip target sanity checks when we are doing anything with mir-opt tests or Miri
68
71
let skipped_paths = [ OsStr :: new ( "mir-opt" ) , OsStr :: new ( "miri" ) ] ;
69
72
skip_target_sanity |= build. config . paths . iter ( ) . any ( |path| {
@@ -169,11 +172,7 @@ than building it.
169
172
continue ;
170
173
}
171
174
172
- // Some environments don't want or need these tools, such as when testing Miri.
173
- // FIXME: it would be better to refactor this code to split necessary setup from pure sanity
174
- // checks, and have a regular flag for skipping the latter. Also see
175
- // <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
176
- if skip_target_sanity {
175
+ if skip_target_sanity && target != & build. build {
177
176
continue ;
178
177
}
179
178
@@ -215,11 +214,7 @@ than building it.
215
214
panic ! ( "All the *-none-* and nvptx* targets are no-std targets" )
216
215
}
217
216
218
- // Some environments don't want or need these tools, such as when testing Miri.
219
- // FIXME: it would be better to refactor this code to split necessary setup from pure sanity
220
- // checks, and have a regular flag for skipping the latter. Also see
221
- // <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
222
- if skip_target_sanity {
217
+ if skip_target_sanity && target != & build. build {
223
218
continue ;
224
219
}
225
220
0 commit comments