Support arbitrary-layout HHVM options
commitb8e48318294a0ce0735f10422b5b3721a9bb407c
authorLeo Osvald <leoo@fb.com>
Wed, 27 May 2020 04:27:47 +0000 (26 21:27 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 27 May 2020 04:33:03 +0000 (26 21:33 -0700)
treef9027bd1d93fe3e92da88612d05997f49c4d3ba2
parent3329c746586a8f5e98d57fa85557a25a8e3cff2a
Support arbitrary-layout HHVM options

Summary:
HHVM can pass configs with fields of arbitrary layout to HackC
(`hh_single_compile`), and the current Rust JSON deserialization logic expects
only a few listed in `enum GlobalValue`.  Instead of specifying missing ones,
support a dynamic layout via the new `serde_json::value::Value` variant.

This may have a slight perf cost, but it's robust because the code doesn't
need to be updated whenever a new layout (i.e., JSON type) is used by HHVM,
which would also silently brake emitter code otherwise.

Reviewed By: shiqicao

Differential Revision: D21730518

fbshipit-source-id: 3820a6d79395606f533ffca589b4aa9c6cb79293
hphp/hack/src/hhbc/options.rs