[infer][java] make sure the analysis does not default to absolute path on Buck projects

Summary: Prevent the analysis to default to absolute paths which would invalidate the cache.

Reviewed By: mbouaziz

Differential Revision: D6997490

fbshipit-source-id: 3c17658
master
Jeremy Dubreil 7 years ago committed by Facebook Github Bot
parent 9e0ed1c489
commit a4531b6fa0

@ -59,8 +59,7 @@ let from_abs_path ?(warn_on_error= true) fname =
| Some path ->
RelativeProjectRoot path
| None when Config.buck_cache_mode && Filename.check_suffix fname_real "java" ->
L.internal_error "%s is not relative to %s" fname_real project_root_real ;
Invalid "absolute path"
L.(die InternalError) "%s is not relative to %s" fname_real project_root_real
| None ->
match Utils.filename_to_relative ~root:models_dir_real fname_real with
| Some path ->

@ -94,7 +94,7 @@ let do_all_files classpath sources classes =
~f:(fun pattern -> Str.string_match (Str.regexp pattern) path 0)
Config.skip_analysis_in_path
in
SourceFile.is_invalid source_file || is_path_matching (SourceFile.to_rel_path source_file)
is_path_matching (SourceFile.to_rel_path source_file)
|| Inferconfig.skip_translation_matcher source_file Typ.Procname.empty_block
in
let translate_source_file basename (package_opt, _) source_file =

Loading…
Cancel
Save