[infer-out][7/9] kill --export-changed-functions-output

Summary:
This is an entry in infer-out/, we want these to be predictable, not
user-defined.

Reviewed By: ngorogiannis

Differential Revision: D20894307

fbshipit-source-id: 332f85969
master
Jules Villard 5 years ago committed by Facebook GitHub Bot
parent 932d3a3f92
commit 7e1f0fdff9

@ -1346,9 +1346,6 @@ INTERNAL OPTIONS
test-determinator. It is used together with the --modified-lines. test-determinator. It is used together with the --modified-lines.
(Conversely: --no-export-changed-functions) (Conversely: --no-export-changed-functions)
--export-changed-functions-output path
Name of file for export-changed-functions results
--external-java-packages-reset --external-java-packages-reset
Set --external-java-packages to the empty list. Set --external-java-packages to the empty list.

@ -26,9 +26,9 @@ let merge_global_tenvs infer_deps_file =
L.progress "Merging type environments took %a@." Mtime.Span.pp (Mtime_clock.count time0) L.progress "Merging type environments took %a@." Mtime.Span.pp (Mtime_clock.count time0)
let merge_json_results infer_out_src json_file_name = let merge_json_results infer_out_src json_entry =
let main_changed_fs_file = Config.results_dir ^/ json_file_name in let main_changed_fs_file = ResultsDir.get_path json_entry in
let changed_fs_file = infer_out_src ^/ json_file_name in let changed_fs_file = ResultsDirEntryName.get_path ~results_dir:infer_out_src json_entry in
let main_json = try YB.from_file main_changed_fs_file |> YBU.to_list with Sys_error _ -> [] in let main_json = try YB.from_file main_changed_fs_file |> YBU.to_list with Sys_error _ -> [] in
let changed_json = try YB.from_file changed_fs_file |> YBU.to_list with Sys_error _ -> [] in let changed_json = try YB.from_file changed_fs_file |> YBU.to_list with Sys_error _ -> [] in
let all_fs = let all_fs =
@ -50,7 +50,7 @@ let merge_all_json_results merge_results results_json_str =
let merge_changed_functions () = let merge_changed_functions () =
let merge_changed_functions_json infer_out_src = let merge_changed_functions_json infer_out_src =
merge_json_results infer_out_src Config.export_changed_functions_output merge_json_results infer_out_src ChangedFunctions
in in
merge_all_json_results merge_changed_functions_json "changed functions" merge_all_json_results merge_changed_functions_json "changed functions"

@ -2179,11 +2179,6 @@ and export_changed_functions =
the $(b,--modified-lines)." the $(b,--modified-lines)."
and export_changed_functions_output =
CLOpt.mk_path ~long:"export-changed-functions-output" ~default:"changed_functions.json"
"Name of file for export-changed-functions results"
and scheduler = and scheduler =
CLOpt.mk_symbol ~long:"scheduler" ~default:File ~eq:equal_scheduler CLOpt.mk_symbol ~long:"scheduler" ~default:File ~eq:equal_scheduler
~symbols:[("file", File); ("restart", Restart); ("callgraph", SyntacticCallGraph)] ~symbols:[("file", File); ("restart", Restart); ("callgraph", SyntacticCallGraph)]
@ -3032,8 +3027,6 @@ and test_determinator_output = !test_determinator_output
and export_changed_functions = !export_changed_functions and export_changed_functions = !export_changed_functions
and export_changed_functions_output = !export_changed_functions_output
and test_filtering = !test_filtering and test_filtering = !test_filtering
and profiler_samples = !profiler_samples and profiler_samples = !profiler_samples

@ -600,8 +600,6 @@ val test_determinator_output : string
val export_changed_functions : bool val export_changed_functions : bool
val export_changed_functions_output : string
val test_filtering : bool val test_filtering : bool
val testing_mode : bool val testing_mode : bool

@ -201,7 +201,9 @@ let scrub_for_caching () =
[ report_json [ report_json
; costs_report_json ; costs_report_json
; test_determinator_output ; test_determinator_output
; export_changed_functions_output ])) ; (* ChangedFunctions; TODO: this hard-coded string will be deleted in a next diff
when the logic for scrubbing will be entirely in {!ResultsDirEntryName}. *)
"changed_functions.json" ]))
&& ( List.mem ~equal:String.equal files_to_delete (Filename.basename name) && ( List.mem ~equal:String.equal files_to_delete (Filename.basename name)
|| List.exists ~f:(Filename.check_suffix name) suffixes_to_delete ) || List.exists ~f:(Filename.check_suffix name) suffixes_to_delete )
in in

@ -6,7 +6,7 @@
*) *)
open! IStd open! IStd
type id = Logs | Specs | Temporary [@@deriving enumerate] type id = ChangedFunctions | Logs | Specs | Temporary [@@deriving enumerate]
type cleanup_action = Delete | Keep [@@deriving equal] type cleanup_action = Delete | Keep [@@deriving equal]
@ -22,6 +22,11 @@ type t =
e.g., a distributed Buck cache. *) } e.g., a distributed Buck cache. *) }
let of_id = function let of_id = function
| ChangedFunctions ->
{ rel_path= "changed_functions.json"
; kind= File
; before_incremental_analysis= Delete
; before_caching_capture= Keep }
| Logs -> | Logs ->
{ rel_path= "logs" { rel_path= "logs"
; kind= File ; kind= File

@ -10,6 +10,7 @@ open! IStd
directory you probably want to use {!ResultsDir.Entry} instead of this module. *) directory you probably want to use {!ResultsDir.Entry} instead of this module. *)
type id = type id =
| ChangedFunctions (** results of the clang test determinator *)
| Logs (** log file *) | Logs (** log file *)
| Specs (** directory containing summaries as .specs files *) | Specs (** directory containing summaries as .specs files *)
| Temporary (** directory containing temp files *) | Temporary (** directory containing temp files *)

@ -172,7 +172,7 @@ let emit_relevant_methods relevant_methods =
(List.map (Procname.Set.elements relevant_methods) ~f:Procname.to_string) (List.map (Procname.Set.elements relevant_methods) ~f:Procname.to_string)
in in
let json = `List (List.map ~f:(fun t -> `String t) cleaned_methods) in let json = `List (List.map ~f:(fun t -> `String t) cleaned_methods) in
let outpath = Config.results_dir ^/ Config.export_changed_functions_output in let outpath = ResultsDir.get_path ChangedFunctions in
YB.to_file outpath json YB.to_file outpath json

Loading…
Cancel
Save