diff --git a/base/loading.jl b/base/loading.jl index 9137651007c30a..7d92c19c461458 100644 --- a/base/loading.jl +++ b/base/loading.jl @@ -2645,6 +2645,7 @@ end return true end end + tracked_path = unsafe_string(JLOptions().tracked_path) for chi in includes f, ftime_req = chi.filename, chi.mtime if !isfile(f) @@ -2657,6 +2658,14 @@ end @debug "Rejecting stale cache file $cachefile because file $f does not exist" return true end + if JLOptions().code_coverage == 3 && occursin(tracked_path, f) + @debug "Rejecting cache file $cachefile because included file $f is being tracked by --code-coverage" + return true + end + if JLOptions().malloc_log == 3 && occursin(tracked_path, f) + @debug "Rejecting cache file $cachefile because included file $f is being tracked by --track-allocation" + return true + end ftime = mtime(f) is_stale = ( ftime != ftime_req ) && ( ftime != floor(ftime_req) ) && # Issue #13606, PR #13613: compensate for Docker images rounding mtimes