accept --root, --naming-table
commit6fdb59bc14ecb7765f038ac2bf0ed16f0a527a31
authorLucian Wischik <ljw@fb.com>
Fri, 15 Jan 2021 20:22:46 +0000 (15 12:22 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 15 Jan 2021 20:25:34 +0000 (15 12:25 -0800)
tree1b3ec9ce5d872ba5c5b291915d91e1ac691a1ed1
parent7dcab6e0ea740743834421cb67b6f097bcc2c29a
accept --root, --naming-table

Summary:
## Background and rationale
At the moment we have these tools:
* hh_single_type_check -- works only on self-contained test cases; provides per-file typechecking of such files, and lots of other valuable per-file debugging/diagnostics
* hh_lite -- works on www; provides per-file typechecking of individual files
* hh_server -- works on www; provides whole-www typechecking, and also a variety of other per-file ad-hoc utilities/debugging/diagnostics

I think it is useful for hh_single_type_check to provide its existing valuable per-file debugging/diagnostics but upon files in WWW. That means we can get value out of it without first having to extract a standalone test case.

Scenario: I'm currently porting linearizations to Rust. I want to test whether my rust implementation is identical to the existing ocaml implementation. The existing ocaml implementation can be tested on a standalone test case with "hh_single_type_check --mro <file>".

But I really want to test whether my rust implementation is identical on all the cases in WWW. That's because the inheritance hierarchies in WWW are vastly more complex than anything I'll ever hope to achieve in a test case.

The best way to do this is if "hh_single_type_check --mro" could print linerizations of files within WWW, not just self-contained files.

(I actually already implemented the alternative, which is giving hh_server the debugging power to print the linearization for an arbitrary type. I wrote a diffstack for "hh_client --mro" which sends an RPC request to hh_server, and I made hh_server able to handle this. But it felt quite wrong to be adding such debugging routines into our production hh_server when they're already done perfectly well inside hh_single_type_check).

Reviewed By: Wilfred

Differential Revision: D25891753

fbshipit-source-id: f8945f669e36d38becb89d02769cbb1a24ac14ed
hphp/hack/src/hh_single_type_check.ml
hphp/hack/src/server/serverConfig.mli