File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ use std::io;
12
12
use std:: io:: { Read , Seek , SeekFrom , Write } ;
13
13
use std:: path:: { Display , Path , PathBuf } ;
14
14
15
+ use crate :: core:: Verbosity ;
15
16
use crate :: util:: errors:: CargoResult ;
16
17
use crate :: util:: style;
17
18
use crate :: util:: GlobalContext ;
@@ -392,14 +393,15 @@ fn acquire(
392
393
lock_try : & dyn Fn ( ) -> io:: Result < ( ) > ,
393
394
lock_block : & dyn Fn ( ) -> io:: Result < ( ) > ,
394
395
) -> CargoResult < ( ) > {
395
- if cfg ! ( debug_assertions) {
396
- // Force borrow to catch invalid borrows outside of contention situations
397
- gctx. shell ( ) . verbosity ( ) ;
398
- }
396
+ let verbose = gctx. shell ( ) . verbosity ( ) == Verbosity :: Verbose ;
399
397
if try_acquire ( path, lock_try) ? {
400
398
return Ok ( ( ) ) ;
401
399
}
402
- let msg = format ! ( "waiting for file lock on {}" , msg) ;
400
+ let msg = if verbose {
401
+ format ! ( "waiting for file lock on {} ({})" , msg, path. display( ) )
402
+ } else {
403
+ format ! ( "waiting for file lock on {}" , msg)
404
+ } ;
403
405
gctx. shell ( )
404
406
. status_with_color ( "Blocking" , & msg, & style:: NOTE ) ?;
405
407
You can’t perform that action at this time.
0 commit comments