Skip to content

Commit

Permalink
Update OCaml stubs
Browse files Browse the repository at this point in the history
The OSS OCaml stubs under src/stubs have become out of sync with the
code referencing them.

Update the stubs to match.
  • Loading branch information
mszabo-wikia committed Jan 9, 2025
1 parent dd65d8f commit 80ebba7
Show file tree
Hide file tree
Showing 12 changed files with 90 additions and 46 deletions.
1 change: 1 addition & 0 deletions hphp/hack/src/client/dune
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
pos
rage
redeclarations
sandcastle
server
server_command_types
server_monitor
Expand Down
1 change: 1 addition & 0 deletions hphp/hack/src/stubs/declarationsRewriter.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let start _ = ()
28 changes: 16 additions & 12 deletions hphp/hack/src/stubs/dune
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,11 @@
(modules saved_state_loader state_loader_futures state_loader_lwt)
(libraries
hg
server_env
typechecker_options)
(preprocess
(pps lwt_ppx ppx_deriving.std)))

; this stub file is used by both buck2 and dune
(rule
(target remote_old_decls_ffi.ml)
(action
(copy# ../facebook/remote_old_decls/stubs/remote_old_decls_ffi.ml remote_old_decls_ffi.ml)))

(library
(name remote_old_decls_ffi)
(wrapped false)
Expand All @@ -84,12 +79,6 @@
(preprocess
(pps lwt_ppx ppx_deriving.std)))

; this stub file is used by both buck2 and dune
(rule
(target hh_distc_ffi.ml)
(action
(copy# ../facebook/hh_distc/check_ffi/stubs/hh_distc_ffi.ml hh_distc_ffi.ml)))

(library
(name hh_distc_ffi)
(wrapped false)
Expand Down Expand Up @@ -169,6 +158,21 @@
(preprocess
(pps lwt_ppx ppx_deriving.std)))

(library
(name redeclarations)
(wrapped false)
(modules declarationsRewriter))

(library
(name linttool)
(wrapped false)
(modules linttool))

(library
(name sandcastle)
(wrapped false)
(modules sandcastle))

(library
(name startup_initializer_stubs)
(wrapped false)
Expand Down
23 changes: 23 additions & 0 deletions hphp/hack/src/stubs/hh_distc_ffi.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the "hack" directory of this source tree.
*
*)

type handle

let spawn ~root:_ ~ss_dir:_ ~hhdg_path:_ _ = failwith "start not implemented"

let join _ = failwith "join_handle not implemented"

let cancel _ = failwith "cancel not implemented"

let is_finished _ = failwith "is_finished not implemented"

let get_fd _ = failwith "get_fd not implemented"

let get_re_session_id _ = failwith "get_re_session_id not implemented"

let recv _ = failwith "recv not implemented"
1 change: 1 addition & 0 deletions hphp/hack/src/stubs/linttool.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let run _ ~severity:_ = ()
8 changes: 7 additions & 1 deletion hphp/hack/src/stubs/logging/hackEventLogger.ml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ let set_changed_mergebase _ = ()

let set_hhconfig_version _ = ()

let set_mergebase_globalrev _ = ()

let set_rollout_group _ = ()

let set_rollout_flags _ = ()
Expand Down Expand Up @@ -105,7 +107,7 @@ let type_check_dirty ~start_t:_ ~dirty_count:_ ~recheck_count:_ = ()

let lock_stolen _ = ()

let client_init ~init_id:_ ~from:_ ~custom_columns:_ _ = ()
let client_init ~init_id:_ ~from:_ ~is_interactive:_ ~custom_columns:_ _ = ()

let serverless_ide_init ~init_id:_ = ()

Expand Down Expand Up @@ -571,3 +573,7 @@ module Fanouts = struct
let log ~changes_cardinal:_ ~fanout_cardinal:_ ~max_class_fanout_cardinal:_ =
()
end

module TypingErrors = struct
let log_errors ~type_check_end_id:_ ~data:_ = ()
end
10 changes: 10 additions & 0 deletions hphp/hack/src/stubs/remote_old_decls_ffi.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the "hack" directory of this source tree.
*
*)

let get_decls_via_file_hashes _ _ =
failwith "get_decls_via_file_hashes not implemented"
1 change: 1 addition & 0 deletions hphp/hack/src/stubs/sandcastle.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let is_sandcastle () : bool = false
22 changes: 14 additions & 8 deletions hphp/hack/src/stubs/saved_state_loader.ml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ module Naming_and_dep_table_info = struct
naming_table_path: Path.t;
naming_sqlite_table_path: Path.t;
dep_table_path: Path.t;
compressed_dep_table_path: Path.t;
errors_path: Path.t;
warning_hashes_path: Path.t;
}

type dirty_files = {
Expand All @@ -44,11 +46,13 @@ module Naming_and_dep_table_info = struct
}

type additional_info = {
mergebase_global_rev: Hg.global_rev option;
dirty_files_promise: dirty_files Future.t;
saved_state_distance: int option;
saved_state_age: int option;
saved_state_revs_info: ServerEnv.saved_state_revs_info;
}

let additional_info_of_yojson _ : additional_info = failwith "Not implemented"

let yojson_of_additional_info _ = failwith "Not implemented"
end

module Naming_table_info = struct
Expand Down Expand Up @@ -80,13 +84,15 @@ include files other than Hack files, so the caller should filter the given list
as necessary. *)
type changed_files = Relative_path.t list

type ('main_artifacts, 'additional_info) load_result = {
main_artifacts: 'main_artifacts;
additional_info: 'additional_info;
let changed_files_of_yojson _ = failwith "Not implemented"

let yojson_of_changed_files _ = failwith "Not implemented"

type load_result = {
main_artifacts: Naming_and_dep_table_info.main_artifacts;
additional_info: Naming_and_dep_table_info.additional_info;
manifold_path: string;
changed_files_according_to_watchman: changed_files;
corresponding_rev: Hg.Rev.t;
mergebase_rev: Hg.Rev.t;
is_cached: bool;
}

Expand Down
7 changes: 1 addition & 6 deletions hphp/hack/src/stubs/state_loader_futures.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ let get_project_metadata
~opts:_ =
failwith "Not implemented"

let load
~ssopt:_
~progress_callback:_
~watchman_opts:_
~ignore_hh_version:_
~saved_state_type:_ =
let load ~ssopt:_ ~progress_callback:_ ~watchman_opts:_ ~ignore_hh_version:_ =
Future.of_value (Error "Not implemented")

let wait_for_finish _ = failwith "Not implemented"
Expand Down
32 changes: 14 additions & 18 deletions hphp/hack/src/stubs/state_loader_lwt.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,10 @@
*
*)

let get_project_metadata
~progress_callback:_
~saved_state_type:_
~repo:_
~ignore_hh_version:_
~opts:_ =
let get_project_metadata ~repo:_ ~ignore_hh_version:_ ~opts:_ =
failwith "Not implemented"

let load
~ssopt:_
~progress_callback:_
~watchman_opts:_
~ignore_hh_version:_
~saved_state_type:_ =
let load ~ssopt:_ ~progress_callback:_ ~watchman_opts:_ ~ignore_hh_version:_ =
failwith "Not implemented"

let load_internal
Expand All @@ -30,15 +20,21 @@ let load_internal
~saved_state_type:_ =
failwith "Not implemented"

let prepare_download_dir ~saved_state_type:_ = failwith "Not implemented"
let prepare_download_dir () = failwith "Not implemented"

let get_saved_state_target_path ~download_dir:_ ~manifold_path:_ =
failwith "Not implemented"

let download_and_unpack_saved_state_from_manifold
~ssopt:_
~progress_callback:_
~manifold_path:_
~target_path:_
~saved_state_type:_ =
~ssopt:_ ~progress_callback:_ ~manifold_path:_ ~target_path:_ =
failwith "Not implemented"

module FromDisk = struct
type load_result = {
naming_table_path: Path.t;
warning_saved_state_path: Path.t;
files_changed: Saved_state_loader.changed_files;
}

let load ~project_metadata:_ ~threshold:_ ~root:_ = failwith "Not implemented"
end
2 changes: 1 addition & 1 deletion hphp/hack/src/watchman/dune
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
(name watchman_utils)
(wrapped false)
(modules watchman_utils)
(libraries hh_json logging utils_core)
(libraries hg hh_json logging utils_core)
(preprocess
(pps lwt_ppx ppx_deriving.std)))

Expand Down

0 comments on commit 80ebba7

Please sign in to comment.