Skip to content

Commit 79beca1

Browse files
committed
Update OCaml stubs
The OSS OCaml stubs under src/stubs have become out of sync with the code referencing them. Update the stubs to match.
1 parent b024a70 commit 79beca1

12 files changed

+90
-46
lines changed

hphp/hack/src/client/dune

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
pos
2929
rage
3030
redeclarations
31+
sandcastle
3132
server
3233
server_command_types
3334
server_monitor
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let start _ = ()

hphp/hack/src/stubs/dune

+16-12
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,11 @@
6565
(modules saved_state_loader state_loader_futures state_loader_lwt)
6666
(libraries
6767
hg
68+
server_env
6869
typechecker_options)
6970
(preprocess
7071
(pps lwt_ppx ppx_deriving.std)))
7172

72-
; this stub file is used by both buck2 and dune
73-
(rule
74-
(target remote_old_decls_ffi.ml)
75-
(action
76-
(copy# ../facebook/remote_old_decls/stubs/remote_old_decls_ffi.ml remote_old_decls_ffi.ml)))
77-
7873
(library
7974
(name remote_old_decls_ffi)
8075
(wrapped false)
@@ -84,12 +79,6 @@
8479
(preprocess
8580
(pps lwt_ppx ppx_deriving.std)))
8681

87-
; this stub file is used by both buck2 and dune
88-
(rule
89-
(target hh_distc_ffi.ml)
90-
(action
91-
(copy# ../facebook/hh_distc/check_ffi/stubs/hh_distc_ffi.ml hh_distc_ffi.ml)))
92-
9382
(library
9483
(name hh_distc_ffi)
9584
(wrapped false)
@@ -169,6 +158,21 @@
169158
(preprocess
170159
(pps lwt_ppx ppx_deriving.std)))
171160

161+
(library
162+
(name redeclarations)
163+
(wrapped false)
164+
(modules declarationsRewriter))
165+
166+
(library
167+
(name linttool)
168+
(wrapped false)
169+
(modules linttool))
170+
171+
(library
172+
(name sandcastle_stubs)
173+
(wrapped false)
174+
(modules sandcastle))
175+
172176
(library
173177
(name startup_initializer_stubs)
174178
(wrapped false)

hphp/hack/src/stubs/hh_distc_ffi.ml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
(*
2+
* Copyright (c) Facebook, Inc. and its 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+
type handle
10+
11+
let spawn ~root:_ ~ss_dir:_ ~hhdg_path:_ _ = failwith "start not implemented"
12+
13+
let join _ = failwith "join_handle not implemented"
14+
15+
let cancel _ = failwith "cancel not implemented"
16+
17+
let is_finished _ = failwith "is_finished not implemented"
18+
19+
let get_fd _ = failwith "get_fd not implemented"
20+
21+
let get_re_session_id _ = failwith "get_re_session_id not implemented"
22+
23+
let recv _ = failwith "recv not implemented"

hphp/hack/src/stubs/linttool.ml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let run _ ~severity:_ = ()

hphp/hack/src/stubs/logging/hackEventLogger.ml

+7-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ let set_changed_mergebase _ = ()
2727

2828
let set_hhconfig_version _ = ()
2929

30+
let set_mergebase_globalrev _ = ()
31+
3032
let set_rollout_group _ = ()
3133

3234
let set_rollout_flags _ = ()
@@ -105,7 +107,7 @@ let type_check_dirty ~start_t:_ ~dirty_count:_ ~recheck_count:_ = ()
105107

106108
let lock_stolen _ = ()
107109

108-
let client_init ~init_id:_ ~from:_ ~custom_columns:_ _ = ()
110+
let client_init ~init_id:_ ~from:_ ~is_interactive:_ ~custom_columns:_ _ = ()
109111

110112
let serverless_ide_init ~init_id:_ = ()
111113

@@ -571,3 +573,7 @@ module Fanouts = struct
571573
let log ~changes_cardinal:_ ~fanout_cardinal:_ ~max_class_fanout_cardinal:_ =
572574
()
573575
end
576+
577+
module TypingErrors = struct
578+
let log_errors ~type_check_end_id:_ ~data:_ = ()
579+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
(*
2+
* Copyright (c) Facebook, Inc. and its 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+
let get_decls_via_file_hashes _ _ =
10+
failwith "get_decls_via_file_hashes not implemented"

hphp/hack/src/stubs/sandcastle.ml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let is_sandcastle () : bool = false

hphp/hack/src/stubs/saved_state_loader.ml

+14-8
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ module Naming_and_dep_table_info = struct
3535
naming_table_path: Path.t;
3636
naming_sqlite_table_path: Path.t;
3737
dep_table_path: Path.t;
38+
compressed_dep_table_path: Path.t;
3839
errors_path: Path.t;
40+
warning_hashes_path: Path.t;
3941
}
4042

4143
type dirty_files = {
@@ -44,11 +46,13 @@ module Naming_and_dep_table_info = struct
4446
}
4547

4648
type additional_info = {
47-
mergebase_global_rev: Hg.global_rev option;
4849
dirty_files_promise: dirty_files Future.t;
49-
saved_state_distance: int option;
50-
saved_state_age: int option;
50+
saved_state_revs_info: ServerEnv.saved_state_revs_info;
5151
}
52+
53+
let additional_info_of_yojson _ : additional_info = failwith "Not implemented"
54+
55+
let yojson_of_additional_info _ = failwith "Not implemented"
5256
end
5357

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

83-
type ('main_artifacts, 'additional_info) load_result = {
84-
main_artifacts: 'main_artifacts;
85-
additional_info: 'additional_info;
87+
let changed_files_of_yojson _ = failwith "Not implemented"
88+
89+
let yojson_of_changed_files _ = failwith "Not implemented"
90+
91+
type load_result = {
92+
main_artifacts: Naming_and_dep_table_info.main_artifacts;
93+
additional_info: Naming_and_dep_table_info.additional_info;
8694
manifold_path: string;
8795
changed_files_according_to_watchman: changed_files;
88-
corresponding_rev: Hg.Rev.t;
89-
mergebase_rev: Hg.Rev.t;
9096
is_cached: bool;
9197
}
9298

hphp/hack/src/stubs/state_loader_futures.ml

+1-6
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ let get_project_metadata
1414
~opts:_ =
1515
failwith "Not implemented"
1616

17-
let load
18-
~ssopt:_
19-
~progress_callback:_
20-
~watchman_opts:_
21-
~ignore_hh_version:_
22-
~saved_state_type:_ =
17+
let load ~ssopt:_ ~progress_callback:_ ~watchman_opts:_ ~ignore_hh_version:_ =
2318
Future.of_value (Error "Not implemented")
2419

2520
let wait_for_finish _ = failwith "Not implemented"

hphp/hack/src/stubs/state_loader_lwt.ml

+14-18
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,10 @@
66
*
77
*)
88

9-
let get_project_metadata
10-
~progress_callback:_
11-
~saved_state_type:_
12-
~repo:_
13-
~ignore_hh_version:_
14-
~opts:_ =
9+
let get_project_metadata ~repo:_ ~ignore_hh_version:_ ~opts:_ =
1510
failwith "Not implemented"
1611

17-
let load
18-
~ssopt:_
19-
~progress_callback:_
20-
~watchman_opts:_
21-
~ignore_hh_version:_
22-
~saved_state_type:_ =
12+
let load ~ssopt:_ ~progress_callback:_ ~watchman_opts:_ ~ignore_hh_version:_ =
2313
failwith "Not implemented"
2414

2515
let load_internal
@@ -30,15 +20,21 @@ let load_internal
3020
~saved_state_type:_ =
3121
failwith "Not implemented"
3222

33-
let prepare_download_dir ~saved_state_type:_ = failwith "Not implemented"
23+
let prepare_download_dir () = failwith "Not implemented"
3424

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

3828
let download_and_unpack_saved_state_from_manifold
39-
~ssopt:_
40-
~progress_callback:_
41-
~manifold_path:_
42-
~target_path:_
43-
~saved_state_type:_ =
29+
~ssopt:_ ~progress_callback:_ ~manifold_path:_ ~target_path:_ =
4430
failwith "Not implemented"
31+
32+
module FromDisk = struct
33+
type load_result = {
34+
naming_table_path: Path.t;
35+
warning_saved_state_path: Path.t;
36+
files_changed: Saved_state_loader.changed_files;
37+
}
38+
39+
let load ~project_metadata:_ ~threshold:_ ~root:_ = failwith "Not implemented"
40+
end

hphp/hack/src/watchman/dune

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
(name watchman_utils)
2121
(wrapped false)
2222
(modules watchman_utils)
23-
(libraries hh_json logging utils_core)
23+
(libraries hg hh_json logging utils_core)
2424
(preprocess
2525
(pps lwt_ppx ppx_deriving.std)))
2626

0 commit comments

Comments
 (0)