@@ -119,7 +119,28 @@ impl StepDescription {
119119 }
120120 }
121121
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+ }
123144 let build = builder. build ;
124145 let hosts = if self . only_build_targets || self . only_build {
125146 build. build_triple ( )
@@ -160,7 +181,7 @@ impl StepDescription {
160181 if paths. is_empty ( ) {
161182 for ( desc, should_run) in v. iter ( ) . zip ( should_runs) {
162183 if desc. default && should_run. is_really_default {
163- desc. maybe_run ( builder, None ) ;
184+ desc. maybe_run ( builder, & should_run , None ) ;
164185 }
165186 }
166187 } else {
@@ -169,7 +190,7 @@ impl StepDescription {
169190 for ( desc, should_run) in v. iter ( ) . zip ( & should_runs) {
170191 if should_run. run ( path) {
171192 attempted_run = true ;
172- desc. maybe_run ( builder, Some ( path) ) ;
193+ desc. maybe_run ( builder, & should_run , Some ( path) ) ;
173194 }
174195 }
175196
@@ -208,13 +229,13 @@ impl<'a> ShouldRun<'a> {
208229
209230 pub fn krate ( mut self , name : & str ) -> Self {
210231 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) ) ;
212233 }
213234 self
214235 }
215236
216237 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) ) ;
218239 self
219240 }
220241
0 commit comments