(**
 * Copyright (c) 2015, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the "hack" directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 *)

external get_build_revision : unit -> string = "hh_get_build_revision"
external get_build_commit_time : unit -> int = "hh_get_build_commit_time"
external get_build_commit_time_string : unit -> string =
  "hh_get_build_commit_time_string"

let build_revision = get_build_revision ()

let build_id_ohai = build_revision ^ " " ^ get_build_commit_time_string ()

let build_commit_time = get_build_commit_time ()

(* Monotonically increasing identifier that can be used when we introduce
 * backward incompatible changes in hh_client commands *)
let build_api_version = 2

(**
 * Copyright (c) 2015, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the "hack" directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 *)

external get_build_revision : unit -> string = "hh_get_build_revision"
external get_build_commit_time : unit -> int = "hh_get_build_commit_time"
external get_build_commit_time_string : unit -> string =
  "hh_get_build_commit_time_string"

let build_revision = get_build_revision ()

let build_id_ohai = build_revision ^ " " ^ get_build_commit_time_string ()

let build_commit_time = get_build_commit_time ()

(* Monotonically increasing identifier that can be used when we introduce
 * backward incompatible changes in hh_client commands *)
let build_api_version = 3

Split failed_naming set from failed_parsing and update it during lazy incremental check
[hack] Split failed_naming set from failed_parsing and update it during lazy incremental check

Summary:
I though that all the failed_* sets are there just because we always rebuild the full error list from the scratch, so we need to know which files to check to get all the errors. If we are not interested in full error list (as it is in lazy incremental mode), then we can leave those sets out of date (provided that we will recompute them later).

I found one case where this is not correct, since we use failed_naming as kind of a dependency tracking mechanism. If we have a duplicate definition of a class, Hack chooses the one it will use arbitrarily. If we later delete it, we need to choose back to the other one, and recheck everything that depends on it. Both files containing the duplicate class being inside failed_naming is the only place where we track this information.

Note: this is a little bit of giving up on "each keystroke results in parsing/naming only of the file that was edited" principle of lazy incremental mode - if you have duplicate identifiers we will keep reparsing/naming them with each check until you don't fix the ambiguity. I don't feel like adding more complexity to handle this edge case - I doubt it happens often, and parsing/naming are blazingly fast so it doesn't hurt that much.

Reviewed By: dlreeves

Differential Revision: D4024506

fbshipit-source-id: 6fc540a1e7c38ca89361e9c299d040c1908cb7d3
