@@ -6,7 +6,7 @@ use std::sync::{Arc, Mutex};
66
77use crate :: core:: PackageId ;
88use crate :: core:: compiler:: compilation:: { self , UnitOutput } ;
9- use crate :: core:: compiler:: { self , Unit , UserIntent , artifact} ;
9+ use crate :: core:: compiler:: { self , Unit , artifact} ;
1010use crate :: util:: cache_lock:: CacheLockMode ;
1111use crate :: util:: errors:: CargoResult ;
1212use annotate_snippets:: { Level , Message } ;
@@ -352,32 +352,11 @@ impl<'a, 'gctx> BuildRunner<'a, 'gctx> {
352352 #[ tracing:: instrument( skip_all) ]
353353 pub fn prepare_units ( & mut self ) -> CargoResult < ( ) > {
354354 let dest = self . bcx . profiles . get_dir_name ( ) ;
355- // We try to only lock the artifact-dir if we need to.
356- // For example, `cargo check` does not write any files to the artifact-dir so we don't need
357- // to lock it.
358- let must_take_artifact_dir_lock = match self . bcx . build_config . intent {
359- UserIntent :: Check { .. } => {
360- // Generally cargo check does not need to take the artifact-dir lock but there is
361- // one exception: If check has `--timings` we still need to lock artifact-dir since
362- // we will output the report files.
363- !self . bcx . build_config . timing_outputs . is_empty ( )
364- }
365- UserIntent :: Build
366- | UserIntent :: Test
367- | UserIntent :: Doc { .. }
368- | UserIntent :: Doctest
369- | UserIntent :: Bench => true ,
370- } ;
371- let host_layout = Layout :: new ( self . bcx . ws , None , & dest, must_take_artifact_dir_lock) ?;
355+ let host_layout = Layout :: new ( self . bcx . ws , None , & dest) ?;
372356 let mut targets = HashMap :: new ( ) ;
373357 for kind in self . bcx . all_kinds . iter ( ) {
374358 if let CompileKind :: Target ( target) = * kind {
375- let layout = Layout :: new (
376- self . bcx . ws ,
377- Some ( target) ,
378- & dest,
379- must_take_artifact_dir_lock,
380- ) ?;
359+ let layout = Layout :: new ( self . bcx . ws , Some ( target) , & dest) ?;
381360 targets. insert ( target, layout) ;
382361 }
383362 }
0 commit comments