@@ -62,6 +62,9 @@ impl Finder {
62
62
}
63
63
64
64
pub fn check ( build : & mut Build ) {
65
+ let skip_target_sanity =
66
+ env:: var_os ( "BOOTSTRAP_SKIP_TARGET_SANITY" ) . is_some_and ( |s| s == "1" || s == "true" ) ;
67
+
65
68
let path = env:: var_os ( "PATH" ) . unwrap_or_default ( ) ;
66
69
// On Windows, quotes are invalid characters for filename paths, and if
67
70
// one is present as part of the PATH then that can lead to the system
@@ -166,7 +169,7 @@ than building it.
166
169
// FIXME: it would be better to refactor this code to split necessary setup from pure sanity
167
170
// checks, and have a regular flag for skipping the latter. Also see
168
171
// <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
169
- if env :: var_os ( "BOOTSTRAP_SKIP_TARGET_SANITY" ) . is_some ( ) {
172
+ if skip_target_sanity {
170
173
continue ;
171
174
}
172
175
@@ -205,7 +208,15 @@ than building it.
205
208
}
206
209
}
207
210
208
- // Make sure musl-root is valid
211
+ // Some environments don't want or need these tools, such as when testing Miri.
212
+ // FIXME: it would be better to refactor this code to split necessary setup from pure sanity
213
+ // checks, and have a regular flag for skipping the latter. Also see
214
+ // <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
215
+ if skip_target_sanity {
216
+ continue ;
217
+ }
218
+
219
+ // Make sure musl-root is valid.
209
220
if target. contains ( "musl" ) && !target. contains ( "unikraft" ) {
210
221
// If this is a native target (host is also musl) and no musl-root is given,
211
222
// fall back to the system toolchain in /usr before giving up
@@ -227,14 +238,6 @@ than building it.
227
238
}
228
239
}
229
240
230
- // Some environments don't want or need these tools, such as when testing Miri.
231
- // FIXME: it would be better to refactor this code to split necessary setup from pure sanity
232
- // checks, and have a regular flag for skipping the latter. Also see
233
- // <https://github.com/rust-lang/rust/pull/103569#discussion_r1008741742>.
234
- if env:: var_os ( "BOOTSTRAP_SKIP_TARGET_SANITY" ) . is_some ( ) {
235
- continue ;
236
- }
237
-
238
241
if need_cmake && target. contains ( "msvc" ) {
239
242
// There are three builds of cmake on windows: MSVC, MinGW, and
240
243
// Cygwin. The Cygwin build does not have generators for Visual
0 commit comments