Remove dependency between hh_single_compile_cpp and ocaml_ffi_mock
commitfb10443e746ffe177bda133fe5b2c68c8e30727f
authorJake Bailey (Hacklang) <jakebailey@fb.com>
Wed, 17 Nov 2021 22:08:57 +0000 (17 14:08 -0800)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Wed, 17 Nov 2021 22:10:50 +0000 (17 14:10 -0800)
tree4499919af9c4c6fc433b03734b4696704399ca04
parent9d2e314d42159ffdb24e2c02fbfa0551765d035b
Remove dependency between hh_single_compile_cpp and ocaml_ffi_mock

Summary:
AFAIK, ocaml_ffi_mock is always a hackaround for a problem we could solve in a more principled way. A rust_binary or cpp_binary target should really never need to depend on ocaml_ffi_mock--it could just refrain from depending on targets that want to link to the OCaml runtime in the first place. The usual culprit for a dependency on the OCaml runtime in our code is `ocamlrep_ocamlpool` (which is explicitly for exposing OCaml FFIs, so it's appropriate for that library to link to the runtime). If we keep our OCaml FFIs in isolated targets, then we should be able to write Rust or C++ binaries without needing ocaml_ffi_mock.

In this case, hh_single_compile_cpp depends on a bunch of targets that list ocaml_ffi_mock as a test dependency for no reason that I can discern, and one target that lists ocaml_ffi_mock as a dependency because it uses ocamlrep_ocamlpool (rust_facts_ffi). We can just avoid depending on the OCaml FFI for facts altogether, and remove the unnecessary ocaml_ffi_mock test dependency from all targets that don't need it.

Reviewed By: shayne-fletcher

Differential Revision: D32467946

fbshipit-source-id: c8b68408c744748df595432ada9f8a9430acd93a
hphp/hack/Cargo.lock
hphp/hack/src/facts/rust_facts_ffi/rust_facts_ffi.rs
hphp/hack/src/hhbc/ffi_bridge/Cargo.toml
hphp/hack/src/hhbc/ffi_bridge/rust_compile_ffi_bridge.rs
hphp/hack/src/parser/bench/build.rs [deleted file]