File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -488,6 +488,17 @@ impl Config {
488
488
git_merge_commit_email : & self . git_merge_commit_email ,
489
489
}
490
490
}
491
+
492
+ pub fn has_subprocess_support ( & self ) -> bool {
493
+ // FIXME(#135928): compiletest is always a **host** tool. Building and running an
494
+ // capability detection executable against the **target** is not trivial. The short term
495
+ // solution here is to hard-code some targets to allow/deny, unfortunately.
496
+
497
+ let unsupported_target = self . target_cfg ( ) . env == "sgx"
498
+ || matches ! ( self . target_cfg( ) . arch. as_str( ) , "wasm32" | "wasm64" )
499
+ || self . target_cfg ( ) . os == "emscripten" ;
500
+ !unsupported_target
501
+ }
491
502
}
492
503
493
504
/// Known widths of `target_has_atomic`.
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
152
152
"needs-sanitizer-support" ,
153
153
"needs-sanitizer-thread" ,
154
154
"needs-std-debug-assertions" ,
155
+ "needs-subprocess" ,
155
156
"needs-symlink" ,
156
157
"needs-target-has-atomic" ,
157
158
"needs-threads" ,
Original file line number Diff line number Diff line change @@ -94,6 +94,11 @@ pub(super) fn handle_needs(
94
94
condition : config. has_threads ( ) ,
95
95
ignore_reason : "ignored on targets without threading support" ,
96
96
} ,
97
+ Need {
98
+ name : "needs-subprocess" ,
99
+ condition : config. has_subprocess_support ( ) ,
100
+ ignore_reason : "ignored on targets without subprocess support" ,
101
+ } ,
97
102
Need {
98
103
name : "needs-unwind" ,
99
104
condition : config. can_unwind ( ) ,
@@ -351,6 +356,9 @@ fn find_dlltool(config: &Config) -> bool {
351
356
dlltool_found
352
357
}
353
358
359
+ // FIXME(#135928): this is actually not quite right because this detection is run on the **host**.
360
+ // This however still helps the case of windows -> windows local development in case symlinks are
361
+ // not available.
354
362
#[ cfg( windows) ]
355
363
fn has_symlinks ( ) -> bool {
356
364
if std:: env:: var_os ( "CI" ) . is_some ( ) {
You can’t perform that action at this time.
0 commit comments