@@ -48,11 +48,16 @@ impl TestCtx {
48
48
pub struct ConfigBuilder {
49
49
args : Vec < String > ,
50
50
directory : PathBuf ,
51
+ override_download_ci_llvm : bool ,
51
52
}
52
53
53
54
impl ConfigBuilder {
54
55
fn from_args ( args : & [ & str ] , directory : PathBuf ) -> Self {
55
- Self { args : args. iter ( ) . copied ( ) . map ( String :: from) . collect ( ) , directory }
56
+ Self {
57
+ args : args. iter ( ) . copied ( ) . map ( String :: from) . collect ( ) ,
58
+ directory,
59
+ override_download_ci_llvm : true ,
60
+ }
56
61
}
57
62
58
63
pub fn path ( mut self , path : & str ) -> Self {
@@ -106,34 +111,26 @@ impl ConfigBuilder {
106
111
self
107
112
}
108
113
109
- pub fn create_config ( mut self ) -> Config {
110
- // Run in dry-check, otherwise the test would be too slow
111
- self . args . push ( "--dry-run" . to_string ( ) ) ;
112
-
113
- // Ignore submodules
114
- self . args . push ( "--set" . to_string ( ) ) ;
115
- self . args . push ( "build.submodules=false" . to_string ( ) ) ;
116
-
117
- // Override any external LLVM set and inhibit CI LLVM; pretend that we're always building
118
- // in-tree LLVM from sources.
119
- self . args . push ( "--set" . to_string ( ) ) ;
120
- self . args . push ( "llvm.download-ci-llvm=false" . to_string ( ) ) ;
121
-
122
- // Do not mess with the local rustc checkout build directory
123
- self . args . push ( "--build-dir" . to_string ( ) ) ;
124
- self . args . push ( self . directory . join ( "build" ) . display ( ) . to_string ( ) ) ;
125
-
126
- Config :: parse ( Flags :: parse ( & self . args ) )
114
+ pub fn no_override_download_ci_llvm ( mut self ) -> Self {
115
+ self . override_download_ci_llvm = false ;
116
+ self
127
117
}
128
118
129
- pub fn create_config_without_ci_llvm_override ( mut self ) -> Config {
119
+ pub fn create_config ( mut self ) -> Config {
130
120
// Run in dry-check, otherwise the test would be too slow
131
121
self . args . push ( "--dry-run" . to_string ( ) ) ;
132
122
133
123
// Ignore submodules
134
124
self . args . push ( "--set" . to_string ( ) ) ;
135
125
self . args . push ( "build.submodules=false" . to_string ( ) ) ;
136
126
127
+ if self . override_download_ci_llvm {
128
+ // Override any external LLVM set and inhibit CI LLVM; pretend that we're always building
129
+ // in-tree LLVM from sources.
130
+ self . args . push ( "--set" . to_string ( ) ) ;
131
+ self . args . push ( "llvm.download-ci-llvm=false" . to_string ( ) ) ;
132
+ }
133
+
137
134
// Do not mess with the local rustc checkout build directory
138
135
self . args . push ( "--build-dir" . to_string ( ) ) ;
139
136
self . args . push ( self . directory . join ( "build" ) . display ( ) . to_string ( ) ) ;
0 commit comments