Skip to content

Commit 5b20140

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 664bf62 commit 5b20140

12 files changed

+89
-30
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)
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

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
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

+12-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,12 @@ 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+
let yojson_of_additional_info _ = failwith "Not implemented"
5255
end
5356

5457
module Naming_table_info = struct
@@ -80,13 +83,14 @@ include files other than Hack files, so the caller should filter the given list
8083
as necessary. *)
8184
type changed_files = Relative_path.t list
8285

83-
type ('main_artifacts, 'additional_info) load_result = {
84-
main_artifacts: 'main_artifacts;
85-
additional_info: 'additional_info;
86+
let changed_files_of_yojson _ = failwith "Not implemented"
87+
let yojson_of_changed_files _ = failwith "Not implemented"
88+
89+
type load_result = {
90+
main_artifacts: Naming_and_dep_table_info.main_artifacts;
91+
additional_info: Naming_and_dep_table_info.additional_info;
8692
manifold_path: string;
8793
changed_files_according_to_watchman: changed_files;
88-
corresponding_rev: Hg.Rev.t;
89-
mergebase_rev: Hg.Rev.t;
9094
is_cached: bool;
9195
}
9296

hphp/hack/src/stubs/state_loader_futures.ml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ let load
1818
~ssopt:_
1919
~progress_callback:_
2020
~watchman_opts:_
21-
~ignore_hh_version:_
22-
~saved_state_type:_ =
21+
~ignore_hh_version:_ =
2322
Future.of_value (Error "Not implemented")
2423

2524
let wait_for_finish _ = failwith "Not implemented"

hphp/hack/src/stubs/state_loader_lwt.ml

+14-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
*)
88

99
let get_project_metadata
10-
~progress_callback:_
11-
~saved_state_type:_
1210
~repo:_
1311
~ignore_hh_version:_
1412
~opts:_ =
@@ -19,7 +17,7 @@ let load
1917
~progress_callback:_
2018
~watchman_opts:_
2119
~ignore_hh_version:_
22-
~saved_state_type:_ =
20+
=
2321
failwith "Not implemented"
2422

2523
let load_internal
@@ -30,7 +28,7 @@ let load_internal
3028
~saved_state_type:_ =
3129
failwith "Not implemented"
3230

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

3533
let get_saved_state_target_path ~download_dir:_ ~manifold_path:_ =
3634
failwith "Not implemented"
@@ -39,6 +37,16 @@ let download_and_unpack_saved_state_from_manifold
3937
~ssopt:_
4038
~progress_callback:_
4139
~manifold_path:_
42-
~target_path:_
43-
~saved_state_type:_ =
40+
~target_path:_ =
4441
failwith "Not implemented"
42+
43+
module FromDisk = struct
44+
45+
type load_result = {
46+
naming_table_path: Path.t;
47+
warning_saved_state_path: Path.t;
48+
files_changed: Saved_state_loader.changed_files;
49+
}
50+
51+
let load ~project_metadata:_ ~threshold:_ ~root:_ = failwith "Not implemented"
52+
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)