@@ -119,7 +119,28 @@ impl StepDescription {
119
119
}
120
120
}
121
121
122
- fn maybe_run ( & self , builder : & Builder , path : Option < & Path > ) {
122
+ fn maybe_run ( & self , builder : & Builder , should_run : & ShouldRun , path : Option < & Path > ) {
123
+ if let Some ( path) = path {
124
+ if builder. config . exclude . iter ( ) . any ( |e| e == path) {
125
+ eprintln ! ( "Skipping {:?} because this path is excluded" , path) ;
126
+ return ;
127
+ } else if !builder. config . exclude . is_empty ( ) {
128
+ eprintln ! ( "{:?} not skipped -- not in {:?}" , path, builder. config. exclude) ;
129
+ }
130
+ } else {
131
+ if !should_run. paths . is_empty ( ) {
132
+ if should_run. paths . iter ( ) . all ( |p| builder. config . exclude . contains ( & p) ) {
133
+ eprintln ! ( "Skipping because all of its paths ({:?}) are excluded" ,
134
+ should_run. paths) ;
135
+ return ;
136
+ } else if should_run. paths . len ( ) > 1 {
137
+ for path in & should_run. paths {
138
+ self . maybe_run ( builder, should_run, Some ( path) ) ;
139
+ }
140
+ return ;
141
+ }
142
+ }
143
+ }
123
144
let build = builder. build ;
124
145
let hosts = if self . only_build_targets || self . only_build {
125
146
build. build_triple ( )
@@ -160,7 +181,7 @@ impl StepDescription {
160
181
if paths. is_empty ( ) {
161
182
for ( desc, should_run) in v. iter ( ) . zip ( should_runs) {
162
183
if desc. default && should_run. is_really_default {
163
- desc. maybe_run ( builder, None ) ;
184
+ desc. maybe_run ( builder, & should_run , None ) ;
164
185
}
165
186
}
166
187
} else {
@@ -169,7 +190,7 @@ impl StepDescription {
169
190
for ( desc, should_run) in v. iter ( ) . zip ( & should_runs) {
170
191
if should_run. run ( path) {
171
192
attempted_run = true ;
172
- desc. maybe_run ( builder, Some ( path) ) ;
193
+ desc. maybe_run ( builder, & should_run , Some ( path) ) ;
173
194
}
174
195
}
175
196
@@ -208,13 +229,13 @@ impl<'a> ShouldRun<'a> {
208
229
209
230
pub fn krate ( mut self , name : & str ) -> Self {
210
231
for ( _, krate_path) in self . builder . crates ( name) {
211
- self . paths . insert ( PathBuf :: from ( krate_path) ) ;
232
+ self . paths . insert ( t ! ( env :: current_dir ( ) ) . join ( krate_path) ) ;
212
233
}
213
234
self
214
235
}
215
236
216
237
pub fn path ( mut self , path : & str ) -> Self {
217
- self . paths . insert ( PathBuf :: from ( path) ) ;
238
+ self . paths . insert ( t ! ( env :: current_dir ( ) ) . join ( path) ) ;
218
239
self
219
240
}
220
241
0 commit comments