Skip to content

Commit 2ac08cc

Browse files
Catherine Gasnierfacebook-github-bot
authored andcommitted
Cleanup: remove unused directory parameter to GEN_PREFETCH_DIR
Summary: We also rename to POPULATE_REMOTE_DECLS Reviewed By: bobrenjc93 Differential Revision: D47209166 fbshipit-source-id: 01744cc2fb678bfc99567ebe4fe6d0699e4654d6
1 parent 5c1517f commit 2ac08cc

File tree

10 files changed

+26
-22
lines changed

10 files changed

+26
-22
lines changed

hphp/hack/src/client/clientArgs.ml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -392,9 +392,13 @@ let parse_check_args cmd ~from_default =
392392
" (mode) for each entry in input list get list of function dependencies [file:line:character list]"
393393
);
394394
( "--gen-prefetch-dir",
395-
Arg.String (fun x -> set_mode (MODE_GEN_PREFETCH_DIR x)),
396-
" generate a directory of decls and typecheck dependencies to use for prefetching"
397-
^ " Usage: --gen-prefetch-dir ~/prefetched-dir" );
395+
Arg.String (fun _x -> set_mode MODE_POPULATE_REMOTE_DECLS),
396+
" Compute all decls for the repo and upload them to the remote decl service."
397+
^ " Usage: --gen-prefetch-dir unused" );
398+
( "--populate-remote-decls",
399+
Arg.Unit (fun () -> set_mode MODE_POPULATE_REMOTE_DECLS),
400+
" Compute all decls for the repo and upload them to the remote decl service."
401+
);
398402
( "--gen-saved-ignore-type-errors",
399403
Arg.Set gen_saved_ignore_type_errors,
400404
" generate a saved state even if there are type errors (default: false)."

hphp/hack/src/client/clientCheck.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ let main_internal
276276
let%lwt results = rpc_with_retry args @@ Rpc.FIND_REFS action in
277277
ClientFindRefs.go results args.output_json;
278278
Lwt.return (Exit_status.No_error, Telemetry.create ())
279-
| MODE_GEN_PREFETCH_DIR dirname ->
280-
let%lwt (_, telemetry) = rpc args @@ Rpc.GEN_PREFETCH_DIR dirname in
279+
| MODE_POPULATE_REMOTE_DECLS ->
280+
let%lwt (_, telemetry) = rpc args Rpc.POPULATE_REMOTE_DECLS in
281281
Lwt.return (Exit_status.No_error, telemetry)
282282
| MODE_GO_TO_IMPL_CLASS class_name ->
283283
let%lwt results =

hphp/hack/src/client/clientEnv.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ type client_mode =
3232
| MODE_FORMAT of int * int
3333
| MODE_FULL_FIDELITY_PARSE of string
3434
| MODE_FULL_FIDELITY_SCHEMA
35-
| MODE_GEN_PREFETCH_DIR of string
35+
| MODE_POPULATE_REMOTE_DECLS
3636
| MODE_GO_TO_IMPL_CLASS of string
3737
| MODE_GO_TO_IMPL_CLASS_REMOTE of string
3838
| MODE_GO_TO_IMPL_METHOD of string

hphp/hack/src/server/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@
463463
serverFileDependents
464464
serverFileSync
465465
serverFormat
466-
serverGenPrefetchDir
467466
serverIdle
468467
serverInferTypeBatch
469468
serverTastHolesBatch
@@ -472,6 +471,7 @@
472471
serverLint
473472
serverMethodJumps
474473
serverMethodJumpsBatch
474+
serverPopulateRemoteDecls
475475
serverRage
476476
serverRename
477477
serverRewriteLambdaParameters

hphp/hack/src/server/serverCommand.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ let rpc_command_needs_full_check : type a. a t -> bool =
4646
| DELETE_CHECKPOINT _ -> true
4747
| IN_MEMORY_DEP_TABLE_SIZE -> true
4848
| NO_PRECHECKED_FILES -> true
49-
| GEN_PREFETCH_DIR _ -> false
49+
| POPULATE_REMOTE_DECLS -> false
5050
| STATS -> false
5151
| DISCONNECT -> false
5252
| STATUS_SINGLE _ -> false

hphp/hack/src/server/serverCommandTypes.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ type _ t =
556556
| RAGE : ServerRageTypes.result t
557557
| CST_SEARCH : cst_search_input -> (Hh_json.json, string) result t
558558
| NO_PRECHECKED_FILES : unit t
559-
| GEN_PREFETCH_DIR : string -> unit t
559+
| POPULATE_REMOTE_DECLS : unit t
560560
| FUN_DEPS_BATCH : (string * int * int) list -> string list t
561561
| LIST_FILES_WITH_ERRORS : string list t
562562
| FILE_DEPENDENTS : string list -> string list t

hphp/hack/src/server/serverCommandTypesUtils.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ let debug_describe_t : type a. a t -> string = function
5959
| RAGE -> "RAGE"
6060
| CST_SEARCH _ -> "CST_SEARCH"
6161
| NO_PRECHECKED_FILES -> "NO_PRECHECKED_FILES"
62-
| GEN_PREFETCH_DIR _ -> "GEN_PREFETCH_DIR"
62+
| POPULATE_REMOTE_DECLS -> "POPULATE_REMOTE_DECLS"
6363
| FUN_DEPS_BATCH _ -> "FUN_DEPS_BATCH"
6464
| LIST_FILES_WITH_ERRORS -> "LIST_FILES_WITH_ERRORS"
6565
| FILE_DEPENDENTS _ -> "FILE_DEPENDENTS"

hphp/hack/src/server/serverGenPrefetchDir.ml renamed to hphp/hack/src/server/serverPopulateRemoteDecls.ml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,10 @@ let ( >>= ) res f =
2222
| Ok r -> f r
2323
| Error e -> Future.Promise.return (Error e))
2424

25-
let ( >|= ) = Future.Promise.bind
26-
2725
let return_ok x = Future.Promise.return (Ok x)
2826

2927
let return_err x = Future.Promise.return (Error x)
3028

31-
let get_name_and_decl_hashes_from_decls decls : (string * Int64.t) list =
32-
List.filter_map decls ~f:(fun (name, decl, decl_hash) ->
33-
match decl with
34-
| Shallow_decl_defs.Class _ -> Some (name, decl_hash)
35-
| _ -> None)
36-
3729
let get_hhconfig_version ~(repo : Path.t) :
3830
(string, string) result Future.Promise.t =
3931
let hhconfig_path =
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the "hack" directory of this source tree.
6+
*
7+
*)
8+
9+
val go :
10+
ServerEnv.env -> ServerEnv.genv -> MultiWorker.worker list option -> unit

hphp/hack/src/server/serverRpc.ml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,8 @@ let handle : type a. genv -> env -> is_stale:bool -> a t -> env * a =
411411
(env, Error (Exception.to_string e))
412412
end
413413
| NO_PRECHECKED_FILES -> (ServerPrecheckedFiles.expand_all env, ())
414-
| GEN_PREFETCH_DIR dir ->
415-
(* TODO(bobren) remove dir entirely from saved state job invocation *)
416-
let _ = dir in
417-
(env, ServerGenPrefetchDir.go env genv genv.workers)
414+
| POPULATE_REMOTE_DECLS ->
415+
(env, ServerPopulateRemoteDecls.go env genv genv.workers)
418416
| FUN_DEPS_BATCH positions ->
419417
(env, ServerFunDepsBatch.go genv.workers positions env)
420418
| LIST_FILES_WITH_ERRORS -> (env, ServerEnv.list_files env)

0 commit comments

Comments
 (0)