[buck-java] sort infer-deps before merge

Summary: Improve determinism by sorting the order of capture databases before merging.

Reviewed By: jvillard

Differential Revision: D21378208

fbshipit-source-id: 9c82d9d56
master
Nikos Gorogiannis 5 years ago committed by Facebook GitHub Bot
parent 2973828675
commit 54669287c0

@ -42,7 +42,7 @@ module L = Logging
] ]
*) *)
(** Read the build report json file buck produced, and parse into a list of pairs (** Read the build report json file buck produced, and parse into a sorted list of pairs
[(target, output-path)]. NB contrary to what buck documentation says, the output path is always [(target, output-path)]. NB contrary to what buck documentation says, the output path is always
present even when the target is locally cached. *) present even when the target is locally cached. *)
let read_and_parse_report build_report = let read_and_parse_report build_report =
@ -78,7 +78,9 @@ let read_and_parse_report build_report =
| _ -> | _ ->
None None
in in
Yojson.Basic.from_file build_report |> get_json_field "results" |> Option.bind ~f:parse_results Yojson.Basic.from_file build_report
|> get_json_field "results" |> Option.bind ~f:parse_results
|> Option.map ~f:(List.stable_sort ~compare:[%compare: string * string])
let infer_deps_of_build_report build_report = let infer_deps_of_build_report build_report =

Loading…
Cancel
Save