only print hh.conf once, plus bugfix
[hiphop-php.git] / hphp / hack / src / server / serverLocalConfig.ml
blob9549561c8ead50ec0c2ebd92f9e7b99694aa32a4
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 open Config_file.Getters
11 module Hack_bucket = Bucket
12 open Hh_prelude
13 open Option.Monad_infix
14 module Bucket = Hack_bucket
16 module Watchman = struct
17 type t = {
18 (* use_watchman *)
19 enabled: bool;
20 (* in seconds *)
21 debug_logging: bool;
22 init_timeout: int;
23 sockname: string option;
24 subscribe: bool;
25 (* in seconds *)
26 synchronous_timeout: int;
29 let default =
31 debug_logging = false;
32 enabled = false;
33 (* buck and hgwatchman use a 10 second timeout, too *)
34 init_timeout = 10;
35 sockname = None;
36 subscribe = false;
37 synchronous_timeout = 120;
40 let load ~current_version ~default config =
41 let use_watchman =
42 bool_if_min_version
43 "use_watchman"
44 ~default:default.enabled
45 ~current_version
46 config
48 let enabled =
49 bool_if_min_version
50 "watchman_enabled"
51 ~default:use_watchman
52 ~current_version
53 config
55 let init_timeout =
56 int_ "watchman_init_timeout" ~default:default.init_timeout config
58 let sockname = string_opt "watchman_sockname" config in
59 let subscribe =
60 bool_if_min_version
61 "watchman_subscribe_v2"
62 ~default:default.subscribe
63 ~current_version
64 config
66 let synchronous_timeout =
67 int_
68 "watchman_synchronous_timeout"
69 ~default:default.synchronous_timeout
70 config
72 let debug_logging =
73 bool_if_min_version
74 "watchman_debug_logging"
75 ~default:default.debug_logging
76 ~current_version
77 config
80 debug_logging;
81 enabled;
82 init_timeout;
83 sockname;
84 subscribe;
85 synchronous_timeout;
87 end
89 module RemoteTypeCheck = struct
90 type t = {
91 (* Controls the `defer_class_declaration_threshold` setting on the remote worker *)
92 declaration_threshold: int;
93 (* A list of error phases; if, before type checking, errors in these phases
94 are present, then remote type checking will be disabled *)
95 disabled_on_errors: Errors.phase list;
96 (* Enables remote type check *)
97 enabled: bool;
98 (* A non-interactive host is, e.g., a dev host not currently associated with a user,
99 or a host used for non-interactive jobs (e.g., CI) *)
100 enabled_for_noninteractive_hosts: bool;
101 (* Indicates how long to wait between heartbeats (in seconds) *)
102 heartbeat_period: int;
103 load_naming_table_on_full_init: bool;
104 max_batch_size: int;
105 min_batch_size: int;
106 (* Dictates the number of remote type checking workers *)
107 num_workers: int;
108 (* Indicates whether files-to-declare should be fetched by VFS
109 (see `declaration_threshold`) *)
110 prefetch_deferred_files: bool;
111 (* If set, distributes type checking to remote workers if the number of files to
112 type check exceeds the threshold. If not set, then always checks everything locally. *)
113 recheck_threshold: int option;
114 worker_min_log_level: Hh_logger.Level.t;
115 (* Indicates the size of the job below which a virtual file system should
116 be used by the remote worker *)
117 worker_vfs_checkout_threshold: int;
118 (* File system mode used by ArtifactStore *)
119 file_system_mode: ArtifactStore.file_system_mode;
120 (* Max artifact size to use CAS; otherwise use everstore *)
121 max_cas_bytes: int;
122 (* Max artifact size to inline into transport channel *)
123 max_artifact_inline_bytes: int;
124 (* [0.0 - 1.0] ratio that specifies how much portion of the total payload
125 should be used in remote workers initial payload. Default is 0.0 which means
126 one bucket and no special bundling for initial payload *)
127 remote_initial_payload_ratio: float;
130 let default =
132 enabled = false;
133 enabled_for_noninteractive_hosts = false;
134 declaration_threshold = 50;
135 disabled_on_errors = [];
136 (* Indicates how long to wait between heartbeats (in seconds) *)
137 heartbeat_period = 15;
138 load_naming_table_on_full_init = false;
139 max_batch_size = 25_000;
140 min_batch_size = 5_000;
141 num_workers = 4;
142 prefetch_deferred_files = false;
143 recheck_threshold = None;
144 worker_min_log_level = Hh_logger.Level.Info;
145 worker_vfs_checkout_threshold = 10_000;
146 file_system_mode = ArtifactStore.Distributed;
147 max_cas_bytes = 50_000_000;
148 max_artifact_inline_bytes = 2000;
149 remote_initial_payload_ratio = 0.0;
152 let load ~current_version ~default config =
153 let declaration_threshold =
154 int_
155 "remote_type_check_declaration_threshold"
156 ~default:default.declaration_threshold
157 config
160 let file_system_mode =
161 let open ArtifactStore in
162 let file_system_mode =
163 string_
164 "remote_type_check_file_system_mode"
165 ~default:(string_of_file_system_mode Distributed)
166 config
168 match file_system_mode_of_string file_system_mode with
169 | Some mode -> mode
170 | None -> Distributed
173 let max_cas_bytes =
174 int_
175 "remote_type_check_max_cas_bytes"
176 ~default:default.max_cas_bytes
177 config
180 let max_artifact_inline_bytes =
181 int_
182 "remote_type_check_max_artifact_inline_bytes"
183 ~default:default.max_artifact_inline_bytes
184 config
187 let enabled_on_errors =
188 string_list
189 "remote_type_check_enabled_on_errors"
190 ~default:["typing"]
191 config
192 |> List.fold ~init:[] ~f:(fun acc phase ->
193 match Errors.phase_of_string phase with
194 | Some phase -> phase :: acc
195 | None -> acc)
197 let disabled_on_errors =
198 List.filter
199 [Errors.Typing; Errors.Decl; Errors.Parsing; Errors.Init; Errors.Naming]
200 ~f:(fun phase ->
202 (List.exists enabled_on_errors ~f:(fun enabled_phase ->
203 Errors.equal_phase enabled_phase phase)))
205 let heartbeat_period =
206 int_
207 "remote_type_check_heartbeat_period"
208 ~default:default.heartbeat_period
209 config
211 let num_workers =
212 int_ "remote_type_check_num_workers" ~default:default.num_workers config
214 let max_batch_size =
215 int_
216 "remote_type_check_max_batch_size"
217 ~default:default.max_batch_size
218 config
220 let min_batch_size =
221 int_
222 "remote_type_check_min_batch_size"
223 ~default:default.min_batch_size
224 config
226 let prefetch_deferred_files =
227 bool_if_min_version
228 "remote_type_check_prefetch_deferred_files"
229 ~default:default.prefetch_deferred_files
230 ~current_version
231 config
233 let recheck_threshold =
234 int_opt "remote_type_check_recheck_threshold" config
236 let remote_initial_payload_ratio =
237 float_
238 "remote_type_check_remote_initial_payload_ratio"
239 ~default:default.remote_initial_payload_ratio
240 config
242 let load_naming_table_on_full_init =
243 bool_if_min_version
244 "remote_type_check_load_naming_table_on_full_init"
245 ~default:default.load_naming_table_on_full_init
246 ~current_version
247 config
249 let enabled =
250 bool_if_min_version
251 "remote_type_check_enabled"
252 ~default:default.enabled
253 ~current_version
254 config
256 let enabled_for_noninteractive_hosts =
257 bool_if_min_version
258 "remote_type_check_enabled_for_noninteractive_hosts"
259 ~default:default.enabled_for_noninteractive_hosts
260 ~current_version
261 config
263 let worker_min_log_level =
264 match
265 Hh_logger.Level.of_enum_string
266 (String.lowercase
267 (string_
268 "remote_type_check_worker_min_log_level"
269 ~default:
270 (Hh_logger.Level.to_enum_string default.worker_min_log_level)
271 config))
272 with
273 | Some level -> level
274 | None -> Hh_logger.Level.Debug
276 let worker_vfs_checkout_threshold =
277 int_
278 "remote_type_check_worker_vfs_checkout_threshold"
279 ~default:default.worker_vfs_checkout_threshold
280 config
283 declaration_threshold;
284 disabled_on_errors;
285 enabled;
286 enabled_for_noninteractive_hosts;
287 heartbeat_period;
288 load_naming_table_on_full_init;
289 max_batch_size;
290 min_batch_size;
291 num_workers;
292 prefetch_deferred_files;
293 recheck_threshold;
294 worker_min_log_level;
295 worker_vfs_checkout_threshold;
296 file_system_mode;
297 max_cas_bytes;
298 max_artifact_inline_bytes;
299 remote_initial_payload_ratio;
303 module RecheckCapture = struct
304 type t = {
305 (* Enables recheck environment capture *)
306 enabled: bool;
307 (* If the error theshold is not met, then the recheck environment that
308 doesn't meet the fanout-related thresholds will not be captured. *)
309 error_threshold: int;
310 (* We will automatically capture the recheck environment if
311 the number of files to recheck exceeds this threshold.
312 The number of rechecked files is always less than or equal to
313 the fanout *)
314 fanout_threshold: int;
315 (* We will automatically capture the recheck environment if
316 the number of rechecked files exceeds this threshold *)
317 rechecked_files_threshold: int;
318 (* If set, determines the rate of sampling of rechecks regardless of
319 their fanout size. The error threshold would still apply.
320 NOTE: valid values fall between 0.0 (0%) and 1.0 (100%).
321 Values less than 0.0 will be interpreted as 0.0; values greater than
322 1.0 will be interpreted as 1.0 *)
323 sample_threshold: float;
326 let default =
328 enabled = false;
329 (* We wouldn't capture small rechecks unless they have at least
330 this many errors. *)
331 error_threshold = 1;
332 (* If capturing is enabled and the recheck fanout (pre-type-check)
333 meets this threshold, then we would snapshot the changed files. *)
334 fanout_threshold = 40_000;
335 (* If the number of files actually rechecked meets this threshold
336 and we already snapshotted the changed files based on fanout
337 size or sampling, we would capture the recheck environment. *)
338 rechecked_files_threshold = 5_000;
339 (* We wouldn't take changed files snapshots of small fanouts
340 unless they are randomly selected with the probability controlled
341 by the sample_threshold setting. By default, we don't snapshot
342 any small fanouts. *)
343 sample_threshold = 0.0;
346 let load ~current_version ~default config =
347 let enabled =
348 bool_if_min_version
349 "recheck_capture_enabled"
350 ~default:default.enabled
351 ~current_version
352 config
354 let error_threshold =
355 int_
356 "recheck_capture_error_threshold"
357 ~default:default.error_threshold
358 config
360 let fanout_threshold =
361 int_
362 "recheck_capture_fanout_threshold"
363 ~default:default.fanout_threshold
364 config
366 let rechecked_files_threshold =
367 int_
368 "recheck_capture_rechecked_files_threshold"
369 ~default:default.rechecked_files_threshold
370 config
372 let sample_threshold =
373 let sample_threshold =
374 float_
375 "recheck_capture_sample_threshold"
376 ~default:default.sample_threshold
377 config
379 if Float.(sample_threshold > 1.0) then
381 else if Float.(sample_threshold < 0.0) then
383 else
384 sample_threshold
387 enabled;
388 error_threshold;
389 fanout_threshold;
390 rechecked_files_threshold;
391 sample_threshold;
395 (** Allows to typecheck only a certain quantile of the workload. *)
396 type quantile = {
397 count: int;
398 (** The number of quantiles we want.
399 If this is n, we'll divide the workload in n groups. *)
400 index: int;
401 (** The index of the subgroup we'll process.
402 If this is i, we'll typecheck group number i out of the n groups.
403 this should be in interval [0; n] *)
406 type t = {
407 min_log_level: Hh_logger.Level.t;
408 attempt_fix_credentials: bool;
409 (** Indicates whether we attempt to fix the credentials if they're broken *)
410 log_categories: string list;
411 experiments: string list;
412 (** the list of experiments from the experiments config *)
413 experiments_config_meta: string; (** a free-form diagnostic string *)
414 use_saved_state: bool;
415 (** should we attempt to load saved-state? (subject to further options) *)
416 require_saved_state: bool;
417 (** if attempting saved-state, should we fail upon failure? *)
418 load_state_natively: bool;
419 (** make hh_server query and download saved state. *)
420 load_state_natively_64bit: bool; (** TODO(hverr): Clean up 32-bit *)
421 no_load_64bit: bool;
422 (** if doing a full init, do it in 64-bit mode
423 TODO(hverr): Clean up 32-bit *)
424 load_state_natively_download_timeout: int; (** in seconds *)
425 load_state_natively_dirty_files_timeout: int; (** in seconds *)
426 type_decl_bucket_size: int;
427 extend_fast_bucket_size: int;
428 enable_on_nfs: bool;
429 enable_fuzzy_search: bool;
430 lazy_parse: bool;
431 lazy_init: bool;
432 max_purgatory_clients: int;
433 (** Monitor: Limit the number of clients that can sit in purgatory waiting
434 for a server to be started because we don't want this to grow unbounded. *)
435 search_chunk_size: int;
436 io_priority: int;
437 cpu_priority: int;
438 can_skip_deptable: bool;
439 (** TODO(hverr): Remove can_skip_deptable, 32-bit clean up *)
440 shm_dirs: string list;
441 shm_use_sharded_hashtbl: bool;
442 shm_enable_eviction: bool;
443 shm_max_evictable_bytes: int;
444 max_workers: int option;
445 max_bucket_size: int;
446 (** max_bucket_size is the default bucket size for ALL users of MultiWorker unless they provide a specific override max_size *)
447 use_dummy_informant: bool; (** See HhMonitorInformant. *)
448 informant_min_distance_restart: int;
449 use_full_fidelity_parser: bool;
450 interrupt_on_watchman: bool;
451 interrupt_on_client: bool;
452 trace_parsing: bool;
453 prechecked_files: bool;
454 enable_type_check_filter_files: bool;
455 (** Let the user configure which files to type check and
456 which files to ignore. This flag is not expected to be
457 rolled out broadly, rather it is meant to be used by
458 power users only. *)
459 re_worker: bool;
460 ide_serverless: bool; (** whether clientLsp should use serverless-ide *)
461 ide_ranked_autocomplete: bool;
462 (** whether clientLsp should use ranked autocomplete *)
463 ide_ffp_autocomplete: bool;
464 (** whether clientLsp should use ffp-autocomplete *)
465 ide_max_num_decls: int; (** tuning of clientIdeDaemon local cache *)
466 ide_max_num_shallow_decls: int; (** tuning of clientIdeDaemon local cache *)
467 ide_max_num_linearizations: int; (** tuning of clientIdeDaemon local cache *)
468 ide_symbolindex_search_provider: string;
469 (** like [symbolindex_search_provider] but for IDE *)
470 predeclare_ide: bool;
471 max_typechecker_worker_memory_mb: int option;
472 longlived_workers: bool;
473 remote_execution: bool;
474 hg_aware: bool;
475 hg_aware_parsing_restart_threshold: int;
476 hg_aware_redecl_restart_threshold: int;
477 hg_aware_recheck_restart_threshold: int;
478 force_remote_type_check: bool; (** forces Hulk *)
479 ide_parser_cache: bool;
480 store_decls_in_saved_state: bool;
481 (** When enabled, save hot class declarations (for now, specified in a special
482 file in the repository) when generating a saved state. *)
483 load_decls_from_saved_state: bool;
484 (** When enabled, load class declarations stored in the saved state, if any, on
485 server init. *)
486 idle_gc_slice: int;
487 (** Size of Gc.major_slice to be performed when server is idle. 0 to disable *)
488 shallow_class_decl: bool;
489 (** Look up class members lazily from shallow declarations instead of eagerly
490 computing folded declarations representing the entire class type. *)
491 force_shallow_decl_fanout: bool;
492 (** Use fanout algorithm based solely on shallow decl comparison. This is the
493 default in shallow decl mode. Use this option if using folded decls. *)
494 force_load_hot_shallow_decls: bool;
495 (** Always load hot shallow decls from saved state. *)
496 fetch_remote_old_decls: bool;
497 (** Option to fetch old decls from remote decl store *)
498 use_hack_64_naming_table: bool;
499 (** Load naming table from hack/64 saved state. *)
500 skip_hierarchy_checks: bool;
501 (** Skip checks on hierarchy e.g. overrides, require extend, etc.
502 Set to true only for debugging purposes! *)
503 num_local_workers: int option;
504 (** If None, only the type check delegate's logic will be used.
505 If the delegate fails to type check, the typing check service as a whole
506 will fail. *)
507 parallel_type_checking_threshold: int;
508 (** If the number of files to type check is fewer than this value, the files
509 will be type checked sequentially (in the master process). Otherwise,
510 the files will be type checked in parallel (in MultiWorker workers). *)
511 defer_class_declaration_threshold: int option;
512 (** If set, defers class declarations after N lazy declarations; if not set,
513 always lazily declares classes not already in cache. *)
514 defer_class_memory_mb_threshold: int option;
515 (** If set, defers class declaration if worker memory exceeds threshold. *)
516 prefetch_deferred_files: bool;
517 (** The whether to use the hook that prefetches files on an Eden checkout *)
518 recheck_capture: RecheckCapture.t;
519 (** Settings controlling how and whether we capture the recheck environment *)
520 recli_version: string;
521 (** The version of the Remote Execution CLI tool to use *)
522 remote_nonce: Int64.t;
523 (** The unique identifier of a particular remote typechecking run *)
524 remote_type_check: RemoteTypeCheck.t;
525 (** Remote type check settings that can be changed, e.g., by GK *)
526 remote_worker_key: string option;
527 (** If set, uses the key to fetch type checking jobs *)
528 remote_check_id: string option;
529 (** If set, uses the check ID when logging events in the context of remove init/work *)
530 remote_version_specifier_required: bool;
531 (** Indicates whether the remote version specifier is required for remote type check from non-prod server *)
532 remote_version_specifier: string option;
533 (** The version of the package the remote worker is to install *)
534 remote_transport_channel: string option;
535 (** Name of the transport channel used by remote type checking. TODO: move into remote_type_check. *)
536 naming_sqlite_path: string option;
537 (** Enables the reverse naming table to fall back to SQLite for queries. *)
538 enable_naming_table_fallback: bool;
539 symbolindex_search_provider: string;
540 (** Selects a search provider for autocomplete and symbol search; see also [ide_symbolindex_search_provider] *)
541 symbolindex_quiet: bool;
542 symbolindex_file: string option;
543 tico_invalidate_files: bool;
544 (** Allows hh_server to invalidate units in hhvm based on local changes *)
545 tico_invalidate_smart: bool; (** Use finer grain hh_server dependencies *)
546 use_direct_decl_parser: bool;
547 (** Enable use of the direct decl parser for parsing type signatures. *)
548 profile_log: bool; (** Log per-file performance information. *)
549 profile_type_check_duration_threshold: float;
550 (** If --profile-log, we'll record telemetry on typechecks that took longer than the threshold (in seconds). In case of profile_type_check_twice we judge by the second type check. *)
551 profile_type_check_memory_threshold_mb: int;
552 (** If --profile-log, we'll record telemetry on any file which allocated more than this many mb on the ocaml heap. In case of profile_type_check_twice we judge by the second type check. *)
553 profile_type_check_twice: bool;
554 (** The flag "--config profile_type_check_twice=true" causes each file to be typechecked twice in succession. If --profile-log then both times are logged. *)
555 profile_decling: Typing_service_types.profile_decling;
556 (** The flag "--config profile_decling=..." says what kind of instrumentation we want for each decl *)
557 profile_owner: string option;
558 (** If --profile-log, we can use "--config profile_owner=<str>" to send an arbitrary "owner" along with the telemetry *)
559 profile_desc: string;
560 (** If --profile-log, we can use "--config profile_desc=<str>" to send an arbitrary "desc" along with telemetry *)
561 go_to_implementation: bool;
562 (** Allows the IDE to show the 'find all implementations' button *)
563 allow_unstable_features: bool;
564 (** Allows unstabled features to be enabled within a file via the '__EnableUnstableFeatures' attribute *)
565 stream_errors: bool;
566 (** Whether to send errors to client as soon as they are discovered. *)
567 watchman: Watchman.t;
568 save_and_upload_naming_table: bool;
569 (** If enabled, saves naming table into a temp folder and uploads it to the remote typechecker *)
570 log_from_client_when_slow_monitor_connections: bool;
571 (** Alerts hh users what processes are using hh_server when hh_client is slow to connect. *)
572 naming_sqlite_in_hack_64: bool;
573 (** Add sqlite naming table to hack/64 ss job *)
574 workload_quantile: quantile option;
575 (** Allows to typecheck only a certain quantile of the workload. *)
576 enable_disk_heap: bool;
577 (** After reading the contents of a file from the filesystem, store them
578 in shared memory. True by default. Disabling this saves memory at the
579 risk of increasing the rate of consistency errors. *)
580 rollout_group: string option;
581 (** A string from hh.conf, written to HackEvengLogger telemetry. Before it got
582 into here, [t], it was first used as a lookup in ServerLocalConfigKnobs.
583 Intended meaning: what class of user is running hh_server, hence what experiments
584 should they be subject to. *)
585 machine_class: string option;
586 (** A string from hh.conf, written to HackEvengLogger telemetry. Before it got
587 into here, [t], it was first used as a lookup in ServerLocalConfigKnobs.
588 Intended meaning: what kind of hardware this machine has, hence what settings
589 for workers should be used. *)
592 let default =
594 min_log_level = Hh_logger.Level.Info;
595 attempt_fix_credentials = false;
596 log_categories = [];
597 experiments = [];
598 experiments_config_meta = "";
599 force_remote_type_check = false;
600 use_saved_state = false;
601 require_saved_state = false;
602 load_state_natively = false;
603 load_state_natively_64bit = false;
604 no_load_64bit = false;
605 load_state_natively_download_timeout = 60;
606 load_state_natively_dirty_files_timeout = 200;
607 type_decl_bucket_size = 1000;
608 extend_fast_bucket_size = 2000;
609 enable_on_nfs = false;
610 enable_fuzzy_search = true;
611 lazy_parse = false;
612 lazy_init = false;
613 max_purgatory_clients = 400;
614 search_chunk_size = 0;
615 io_priority = 7;
616 cpu_priority = 10;
617 can_skip_deptable = true;
618 shm_dirs = [GlobalConfig.shm_dir; GlobalConfig.tmp_dir];
619 shm_use_sharded_hashtbl = false;
620 shm_enable_eviction = false;
621 shm_max_evictable_bytes = 3 * 1024 * 1024 * 1024;
622 max_workers = None;
623 max_bucket_size = Bucket.max_size ();
624 use_dummy_informant = true;
625 informant_min_distance_restart = 100;
626 use_full_fidelity_parser = true;
627 interrupt_on_watchman = false;
628 interrupt_on_client = false;
629 trace_parsing = false;
630 prechecked_files = false;
631 enable_type_check_filter_files = false;
632 re_worker = false;
633 ide_serverless = false;
634 ide_ranked_autocomplete = false;
635 ide_ffp_autocomplete = false;
636 ide_max_num_decls = 5000;
637 ide_max_num_shallow_decls = 10000;
638 ide_max_num_linearizations = 10000;
639 predeclare_ide = false;
640 max_typechecker_worker_memory_mb = None;
641 longlived_workers = false;
642 remote_execution = false;
643 hg_aware = false;
644 hg_aware_parsing_restart_threshold = 0;
645 hg_aware_redecl_restart_threshold = 0;
646 hg_aware_recheck_restart_threshold = 0;
647 ide_parser_cache = false;
648 store_decls_in_saved_state = false;
649 load_decls_from_saved_state = false;
650 idle_gc_slice = 0;
651 shallow_class_decl = false;
652 force_shallow_decl_fanout = false;
653 force_load_hot_shallow_decls = false;
654 fetch_remote_old_decls = false;
655 use_hack_64_naming_table = false;
656 skip_hierarchy_checks = false;
657 num_local_workers = None;
658 parallel_type_checking_threshold = 10;
659 defer_class_declaration_threshold = None;
660 defer_class_memory_mb_threshold = None;
661 prefetch_deferred_files = false;
662 recheck_capture = RecheckCapture.default;
663 recli_version = "STABLE";
664 remote_nonce = Int64.zero;
665 remote_type_check = RemoteTypeCheck.default;
666 remote_worker_key = None;
667 remote_check_id = None;
668 remote_version_specifier_required = true;
669 remote_version_specifier = None;
670 remote_transport_channel = None;
671 naming_sqlite_path = None;
672 enable_naming_table_fallback = false;
673 symbolindex_search_provider = "SqliteIndex";
674 (* the code actually doesn't use this default for ide_symbolindex_search_provider;
675 it defaults to whatever was computed for symbolindex_search_provider. *)
676 ide_symbolindex_search_provider = "SqliteIndex";
677 symbolindex_quiet = false;
678 symbolindex_file = None;
679 tico_invalidate_files = false;
680 tico_invalidate_smart = false;
681 use_direct_decl_parser = false;
682 profile_log = false;
683 profile_type_check_duration_threshold = 0.05;
684 (* seconds *)
685 profile_type_check_memory_threshold_mb = 100;
686 profile_type_check_twice = false;
687 profile_decling = Typing_service_types.DeclingOff;
688 profile_owner = None;
689 profile_desc = "";
690 go_to_implementation = true;
691 allow_unstable_features = false;
692 stream_errors = false;
693 watchman = Watchman.default;
694 save_and_upload_naming_table = false;
695 log_from_client_when_slow_monitor_connections = false;
696 naming_sqlite_in_hack_64 = false;
697 workload_quantile = None;
698 enable_disk_heap = true;
699 rollout_group = None;
700 machine_class = None;
703 let path =
704 let dir =
705 try Sys.getenv "HH_LOCALCONF_PATH" with
706 | _ -> BuildOptions.system_config_path
708 Filename.concat dir "hh.conf"
710 let apply_overrides ~silent ~current_version ~config ~overrides =
711 (* We'll apply CLI overrides now at the start so that JustKnobs and experiments_config
712 can be informed about them, e.g. "--config rollout_group=foo" will be able
713 to guide the manner in which JustKnobs picks up values. Don't worry though --
714 we'll apply CLI overrides again at the end, so they overwrite any changes
715 brought by JustKnobs and experiments_config. *)
716 let config = Config_file.apply_overrides ~from:None ~config ~overrides in
717 (* Now is the time for JustKnobs (though it's skipped for tests) *)
718 let config =
719 if Sys_utils.is_test_mode () then
720 config
721 else
722 ServerLocalConfigKnobs.apply_justknobs_overrides ~silent config
724 (* Now is the time for experiments_config overrides *)
725 let experiments_enabled =
726 bool_if_min_version
727 "experiments_config_enabled"
728 ~default:false
729 ~current_version
730 config
732 let (experiments_meta, config) =
733 if experiments_enabled then begin
734 Disk.mkdir_p GlobalConfig.tmp_dir;
735 let dir =
736 string_ "experiments_config_path" ~default:GlobalConfig.tmp_dir config
738 let owner = Sys_utils.get_primary_owner () in
739 let file =
740 Filename.concat dir (Printf.sprintf "hh.%s.experiments" owner)
742 let update =
743 bool_if_min_version
744 "experiments_config_update"
745 ~default:false
746 ~current_version
747 config
749 let ttl =
750 float_of_int
751 (int_ "experiments_config_ttl_seconds" ~default:86400 config)
753 let source = string_opt "experiments_config_source" config in
754 let meta =
755 if update then
756 match Experiments_config_file.update ~file ~source ~ttl with
757 | Ok meta -> meta
758 | Error message -> message
759 else
760 "Updating experimental config not enabled"
762 if Disk.file_exists file then
763 (* Apply the experiments overrides *)
764 let experiment_overrides = Config_file.parse_local_config file in
765 let config =
766 Config_file.apply_overrides
767 ~from:(Option.some_if (not silent) "Experiment_overrides")
768 ~config
769 ~overrides:experiment_overrides
771 (meta, config)
772 else
773 ("Experimental config not found on disk", config)
774 end else
775 ("Experimental config not enabled", config)
777 (* Finally, reapply the CLI overrides, since they should take
778 precedence over the experiments_config and JustKnobs. *)
779 let config =
780 Config_file.apply_overrides
781 ~from:(Option.some_if (not silent) "--config")
782 ~config
783 ~overrides
785 (experiments_meta, config)
787 let load_ fn ~silent ~current_version overrides =
788 let config = Config_file.parse_local_config fn in
789 let (experiments_config_meta, config) =
790 apply_overrides ~silent ~current_version ~config ~overrides
792 if not silent then begin
793 Printf.eprintf "** Combined config:\n%!";
794 Config_file.print_to_stderr config;
795 Printf.eprintf "\n%!"
796 end;
798 let experiments =
799 string_list "experiments" ~default:default.experiments config
802 let log_categories =
803 string_list "log_categories" ~default:default.log_categories config
805 let min_log_level =
806 match
807 Hh_logger.Level.of_enum_string
808 (String.lowercase
809 (string_
810 "min_log_level"
811 ~default:(Hh_logger.Level.to_enum_string default.min_log_level)
812 config))
813 with
814 | Some level -> level
815 | None -> Hh_logger.Level.Debug
818 let use_saved_state =
819 bool_if_min_version
820 "use_mini_state"
821 ~default:default.use_saved_state
822 ~current_version
823 config
825 let require_saved_state =
826 bool_if_min_version
827 "require_saved_state"
828 ~default:default.require_saved_state
829 ~current_version
830 config
832 let attempt_fix_credentials =
833 bool_if_min_version
834 "attempt_fix_credentials"
835 ~default:default.attempt_fix_credentials
836 ~current_version
837 config
839 let enable_on_nfs =
840 bool_if_min_version
841 "enable_on_nfs"
842 ~default:default.enable_on_nfs
843 ~current_version
844 config
846 let enable_fuzzy_search =
847 bool_if_min_version
848 "enable_fuzzy_search"
849 ~default:default.enable_fuzzy_search
850 ~current_version
851 config
853 let force_remote_type_check =
854 bool_if_min_version
855 "force_remote_type_check"
856 ~default:default.force_remote_type_check
857 ~current_version
858 config
860 let lazy_parse =
861 bool_if_min_version
862 "lazy_parse"
863 ~default:default.lazy_parse
864 ~current_version
865 config
867 let lazy_init =
868 bool_if_min_version
869 "lazy_init2"
870 ~default:default.lazy_init
871 ~current_version
872 config
874 let max_purgatory_clients =
875 int_ "max_purgatory_clients" ~default:default.max_purgatory_clients config
877 let search_chunk_size =
878 int_ "search_chunk_size" ~default:default.search_chunk_size config
880 let load_state_natively =
881 bool_if_min_version
882 "load_state_natively_v4"
883 ~default:default.load_state_natively
884 ~current_version
885 config
887 let load_state_natively_64bit =
888 bool_if_min_version
889 "load_state_natively_64bit"
890 ~default:default.load_state_natively_64bit
891 ~current_version
892 config
894 let no_load_64bit =
895 bool_if_min_version
896 "no_load_64bit"
897 ~default:default.no_load_64bit
898 ~current_version
899 config
901 let load_state_natively_download_timeout =
902 int_
903 "load_state_natively_download_timeout"
904 ~default:default.load_state_natively_download_timeout
905 config
907 let load_state_natively_dirty_files_timeout =
908 int_
909 "load_state_natively_dirty_files_timeout"
910 ~default:default.load_state_natively_dirty_files_timeout
911 config
913 let use_dummy_informant =
914 bool_if_min_version
915 "use_dummy_informant"
916 ~default:default.use_dummy_informant
917 ~current_version
918 config
920 let informant_min_distance_restart =
921 int_
922 "informant_min_distance_restart"
923 ~default:default.informant_min_distance_restart
924 config
926 let type_decl_bucket_size =
927 int_ "type_decl_bucket_size" ~default:default.type_decl_bucket_size config
929 let extend_fast_bucket_size =
930 int_
931 "extend_fast_bucket_size"
932 ~default:default.extend_fast_bucket_size
933 config
935 let io_priority = int_ "io_priority" ~default:default.io_priority config in
936 let cpu_priority = int_ "cpu_priority" ~default:default.cpu_priority config in
937 let can_skip_deptable =
938 bool_if_min_version
939 "can_skip_deptable"
940 ~default:default.can_skip_deptable
941 ~current_version
942 config
944 let shm_dirs =
945 string_list "shm_dirs" ~default:default.shm_dirs config
946 |> List.map ~f:(fun dir -> Path.(to_string @@ make dir))
948 let shm_use_sharded_hashtbl =
949 bool_if_min_version
950 "shm_use_sharded_hashtbl"
951 ~default:default.shm_use_sharded_hashtbl
952 ~current_version
953 config
955 let shm_enable_eviction =
956 bool_if_min_version
957 "shm_enable_eviction"
958 ~default:default.shm_enable_eviction
959 ~current_version
960 config
962 let shm_max_evictable_bytes =
963 int_
964 "shm_max_evictable_bytes"
965 ~default:default.shm_max_evictable_bytes
966 config
968 let max_workers = int_opt "max_workers" config in
969 let max_bucket_size =
970 int_ "max_bucket_size" ~default:default.max_bucket_size config
972 let interrupt_on_watchman =
973 bool_if_min_version
974 "interrupt_on_watchman"
975 ~default:default.interrupt_on_watchman
976 ~current_version
977 config
979 let interrupt_on_client =
980 bool_if_min_version
981 "interrupt_on_client"
982 ~default:default.interrupt_on_client
983 ~current_version
984 config
986 let use_full_fidelity_parser =
987 bool_if_min_version
988 "use_full_fidelity_parser"
989 ~default:default.use_full_fidelity_parser
990 ~current_version
991 config
993 let trace_parsing =
994 bool_if_min_version
995 "trace_parsing"
996 ~default:default.trace_parsing
997 ~current_version
998 config
1000 let prechecked_files =
1001 bool_if_min_version
1002 "prechecked_files"
1003 ~default:default.prechecked_files
1004 ~current_version
1005 config
1007 let enable_type_check_filter_files =
1008 bool_if_min_version
1009 "enable_type_check_filter_files"
1010 ~default:default.enable_type_check_filter_files
1011 ~current_version
1012 config
1014 let re_worker =
1015 bool_if_min_version
1016 "re_worker"
1017 ~default:default.re_worker
1018 ~current_version
1019 config
1021 (* ide_serverless CANNOT use bool_if_min_version, since it's needed before we yet know root/version *)
1022 let ide_serverless =
1023 bool_ "ide_serverless" ~default:default.ide_serverless config
1025 (* ide_ranked_autocomplete CANNOT use bool_if_min_version, since it's needed before we yet know root/version *)
1026 let ide_ranked_autocomplete =
1027 bool_
1028 "ide_ranked_autocomplete"
1029 ~default:default.ide_ranked_autocomplete
1030 config
1032 (* ide_ffp_autocomplete CANNOT use bool_if_min_version, since it's needed before we yet know root/version *)
1033 let ide_ffp_autocomplete =
1034 bool_ "ide_ffp_autocomplete" ~default:default.ide_ffp_autocomplete config
1036 let ide_max_num_decls =
1037 int_ "ide_max_num_decls" ~default:default.ide_max_num_decls config
1039 let ide_max_num_shallow_decls =
1040 int_
1041 "ide_max_num_shallow_decls"
1042 ~default:default.ide_max_num_shallow_decls
1043 config
1045 let ide_max_num_linearizations =
1046 int_
1047 "ide_max_num_linearizations"
1048 ~default:default.ide_max_num_linearizations
1049 config
1051 let predeclare_ide =
1052 bool_if_min_version
1053 "predeclare_ide"
1054 ~default:default.predeclare_ide
1055 ~current_version
1056 config
1058 let max_typechecker_worker_memory_mb =
1059 int_opt "max_typechecker_worker_memory_mb" config
1061 let longlived_workers =
1062 bool_if_min_version
1063 "longlived_workers"
1064 ~default:default.longlived_workers
1065 ~current_version
1066 config
1068 let remote_execution =
1069 bool_if_min_version
1070 "remote_execution"
1071 ~default:default.remote_execution
1072 ~current_version
1073 config
1075 let hg_aware =
1076 bool_if_min_version
1077 "hg_aware"
1078 ~default:default.hg_aware
1079 ~current_version
1080 config
1082 let store_decls_in_saved_state =
1083 bool_if_min_version
1084 "store_decls_in_saved_state"
1085 ~default:default.store_decls_in_saved_state
1086 ~current_version
1087 config
1089 let load_decls_from_saved_state =
1090 bool_if_min_version
1091 "load_decls_from_saved_state"
1092 ~default:default.load_decls_from_saved_state
1093 ~current_version
1094 config
1096 let hg_aware_parsing_restart_threshold =
1097 int_
1098 "hg_aware_parsing_restart_threshold"
1099 ~default:default.hg_aware_parsing_restart_threshold
1100 config
1102 let hg_aware_redecl_restart_threshold =
1103 int_
1104 "hg_aware_redecl_restart_threshold"
1105 ~default:default.hg_aware_redecl_restart_threshold
1106 config
1108 let hg_aware_recheck_restart_threshold =
1109 int_
1110 "hg_aware_recheck_restart_threshold"
1111 ~default:default.hg_aware_recheck_restart_threshold
1112 config
1114 let ide_parser_cache =
1115 bool_if_min_version
1116 "ide_parser_cache"
1117 ~default:default.ide_parser_cache
1118 ~current_version
1119 config
1121 let idle_gc_slice =
1122 int_ "idle_gc_slice" ~default:default.idle_gc_slice config
1124 let shallow_class_decl =
1125 bool_if_min_version
1126 "shallow_class_decl"
1127 ~default:default.shallow_class_decl
1128 ~current_version
1129 config
1131 let force_shallow_decl_fanout =
1132 bool_if_min_version
1133 "force_shallow_decl_fanout"
1134 ~default:default.force_shallow_decl_fanout
1135 ~current_version
1136 config
1138 let force_load_hot_shallow_decls =
1139 bool_if_min_version
1140 "force_load_hot_shallow_decls"
1141 ~default:default.force_load_hot_shallow_decls
1142 ~current_version
1143 config
1145 let fetch_remote_old_decls =
1146 bool_if_min_version
1147 "fetch_remote_old_decls"
1148 ~default:default.fetch_remote_old_decls
1149 ~current_version
1150 config
1152 let use_hack_64_naming_table =
1153 bool_if_min_version
1154 "use_hack_64_naming_table"
1155 ~default:default.use_hack_64_naming_table
1156 ~current_version
1157 config
1159 let skip_hierarchy_checks =
1160 bool_if_min_version
1161 "skip_hierarchy_checks"
1162 ~default:default.skip_hierarchy_checks
1163 ~current_version
1164 config
1166 let parallel_type_checking_threshold =
1167 int_
1168 "parallel_type_checking_threshold"
1169 ~default:default.parallel_type_checking_threshold
1170 config
1172 let num_local_workers = int_opt "num_local_workers" config in
1173 let defer_class_declaration_threshold =
1174 int_opt "defer_class_declaration_threshold" config
1176 let defer_class_memory_mb_threshold =
1177 int_opt "defer_class_memory_mb_threshold" config
1179 let prefetch_deferred_files =
1180 bool_if_min_version
1181 "prefetch_deferred_files"
1182 ~default:false
1183 ~current_version
1184 config
1186 let recheck_capture =
1187 RecheckCapture.load ~current_version ~default:default.recheck_capture config
1189 let remote_nonce =
1190 match string_opt "remote_nonce" config with
1191 | Some n -> Int64.of_string n
1192 | None -> Int64.zero
1194 let remote_type_check =
1195 RemoteTypeCheck.load
1196 ~current_version
1197 ~default:default.remote_type_check
1198 config
1200 let watchman =
1201 Watchman.load ~current_version ~default:default.watchman config
1203 let recli_version =
1204 string_ "recli_version" ~default:default.recli_version config
1206 let remote_worker_key = string_opt "remote_worker_key" config in
1207 let remote_check_id = string_opt "remote_check_id" config in
1208 let remote_version_specifier_required =
1209 bool_if_min_version
1210 "remote_version_specifier_required"
1211 ~default:default.remote_version_specifier_required
1212 ~current_version
1213 config
1215 let remote_version_specifier = string_opt "remote_version_specifier" config in
1216 let remote_transport_channel = string_opt "remote_transport_channel" config in
1217 let enable_naming_table_fallback =
1218 bool_if_min_version
1219 "enable_naming_table_fallback"
1220 ~default:default.enable_naming_table_fallback
1221 ~current_version
1222 config
1224 let naming_sqlite_path =
1225 if enable_naming_table_fallback then
1226 string_opt "naming_sqlite_path" config
1227 else
1228 None
1230 let symbolindex_search_provider =
1231 string_
1232 "symbolindex_search_provider"
1233 ~default:default.symbolindex_search_provider
1234 config
1236 let ide_symbolindex_search_provider =
1237 string_
1238 "ide_symbolindex_search_provider"
1239 ~default:symbolindex_search_provider
1240 config
1242 let symbolindex_quiet =
1243 bool_if_min_version
1244 "symbolindex_quiet"
1245 ~default:default.symbolindex_quiet
1246 ~current_version
1247 config
1249 let symbolindex_file = string_opt "symbolindex_file" config in
1250 let tico_invalidate_files =
1251 bool_if_min_version
1252 "tico_invalidate_files"
1253 ~default:default.tico_invalidate_files
1254 ~current_version
1255 config
1257 let tico_invalidate_smart =
1258 bool_if_min_version
1259 "tico_invalidate_smart"
1260 ~default:default.tico_invalidate_smart
1261 ~current_version
1262 config
1264 let use_direct_decl_parser =
1265 bool_if_min_version
1266 "use_direct_decl_parser"
1267 ~default:default.use_direct_decl_parser
1268 ~current_version
1269 config
1271 let profile_log =
1272 bool_if_min_version
1273 "profile_log"
1274 ~default:default.profile_log
1275 ~current_version
1276 config
1278 let profile_type_check_duration_threshold =
1279 float_
1280 "profile_type_check_duration_threshold"
1281 ~default:default.profile_type_check_duration_threshold
1282 config
1284 let profile_type_check_memory_threshold_mb =
1285 int_
1286 "profile_type_check_memory_threshold_mb"
1287 ~default:default.profile_type_check_memory_threshold_mb
1288 config
1290 let profile_type_check_twice =
1291 bool_if_min_version
1292 "profile_type_check_twice"
1293 ~default:default.profile_type_check_twice
1294 ~current_version
1295 config
1297 let profile_decling =
1298 match string_ "profile_decling" ~default:"off" config with
1299 | "off" -> Typing_service_types.DeclingOff
1300 | "top_counts" -> Typing_service_types.DeclingTopCounts
1301 | "all_telemetry" ->
1302 Typing_service_types.DeclingAllTelemetry { callstacks = false }
1303 | "all_telemetry_callstacks" ->
1304 Typing_service_types.DeclingAllTelemetry { callstacks = true }
1305 | _ ->
1306 failwith
1307 "profile_decling: off | top_counts | all_telemetry | all_telemetry_callstacks"
1309 let profile_owner = string_opt "profile_owner" config in
1310 let profile_desc =
1311 string_ "profile_desc" ~default:default.profile_desc config
1313 let go_to_implementation =
1314 bool_if_min_version
1315 "go_to_implementation"
1316 ~default:default.go_to_implementation
1317 ~current_version
1318 config
1320 let allow_unstable_features =
1321 bool_if_min_version
1322 "allow_unstable_features"
1323 ~default:default.allow_unstable_features
1324 ~current_version
1325 config
1327 let stream_errors =
1328 bool_if_min_version
1329 "stream_errors"
1330 ~default:default.stream_errors
1331 ~current_version
1332 config
1334 let save_and_upload_naming_table =
1335 bool_if_min_version
1336 "save_and_upload_naming_table"
1337 ~default:default.save_and_upload_naming_table
1338 ~current_version
1339 config
1341 let log_from_client_when_slow_monitor_connections =
1342 bool_if_min_version
1343 "log_from_client_when_slow_monitor_connections"
1344 ~default:default.log_from_client_when_slow_monitor_connections
1345 ~current_version
1346 config
1348 let naming_sqlite_in_hack_64 =
1349 bool_if_min_version
1350 "naming_sqlite_in_hack_64"
1351 ~default:default.naming_sqlite_in_hack_64
1352 ~current_version
1353 config
1355 let force_shallow_decl_fanout =
1356 if force_shallow_decl_fanout && not use_direct_decl_parser then (
1357 Hh_logger.warn
1358 "You have force_shallow_decl_fanout=true but use_direct_decl_parser=false. This is incompatible. Turning off force_shallow_decl_fanout";
1359 false
1360 ) else
1361 force_shallow_decl_fanout
1363 let force_load_hot_shallow_decls =
1364 if force_load_hot_shallow_decls && not force_shallow_decl_fanout then (
1365 Hh_logger.warn
1366 "You have force_load_hot_shallow_decls=true but force_shallow_decl_fanout=false. This is incompatible. Turning off force_load_hot_shallow_decls";
1367 false
1368 ) else
1369 force_load_hot_shallow_decls
1371 let fetch_remote_old_decls =
1372 if fetch_remote_old_decls && not force_shallow_decl_fanout then (
1373 Hh_logger.warn
1374 "You have fetch_remote_old_decls=true but force_shallow_decl_fanout=false. This is incompatible. Turning off force_load_hot_shallow_decls";
1375 false
1376 ) else
1377 fetch_remote_old_decls
1379 let workload_quantile =
1380 int_list_opt "workload_quantile" config >>= fun l ->
1381 match l with
1382 | [m; n] ->
1383 if 0 <= m && m <= n then
1384 Some { count = n; index = m }
1385 else if 0 <= n && n <= m then
1386 Some { count = m; index = n }
1387 else
1388 None
1389 | _ -> None
1391 let enable_disk_heap =
1392 bool_if_min_version
1393 "enable_disk_heap"
1394 ~default:default.enable_disk_heap
1395 ~current_version
1396 config
1398 let rollout_group = string_opt "rollout_group" config in
1399 let machine_class = string_opt "machine_class" config in
1401 min_log_level;
1402 attempt_fix_credentials;
1403 log_categories;
1404 experiments;
1405 experiments_config_meta;
1406 use_saved_state;
1407 require_saved_state;
1408 load_state_natively;
1409 load_state_natively_64bit;
1410 no_load_64bit;
1411 load_state_natively_download_timeout;
1412 load_state_natively_dirty_files_timeout;
1413 max_purgatory_clients;
1414 type_decl_bucket_size;
1415 extend_fast_bucket_size;
1416 enable_on_nfs;
1417 enable_fuzzy_search;
1418 lazy_parse;
1419 lazy_init;
1420 search_chunk_size;
1421 io_priority;
1422 cpu_priority;
1423 can_skip_deptable;
1424 shm_dirs;
1425 shm_use_sharded_hashtbl;
1426 shm_enable_eviction;
1427 shm_max_evictable_bytes;
1428 max_workers;
1429 max_bucket_size;
1430 use_dummy_informant;
1431 informant_min_distance_restart;
1432 use_full_fidelity_parser;
1433 interrupt_on_watchman;
1434 interrupt_on_client;
1435 trace_parsing;
1436 prechecked_files;
1437 enable_type_check_filter_files;
1438 re_worker;
1439 ide_serverless;
1440 ide_ranked_autocomplete;
1441 ide_ffp_autocomplete;
1442 ide_max_num_decls;
1443 ide_max_num_shallow_decls;
1444 ide_max_num_linearizations;
1445 ide_symbolindex_search_provider;
1446 predeclare_ide;
1447 max_typechecker_worker_memory_mb;
1448 longlived_workers;
1449 remote_execution;
1450 hg_aware;
1451 hg_aware_parsing_restart_threshold;
1452 hg_aware_redecl_restart_threshold;
1453 hg_aware_recheck_restart_threshold;
1454 ide_parser_cache;
1455 store_decls_in_saved_state;
1456 load_decls_from_saved_state;
1457 idle_gc_slice;
1458 shallow_class_decl;
1459 force_shallow_decl_fanout;
1460 force_load_hot_shallow_decls;
1461 fetch_remote_old_decls;
1462 use_hack_64_naming_table;
1463 skip_hierarchy_checks;
1464 num_local_workers;
1465 parallel_type_checking_threshold;
1466 defer_class_declaration_threshold;
1467 defer_class_memory_mb_threshold;
1468 prefetch_deferred_files;
1469 recheck_capture;
1470 recli_version;
1471 remote_nonce;
1472 remote_type_check;
1473 remote_worker_key;
1474 remote_check_id;
1475 remote_version_specifier_required;
1476 remote_version_specifier;
1477 remote_transport_channel;
1478 naming_sqlite_path;
1479 enable_naming_table_fallback;
1480 symbolindex_search_provider;
1481 symbolindex_quiet;
1482 symbolindex_file;
1483 tico_invalidate_files;
1484 tico_invalidate_smart;
1485 use_direct_decl_parser;
1486 profile_log;
1487 profile_type_check_duration_threshold;
1488 profile_type_check_memory_threshold_mb;
1489 profile_type_check_twice;
1490 profile_decling;
1491 profile_owner;
1492 profile_desc;
1493 go_to_implementation;
1494 allow_unstable_features;
1495 stream_errors;
1496 watchman;
1497 force_remote_type_check;
1498 save_and_upload_naming_table;
1499 log_from_client_when_slow_monitor_connections;
1500 naming_sqlite_in_hack_64;
1501 workload_quantile;
1502 enable_disk_heap;
1503 rollout_group;
1504 machine_class;
1507 (** Loads the config from [path]. Uses JustKnobs and ExperimentsConfig to override.
1508 On top of that, applies [config_overrides]. If [silent] then prints what it's doing
1509 to stderr. *)
1510 let load ~silent ~current_version config_overrides =
1511 load_ path ~silent ~current_version config_overrides
1513 let to_rollout_flags (options : t) : HackEventLogger.rollout_flags =
1514 HackEventLogger.
1516 use_direct_decl_parser = options.use_direct_decl_parser;
1517 longlived_workers = options.longlived_workers;
1518 require_saved_state = options.require_saved_state;
1519 stream_errors = options.stream_errors;
1520 force_shallow_decl_fanout = options.force_shallow_decl_fanout;
1521 log_from_client_when_slow_monitor_connections =
1522 options.log_from_client_when_slow_monitor_connections;
1523 naming_sqlite_in_hack_64 = options.naming_sqlite_in_hack_64;
1524 use_hack_64_naming_table = options.use_hack_64_naming_table;
1525 enable_disk_heap = options.enable_disk_heap;
1526 ide_max_num_decls = options.ide_max_num_decls;
1527 ide_max_num_shallow_decls = options.ide_max_num_shallow_decls;
1528 ide_max_num_linearizations = options.ide_max_num_linearizations;
1529 max_bucket_size = options.max_bucket_size;
1530 max_workers = Option.value options.max_workers ~default:(-1);
1531 max_typechecker_worker_memory_mb =
1532 Option.value options.max_typechecker_worker_memory_mb ~default:(-1);