@@ -14,7 +14,10 @@ impl Checker for ExecutableChecker {
1414 #[ cfg( any( unix, target_os = "wasi" , target_os = "redox" ) ) ]
1515 fn is_valid ( & self , path : & Path ) -> bool {
1616 use rustix:: fs as rfs;
17- rfs:: access ( path, rfs:: Access :: EXEC_OK ) . is_ok ( )
17+ let ret = rfs:: access ( path, rfs:: Access :: EXEC_OK ) . is_ok ( ) ;
18+ #[ cfg( feature = "tracing" ) ]
19+ tracing:: trace!( "{} EXEC_OK = {ret}" , path. display( ) ) ;
20+ ret
1821 }
1922
2023 #[ cfg( windows) ]
@@ -34,26 +37,37 @@ impl ExistedChecker {
3437impl Checker for ExistedChecker {
3538 #[ cfg( target_os = "windows" ) ]
3639 fn is_valid ( & self , path : & Path ) -> bool {
37- fs:: symlink_metadata ( path)
40+ let ret = fs:: symlink_metadata ( path)
3841 . map ( |metadata| {
3942 let file_type = metadata. file_type ( ) ;
43+ #[ cfg( feature = "tracing" ) ]
44+ tracing:: trace!( "{} is_file() = {}, is_symlink() = {}" , new_path. display( ) , file_type. is_file( ) , file_type. is_symlink( ) ) ;
4045 file_type. is_file ( ) || file_type. is_symlink ( )
4146 } )
4247 . unwrap_or ( false )
43- && ( path. extension ( ) . is_some ( ) || matches_arch ( path) )
48+ && ( path. extension ( ) . is_some ( ) || matches_arch ( path) ) ;
49+ #[ cfg( feature = "tracing" ) ]
50+ tracing:: trace!( "{} has_extension = {}, ExistedChecker::is_valid() = {ret}" , path. display( ) , path. extension( ) . is_some( ) ) ;
51+ ret
4452 }
4553
4654 #[ cfg( not( target_os = "windows" ) ) ]
4755 fn is_valid ( & self , path : & Path ) -> bool {
48- fs:: metadata ( path)
56+ let ret = fs:: metadata ( path)
4957 . map ( |metadata| metadata. is_file ( ) )
50- . unwrap_or ( false )
58+ . unwrap_or ( false ) ;
59+ #[ cfg( feature = "tracing" ) ]
60+ tracing:: trace!( "{} is_file() = {ret}" , path. display( ) ) ;
61+ ret
5162 }
5263}
5364
5465#[ cfg( target_os = "windows" ) ]
5566fn matches_arch ( path : & Path ) -> bool {
56- winsafe:: GetBinaryType ( & path. display ( ) . to_string ( ) ) . is_ok ( )
67+ let ret = winsafe:: GetBinaryType ( & path. display ( ) . to_string ( ) ) . is_ok ( ) ;
68+ #[ cfg( feature = "tracing" ) ]
69+ tracing:: trace!( "{} matches_arch() = {ret}" , path. display( ) ) ;
70+ ret
5771}
5872
5973pub struct CompositeChecker {
0 commit comments