From 1cef2af9c7e5e2e0d59298d330a1fa4ca348f2ec Mon Sep 17 00:00:00 2001 From: Henri Verroken Date: Tue, 12 Jan 2021 04:51:41 -0800 Subject: [PATCH] Store master/local changes in record instead of tuple Summary: Currently, we store master/local changes in a `Relative_path.t list * Relative_path.t list`, not the most readable/error-resistent type. I've changed it to a record type to make sure we don't switch them around. Reviewed By: ljw1004 Differential Revision: D25847407 fbshipit-source-id: 54544324498d2b4739fdc6fd74e7f21aea7dbf27 --- hphp/hack/src/server/serverLazyInit.ml | 6 +++++- hphp/hack/src/stubs/state_loader.ml | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hphp/hack/src/server/serverLazyInit.ml b/hphp/hack/src/server/serverLazyInit.ml index 7356e7f2b28..4add8eca202 100644 --- a/hphp/hack/src/server/serverLazyInit.ml +++ b/hphp/hack/src/server/serverLazyInit.ml @@ -160,7 +160,11 @@ let merge_saved_state_futures let t = Unix.time () in (match result.State_loader.dirty_files |> Future.get ~timeout:200 with | Error error -> Error (Load_state_dirty_files_failure error) - | Ok (dirty_master_files, dirty_local_files) -> + | Ok + { + State_loader.master_changes = dirty_master_files; + local_changes = dirty_local_files; + } -> let () = HackEventLogger.state_loader_dirty_files t in let dirty_naming_files = Relative_path.Set.of_list dirty_naming_files in let dirty_master_files = Relative_path.Set.of_list dirty_master_files in diff --git a/hphp/hack/src/stubs/state_loader.ml b/hphp/hack/src/stubs/state_loader.ml index aa9024ccd00..c7a9d1597b6 100644 --- a/hphp/hack/src/stubs/state_loader.ml +++ b/hphp/hack/src/stubs/state_loader.ml @@ -1,3 +1,8 @@ +type dirty_files = { + master_changes: Relative_path.t list; + local_changes: Relative_path.t list; +} + type hot_decls_paths = { legacy_hot_decls_path: string; shallow_hot_decls_path: string; @@ -12,7 +17,7 @@ type native_load_result = { state_distance: int; deptable_fn: string; deptable_is_64bit: bool; - dirty_files: (Relative_path.t list * Relative_path.t list) Future.t; + dirty_files: dirty_files Future.t; hot_decls_paths: hot_decls_paths; errors_path: string; } -- 2.11.4.GIT