Skip to content

Commit 119abac

Browse files
committed
Fix OCaml stubs
1 parent 1c2bbd5 commit 119abac

File tree

4 files changed

+155
-0
lines changed

4 files changed

+155
-0
lines changed

hphp/hack/src/stubs/dune

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,17 @@
5959
(preprocess
6060
(pps lwt_ppx ppx_deriving.std)))
6161

62+
(library
63+
(name state_loader_stubs)
64+
(wrapped false)
65+
(modules saved_state_loader state_loader_futures state_loader_lwt)
66+
(libraries
67+
hg
68+
server_env
69+
typechecker_options)
70+
(preprocess
71+
(pps lwt_ppx ppx_deriving.std)))
72+
6273
(library
6374
(name remote_old_decls_ffi)
6475
(wrapped false)

hphp/hack/src/stubs/state_loader.mli

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
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 dirty_files = {
10+
master_changes: Relative_path.t list;
11+
local_changes: Relative_path.t list;
12+
}
13+
14+
type hot_decls_paths = {
15+
legacy_hot_decls_path: string;
16+
shallow_hot_decls_path: string;
17+
}
18+
19+
type native_load_result = {
20+
naming_table_path: string;
21+
corresponding_rev: Hg.rev;
22+
mergebase_rev: Hg.global_rev option;
23+
mergebase: Hg.Rev.t option Future.t;
24+
is_cached: bool;
25+
state_distance: int;
26+
deptable_fn: string;
27+
dirty_files: dirty_files Future.t;
28+
hot_decls_paths: hot_decls_paths;
29+
errors_path: string;
30+
}
31+
32+
type saved_state_handle = {
33+
saved_state_for_rev: Hg.rev;
34+
saved_state_everstore_handle: string;
35+
watchman_mergebase: MonitorUtils.watchman_mergebase option;
36+
}
37+
38+
type error = unit
39+
40+
type verbose_error = {
41+
message: string;
42+
stack: Utils.callstack;
43+
auto_retry: bool;
44+
environment: string option;
45+
}
46+
[@@deriving show]
47+
48+
val error_string_verbose : error -> verbose_error
49+
50+
val cached_state :
51+
load_64bit:bool ->
52+
?saved_state_handle:saved_state_handle ->
53+
config_hash:string ->
54+
rev:Hg.rev ->
55+
(Hg.rev * string * MonitorUtils.watchman_mergebase option) option
56+
57+
val fetch_saved_state :
58+
load_64bit:bool ->
59+
?cache_limit:int ->
60+
config:State_loader_config.timeouts ->
61+
config_hash:string ->
62+
saved_state_handle ->
63+
(string, error) result Future.t
64+
65+
val mk_state_future :
66+
config:State_loader_config.timeouts ->
67+
load_64bit:bool ->
68+
?saved_state_handle:saved_state_handle ->
69+
config_hash:string option ->
70+
ignore_hh_version:bool ->
71+
ignore_hhconfig:bool ->
72+
use_prechecked_files:bool ->
73+
Path.t ->
74+
(native_load_result, error) result Future.t
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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_project_metadata
10+
~progress_callback:_
11+
~saved_state_type:_
12+
~repo:_
13+
~ignore_hh_version:_
14+
~opts:_ =
15+
failwith "Not implemented"
16+
17+
let load ~ssopt:_ ~progress_callback:_ ~watchman_opts:_ ~ignore_hh_version:_ =
18+
Future.of_value (Error "Not implemented")
19+
20+
let wait_for_finish _ = failwith "Not implemented"
21+
22+
let wait_for_finish_with_debug_details _ = failwith "Not implemented"
23+
24+
let download_and_unpack_saved_state_from_manifold
25+
~ssopt:_
26+
~progress_callback:_
27+
~manifold_path:_
28+
~target_path:_
29+
~saved_state_type:_ =
30+
failwith "Not implemented"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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_project_metadata ~repo:_ ~ignore_hh_version:_ ~opts:_ =
10+
Lwt.return (Error ("Not implemented", Telemetry.create ()))
11+
12+
let load ~ssopt:_ ~progress_callback:_ ~watchman_opts:_ ~ignore_hh_version:_ =
13+
Lwt.return (Error "Not implemented")
14+
15+
let load_internal
16+
~ssopt:_
17+
~progress_callback:_
18+
~watchman_opts:_
19+
~ignore_hh_version:_
20+
~saved_state_type:_ =
21+
failwith "Not implemented"
22+
23+
let prepare_download_dir () = failwith "Not implemented"
24+
25+
let get_saved_state_target_path ~download_dir:_ ~manifold_path:_ =
26+
failwith "Not implemented"
27+
28+
let download_and_unpack_saved_state_from_manifold
29+
~ssopt:_ ~progress_callback:_ ~manifold_path:_ ~target_path:_ =
30+
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:_ = Error "Not implemented"
40+
end

0 commit comments

Comments
 (0)