Remove enable_disk_heap setting
[hiphop-php.git] / hphp / hack / src / options / globalOptions.mli
blob811efd4a0718d6b82074118bf26fefffffbef5db
1 (*
2 * Copyright (c) 2015, Facebook, Inc.
3 * All rights reserved.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
8 *)
10 (* Naming conventions in this file:
11 - tco_<feature/flag/setting> - type checker option
12 - po_<feature/flag/setting> - parser option
13 - so_<feature/flag/setting> - server option
16 type t = {
17 (* Set of experimental features, in lowercase. *)
18 tco_experimental_features: SSet.t;
19 (* Set of opt-in migration behavior flags, in lowercase. *)
20 tco_migration_flags: SSet.t;
21 (* If set to 0, only the type check delegate's logic will be used.
22 If the delegate fails to type check, the typing check service as a whole
23 will fail. *)
24 tco_num_local_workers: int option;
25 (* If the number of files to type check is fewer than this value, the files
26 will be type checked sequentially (in the master process). Otherwise,
27 the files will be type checked in parallel (in MultiWorker workers). *)
28 tco_parallel_type_checking_threshold: int;
29 (* If set, typechecker workers will quit after they exceed this limit *)
30 tco_max_typechecker_worker_memory_mb: int option;
31 (* If set, defers class declarations after N lazy declarations; if not set,
32 always lazily declares classes not already in cache. *)
33 tco_defer_class_declaration_threshold: int option;
34 (* Whether the Eden prefetch hook should be invoked *)
35 tco_prefetch_deferred_files: bool;
36 (* If set, distributes type checking to remote workers if the number of files to
37 type check exceeds the threshold. If not set, then always checks everything locally. *)
38 tco_remote_type_check_threshold: int;
39 (* Turns on remote type checking *)
40 tco_remote_type_check: bool;
41 (* If set, uses the key to fetch type checking jobs *)
42 tco_remote_worker_key: string option;
43 (* If set, uses the check ID when logging events in the context of remove init/work *)
44 tco_remote_check_id: string option;
45 (* The max batch size that a remote worker can receive to type check *)
46 tco_remote_max_batch_size: int;
47 (* The min batch size that a remote worker can receive to type check *)
48 tco_remote_min_batch_size: int;
49 (* Dictates the number of remote type checking workers *)
50 tco_num_remote_workers: int;
51 so_remote_version_specifier: string option;
52 (* Above this threshold of files to check, the remote type checking worker will not use Eden *)
53 so_remote_worker_vfs_checkout_threshold: int;
54 (* Enables the reverse naming table to fall back to SQLite for queries. *)
55 so_naming_sqlite_path: string option;
56 (* Namespace aliasing map *)
57 po_auto_namespace_map: (string * string) list;
58 (* Are we emitting bytecode? *)
59 po_codegen: bool;
60 (* Flag for disabling functions in HHI files with the __PHPStdLib attribute *)
61 po_deregister_php_stdlib: bool;
62 (* Flag to disallow `require`, `require_once` etc as toplevel statements *)
63 po_disallow_toplevel_requires: bool;
64 (* Allows enabling unstable features via the __EnableUnstableFeatures attribute *)
65 po_allow_unstable_features: bool;
66 tco_log_large_fanouts_threshold: int option;
67 (* Print types of size bigger than 1000 after performing a type union. *)
68 tco_log_inference_constraints: bool;
70 * Flag to enable logging of statistics regarding use of language features.
71 * Currently used for lambdas.
73 tco_language_feature_logging: bool;
75 * If non-zero, give up type checking a class or function after this many seconds
77 tco_timeout: int;
79 * Flag to disallow using values that get casted to array keys at runtime;
80 * like bools, floats, or null; as array keys.
82 tco_disallow_invalid_arraykey: bool;
84 * Produces an error if an arguments is passed by reference to dynamically
85 * called function [e.g. $foo(&$bar)].
87 tco_disallow_byref_dynamic_calls: bool;
89 * Produces an error if an arguments is passed by reference in any form
90 * [e.g. foo(&$bar)].
92 tco_disallow_byref_calls: bool;
93 (* Error codes for which we allow HH_FIXMEs in strict mode *)
94 allowed_fixme_codes_strict: ISet.t;
95 (* Initial hh_log_level settings *)
96 log_levels: int SMap.t;
97 (* Flag to disable using lvals as expressions. *)
98 po_disable_lval_as_an_expression: bool;
99 (* Flag to ignore the string in vec<string>[...] *)
100 (* Look up class members lazily from shallow declarations instead of eagerly
101 computing folded declarations representing the entire class type. *)
102 tco_shallow_class_decl: bool;
103 (* Use shallow decl fanout algorithm while remaining to use folded decls
104 for typechecking *)
105 tco_force_shallow_decl_fanout: bool;
106 (* Flag to fetch old decls from remote decl store *)
107 tco_remote_old_decls_no_limit: bool;
108 (* Don't limit amount of remote old decls fetched *)
109 tco_fetch_remote_old_decls: bool;
110 (* Always load hot shallow decls from saved state *)
111 tco_force_load_hot_shallow_decls: bool;
112 (* Populate the member signature heaps.
114 If disabled, instead load lazily from shallow classes. *)
115 tco_populate_member_heaps: bool;
116 (* Skip checks on hierarchy e.g. overrides, require extend, etc.
117 Set to true only for debugging purposes! *)
118 tco_skip_hierarchy_checks: bool;
119 (* Skip checks implemented with TAST visitors.
120 Set to true only for debugging purposes! *)
121 tco_skip_tast_checks: bool;
122 (* Enables like type hints *)
123 tco_like_type_hints: bool;
124 (* Enables union and intersection type hints *)
125 tco_union_intersection_type_hints: bool;
126 (* Enables checking of coeffects *)
127 tco_coeffects: bool;
128 (* Enables checking of coeffects for local operations (not calls) *)
129 tco_coeffects_local: bool;
130 (* Internal (for tests-only): whether any type can appear in a context list
131 * or only types defined in the appropriate Context namespace *)
132 tco_strict_contexts: bool;
133 (* Enables like casts *)
134 tco_like_casts: bool;
135 (* A simpler form of pessimization, only wraps the outermost type in like
136 * if the type is not enforceable *)
137 tco_simple_pessimize: float;
138 (* Enables complex coercion interactions that involve like types *)
139 tco_complex_coercion: bool;
140 (* static check xhp required attribute *)
141 tco_check_xhp_attribute: bool;
142 (* Check redundant generics in return types *)
143 tco_check_redundant_generics: bool;
145 * Flag to produce an error whenever the TAST contains unresolved type variables
147 tco_disallow_unresolved_type_variables: bool;
148 (* Enable class-level where clauses, i.e.
149 class base<T> where T = int {} *)
150 po_enable_class_level_where_clauses: bool;
151 (* Disable legacy soft typehint syntax (@int) and only allow the __Soft attribute. *)
152 po_disable_legacy_soft_typehints: bool;
153 (* Set of error codes disallowed in decl positions *)
154 po_allowed_decl_fixme_codes: ISet.t;
155 (* Enable @ attribute syntax *)
156 po_allow_new_attribute_syntax: bool;
157 (* Perform global inference globally on the code base to infer missing type annotations. *)
158 tco_global_inference: bool;
159 tco_gi_reinfer_types: string list;
160 (** Types we want to remove and replace by inferred types during global inference. *)
161 tco_ordered_solving: bool;
162 (** Whether to solve typing inference constraints using ordered solving or transitive closure. *)
163 (* Enable const static properties *)
164 tco_const_static_props: bool;
165 (* Disable <<...>> attribute syntax *)
166 po_disable_legacy_attribute_syntax: bool;
167 (* Allow <<__Const>> attribute *)
168 tco_const_attribute: bool;
169 (* Statically check default function arguments *)
170 po_const_default_func_args: bool;
171 (* Statically check default lambda arguments. Subset of default_func_args *)
172 po_const_default_lambda_args: bool;
173 (* Flag to disable the error suppression operator *)
174 po_disallow_silence: bool;
175 (* Static properties can be abstract *)
176 po_abstract_static_props: bool;
177 (* Ignore all errors except those that can influence the shape of syntax tree
178 * (skipping post parse error checks) *)
179 po_parser_errors_only: bool;
180 tco_check_attribute_locations: bool;
181 (* Service name for glean connection; default "" to autoselect server *)
182 glean_service: string;
183 (* Hostname for glean connection; default "" to autoselect server *)
184 glean_hostname: string;
185 (* Port number for glean connection; default 0 to autoselect server *)
186 glean_port: int;
187 (* Reponame used for glean connection, default to "www.autocomplete" *)
188 glean_reponame: string;
189 (* Path prefix to use for files relative to the repository root when writing symbol info to JSON *)
190 symbol_write_ownership: bool;
191 (* include fact ownership information, for creating incremental databases. *)
192 symbol_write_root_path: string;
193 (* Path prefix to use for hhi files when writing symbol info to JSON *)
194 symbol_write_hhi_path: string;
195 (* Filepaths to ignore when writing symbol info to JSON, relative to path prefix, eg: root|foo.php *)
196 symbol_write_ignore_paths: string list;
197 (* When set, write indexing data for these filepaths only. Relative to repository root, eg: bar.php for root|bar.php *)
198 symbol_write_index_paths: string list;
199 (* A file which contains a list of Relative_path.t (one per line) to index *)
200 symbol_write_index_paths_file: string option;
201 (* Write the list of Relative_path.t to this file instead of indexing. Useful for sharding *)
202 symbol_write_index_paths_file_output: string option;
203 (* Write symbol indexing data for hhi files *)
204 symbol_write_include_hhi: bool;
205 (* Flag to disallow HH\fun and HH\class_meth in constants and constant initializers *)
206 po_disallow_func_ptrs_in_constants: bool;
207 (* Flag to report an error on php style anonymous functions *)
208 tco_error_php_lambdas: bool;
209 (* Flag to error on using discarded nullable awaitables *)
210 tco_disallow_discarded_nullable_awaitables: bool;
211 (* Enable the new style xhp class.
212 * Old style: class :name {}
213 * New style: xhp class name {}
215 po_enable_xhp_class_modifier: bool;
217 * Flag to disable the old stype xhp element mangling. `<something/>` would otherwise be resolved as `xhp_something`
218 * The new style `xhp class something {}` does not do this style of mangling, thus we need a way to disable it on the
219 * 'lookup side'.
221 po_disable_xhp_element_mangling: bool;
222 (* Disable `children (foo|bar+|pcdata)` declarations as they can be implemented without special syntax *)
223 po_disable_xhp_children_declarations: bool;
224 (* Enable enum class syntax *)
225 po_enable_enum_classes: bool;
226 (* Disable HH_IGNORE_ERROR comments, either raising an error if 1 or treating them as normal comments if 2. *)
227 po_disable_hh_ignore_error: int;
228 (* Enable features used to typecheck systemlib *)
229 tco_is_systemlib: bool;
230 (* Controls if higher-kinded types are supported *)
231 tco_higher_kinded_types: bool;
232 (* Controls if method-call inference is supported *)
233 tco_method_call_inference: bool;
234 (* If set, then positions derived from reason information are tainted, and primary errors
235 * with such positions are flagged
237 tco_report_pos_from_reason: bool;
238 (* Type check this proportion of all files. Default is 1.0.
239 * DO NOT set to any other value except for testing purposes.
241 tco_typecheck_sample_rate: float;
242 (* Experimental implementation of a "sound" dynamic type *)
243 tco_enable_sound_dynamic: bool;
244 (* Disable parsing of fun() and class_meth() *)
245 po_disallow_fun_and_cls_meth_pseudo_funcs: bool;
246 (* Disable parsing of inst_meth() *)
247 po_disallow_inst_meth: bool;
248 (* Enable use of the direct decl parser for parsing type signatures. *)
249 tco_use_direct_decl_parser: bool;
250 (* Enable ifc on the specified list of path prefixes
251 (a list containing the empty string would denote all files,
252 an empty list denotes no files) *)
253 tco_ifc_enabled: string list;
254 (* Enable global write check on the specified list of path prefixes
255 (a list containing the empty string would denote all files,
256 an empty list denotes no files) *)
257 tco_global_write_check_enabled: string list;
258 (* Enable global write check on the spcified set of functions
259 (Empty denotes no functions) *)
260 tco_global_write_check_functions_enabled: SSet.t;
261 (* Enables the enum supertyping extension *)
262 po_enable_enum_supertyping: bool;
263 (* <<__Soft>> T -> ~T *)
264 po_interpret_soft_types_as_like_types: bool;
265 (* Restricts string concatenation and interpolation to arraykeys *)
266 tco_enable_strict_string_concat_interp: bool;
267 (* Ignores unsafe_cast and retains the original type of the expression *)
268 tco_ignore_unsafe_cast: bool;
269 (* Disable parser-based readonly checking *)
270 tco_no_parser_readonly_check: bool;
271 (* Enable expression trees via unstable features flag *)
272 tco_enable_expression_trees: bool;
273 (* Enable unstable feature: modules *)
274 tco_enable_modules: bool;
275 (* Allowed expression tree visitors when not enabled via unstable features flag *)
276 tco_allowed_expression_tree_visitors: string list;
277 (* Use a new error code for math operations: addition, subtraction,
278 division, multiplication, exponentiation *)
279 tco_math_new_code: bool;
280 (* Raise an error when a concrete type constant is overridden by a concrete type constant
281 in a child class. *)
282 tco_typeconst_concrete_concrete_error: bool;
283 (* When the value is 1, raises a 4734 error when an inherited constant comes from a conflicting
284 * hierarchy, but not if the constant is locally defined. When the value is 2, raises a conflict
285 * any time two parents declare concrete constants with the same name, matching HHVM
286 * -vEval.TraitConstantInterfaceBehavior=1 *)
287 tco_enable_strict_const_semantics: int;
288 (* Different levels here raise previously missing well-formedness errors (see Typing_type_wellformedness) *)
289 tco_strict_wellformedness: int;
290 (* meth_caller can only reference public methods *)
291 tco_meth_caller_only_public_visibility: bool;
292 (* Consider `require extends` and `require implements` as ancestors when checking a class *)
293 tco_require_extends_implements_ancestors: bool;
294 (* Emit an error when "==" or "!=" is used to compare values that are incompatible types *)
295 tco_strict_value_equality: bool;
296 (* All member of the __Sealed whitelist should be subclasses*)
297 tco_enforce_sealed_subclasses: bool;
298 (* All classes are implcitly marked <<__SupportDynamicType>> *)
299 tco_everything_sdt: bool;
300 (* All collections and Hack arrays are treated as containing ~T *)
301 tco_pessimise_builtins: bool;
302 (* Raises an error when a classish is declared <<__ConsistentConstruct>> but lacks an
303 * explicit constructor declaration. 0 does not raise, 1 raises for traits, 2 raises
304 * for all classish *)
305 tco_explicit_consistent_constructors: int;
306 (* Raises an error when a class constant is missing a type. 0 does not raise, 1 raises
307 * for abstract class constants, 2 raises for all. *)
308 tco_require_types_class_consts: int;
309 (* Sets the amount of fuel that the type printer can use to display an
310 * individual type. More of a type is printed as the value increases. *)
311 tco_type_printer_fuel: int;
312 tco_log_saved_state_age_and_distance: bool;
313 (* allows saved_state_loader to shell out to hg to find globalrev and timestamp of revisions *)
314 tco_specify_manifold_api_key: bool;
315 tco_saved_state_manifold_api_key: string option;
316 (* Measures and reports the time it takes to typecheck each top-level
317 definition. *)
318 tco_profile_top_level_definitions: bool;
319 tco_allow_all_files_for_module_declarations: bool;
320 tco_allowed_files_for_module_declarations: string list;
321 tco_use_manifold_cython_client: bool;
322 (* If enabled, the type checker records more fine-grained dependencies than usual,
323 for example between individual methods. *)
324 tco_record_fine_grained_dependencies: bool;
325 (* When set, uses the given number of iterations while typechecking loops *)
326 tco_loop_iteration_upper_bound: int option;
327 (* When enabled, wrap function types in Expression Trees in user defined virtual function types *)
328 tco_expression_tree_virtualize_functions: bool;
329 (* When set, mutates generic entities by substituting type parameters and
330 typechecks the mutated program *)
331 tco_substitution_mutation: bool;
332 tco_use_type_alias_heap: bool;
334 [@@deriving eq, show]
336 val make :
337 ?po_deregister_php_stdlib:bool ->
338 ?po_disallow_toplevel_requires:bool ->
339 ?tco_log_large_fanouts_threshold:int ->
340 ?tco_log_inference_constraints:bool ->
341 ?tco_experimental_features:SSet.t ->
342 ?tco_migration_flags:SSet.t ->
343 ?tco_num_local_workers:int ->
344 ?tco_parallel_type_checking_threshold:int ->
345 ?tco_max_typechecker_worker_memory_mb:int ->
346 ?tco_defer_class_declaration_threshold:int ->
347 ?tco_prefetch_deferred_files:bool ->
348 ?tco_remote_type_check_threshold:int ->
349 ?tco_remote_type_check:bool ->
350 ?tco_remote_worker_key:string ->
351 ?tco_remote_check_id:string ->
352 ?tco_remote_max_batch_size:int ->
353 ?tco_remote_min_batch_size:int ->
354 ?tco_num_remote_workers:int ->
355 ?so_remote_version_specifier:string ->
356 ?so_remote_worker_vfs_checkout_threshold:int ->
357 ?so_naming_sqlite_path:string ->
358 ?po_auto_namespace_map:(string * string) list ->
359 ?tco_language_feature_logging:bool ->
360 ?tco_timeout:int ->
361 ?tco_disallow_invalid_arraykey:bool ->
362 ?tco_disallow_byref_dynamic_calls:bool ->
363 ?tco_disallow_byref_calls:bool ->
364 ?allowed_fixme_codes_strict:ISet.t ->
365 ?log_levels:int SMap.t ->
366 ?po_disable_lval_as_an_expression:bool ->
367 ?tco_shallow_class_decl:bool ->
368 ?tco_force_shallow_decl_fanout:bool ->
369 ?tco_remote_old_decls_no_limit:bool ->
370 ?tco_fetch_remote_old_decls:bool ->
371 ?tco_force_load_hot_shallow_decls:bool ->
372 ?tco_populate_member_heaps:bool ->
373 ?tco_skip_hierarchy_checks:bool ->
374 ?tco_skip_tast_checks:bool ->
375 ?tco_like_type_hints:bool ->
376 ?tco_union_intersection_type_hints:bool ->
377 ?tco_coeffects:bool ->
378 ?tco_coeffects_local:bool ->
379 ?tco_strict_contexts:bool ->
380 ?tco_like_casts:bool ->
381 ?tco_simple_pessimize:float ->
382 ?tco_complex_coercion:bool ->
383 ?tco_check_xhp_attribute:bool ->
384 ?tco_check_redundant_generics:bool ->
385 ?tco_disallow_unresolved_type_variables:bool ->
386 ?po_enable_class_level_where_clauses:bool ->
387 ?po_disable_legacy_soft_typehints:bool ->
388 ?po_allowed_decl_fixme_codes:ISet.t ->
389 ?po_allow_new_attribute_syntax:bool ->
390 ?tco_global_inference:bool ->
391 ?tco_gi_reinfer_types:string list ->
392 ?tco_ordered_solving:bool ->
393 ?tco_const_static_props:bool ->
394 ?po_disable_legacy_attribute_syntax:bool ->
395 ?tco_const_attribute:bool ->
396 ?po_const_default_func_args:bool ->
397 ?po_const_default_lambda_args:bool ->
398 ?po_disallow_silence:bool ->
399 ?po_abstract_static_props:bool ->
400 ?po_parser_errors_only:bool ->
401 ?tco_check_attribute_locations:bool ->
402 ?glean_service:string ->
403 ?glean_hostname:string ->
404 ?glean_port:int ->
405 ?glean_reponame:string ->
406 ?symbol_write_ownership:bool ->
407 ?symbol_write_root_path:string ->
408 ?symbol_write_hhi_path:string ->
409 ?symbol_write_ignore_paths:string list ->
410 ?symbol_write_index_paths:string list ->
411 ?symbol_write_index_paths_file:string ->
412 ?symbol_write_index_paths_file_output:string ->
413 ?symbol_write_include_hhi:bool ->
414 ?po_disallow_func_ptrs_in_constants:bool ->
415 ?tco_error_php_lambdas:bool ->
416 ?tco_disallow_discarded_nullable_awaitables:bool ->
417 ?po_enable_xhp_class_modifier:bool ->
418 ?po_disable_xhp_element_mangling:bool ->
419 ?po_disable_xhp_children_declarations:bool ->
420 ?po_enable_enum_classes:bool ->
421 ?po_disable_hh_ignore_error:int ->
422 ?po_allow_unstable_features:bool ->
423 ?tco_is_systemlib:bool ->
424 ?tco_higher_kinded_types:bool ->
425 ?tco_method_call_inference:bool ->
426 ?tco_report_pos_from_reason:bool ->
427 ?tco_typecheck_sample_rate:float ->
428 ?tco_enable_sound_dynamic:bool ->
429 ?po_disallow_fun_and_cls_meth_pseudo_funcs:bool ->
430 ?po_disallow_inst_meth:bool ->
431 ?tco_use_direct_decl_parser:bool ->
432 ?tco_ifc_enabled:string list ->
433 ?tco_global_write_check_enabled:string list ->
434 ?tco_global_write_check_functions_enabled:SSet.t ->
435 ?po_enable_enum_supertyping:bool ->
436 ?po_interpret_soft_types_as_like_types:bool ->
437 ?tco_enable_strict_string_concat_interp:bool ->
438 ?tco_ignore_unsafe_cast:bool ->
439 ?tco_no_parser_readonly_check:bool ->
440 ?tco_enable_expression_trees:bool ->
441 ?tco_enable_modules:bool ->
442 ?tco_allowed_expression_tree_visitors:string list ->
443 ?tco_math_new_code:bool ->
444 ?tco_typeconst_concrete_concrete_error:bool ->
445 ?tco_enable_strict_const_semantics:int ->
446 ?tco_strict_wellformedness:int ->
447 ?tco_meth_caller_only_public_visibility:bool ->
448 ?tco_require_extends_implements_ancestors:bool ->
449 ?tco_strict_value_equality:bool ->
450 ?tco_enforce_sealed_subclasses:bool ->
451 ?tco_everything_sdt:bool ->
452 ?tco_pessimise_builtins:bool ->
453 ?tco_explicit_consistent_constructors:int ->
454 ?tco_require_types_class_consts:int ->
455 ?tco_type_printer_fuel:int ->
456 ?tco_log_saved_state_age_and_distance:bool ->
457 ?tco_specify_manifold_api_key:bool ->
458 ?tco_saved_state_manifold_api_key:string option ->
459 ?tco_profile_top_level_definitions:bool ->
460 ?tco_allow_all_files_for_module_declarations:bool ->
461 ?tco_allowed_files_for_module_declarations:string list ->
462 ?tco_use_manifold_cython_client:bool ->
463 ?tco_record_fine_grained_dependencies:bool ->
464 ?tco_loop_iteration_upper_bound:int option ->
465 ?tco_expression_tree_virtualize_functions:bool ->
466 ?tco_substitution_mutation:bool ->
467 ?tco_use_type_alias_heap:bool ->
468 unit ->
471 val default : t
473 (* NOTE: set/getters for tco_* options moved to TypecheckerOptions *)
474 (* NOTE: set/getters for po_* options moved to ParserOptions *)
476 val so_remote_version_specifier : t -> string option
478 val so_remote_worker_vfs_checkout_threshold : t -> int
480 val so_naming_sqlite_path : t -> string option
482 val allowed_fixme_codes_strict : t -> ISet.t
484 (* NOTE: set/getters for tco_* options moved to TypecheckerOptions *)
485 (* NOTE: set/getters for po_* options moved to ParserOptions *)