From 0f925be7344f8f9e7aa359088614de0531cf3f31 Mon Sep 17 00:00:00 2001 From: Manuel Fahndrich Date: Tue, 15 Sep 2020 13:38:41 -0700 Subject: [PATCH] standalone binary 1/n Reviewed By: zlandau Differential Revision: D23639629 fbshipit-source-id: 8927c2b337a1feebc376c87eb9d08950b1356e36 --- hphp/hack/src/ai/dune | 23 ++++++++++++++++++++++- hphp/hack/src/ai/zoncolan.ml | 10 ++++++++++ hphp/hack/src/dune | 2 +- hphp/hack/src/stubs/ai_init.ml | 10 ++++++++++ hphp/hack/src/stubs/dune | 1 + hphp/hack/test/integration/hh_paths.py | 1 + 6 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 hphp/hack/src/ai/zoncolan.ml create mode 100644 hphp/hack/src/stubs/ai_init.ml diff --git a/hphp/hack/src/ai/dune b/hphp/hack/src/ai/dune index 369f676af65..31a7e6f8165 100644 --- a/hphp/hack/src/ai/dune +++ b/hphp/hack/src/ai/dune @@ -8,6 +8,24 @@ let library_entry name suffix = (modules) (libraries %s_%s))" name name suffix +let executable_entry is_fb name = + if is_fb then + Printf.sprintf + "(executable + (name %s) + (modules %s) + (ocamlc_flags (:standard -custom)) + (link_flags (:standard (:include ../dune_config/ld-opts.sexp))) + (libraries + default_injector_config + %s_fb))" name name name + else + Printf.sprintf + "(executable + (name %s) + (modules %s) + (libraries))" name name + let fb_entry name = library_entry name "fb" @@ -30,4 +48,7 @@ let () = let fb_dune = Filename.concat fb_dir "dune" in let is_fb = Sys.file_exists fb_dune in let ai = entry is_fb "ai" in - Jbuild_plugin.V1.send ai + let ai_options = entry is_fb "ai_options" in + let zoncolan = executable_entry is_fb "zoncolan" in + String.concat "\n" [ai_options; ai; zoncolan] + |> Jbuild_plugin.V1.send diff --git a/hphp/hack/src/ai/zoncolan.ml b/hphp/hack/src/ai/zoncolan.ml new file mode 100644 index 00000000000..4705a160668 --- /dev/null +++ b/hphp/hack/src/ai/zoncolan.ml @@ -0,0 +1,10 @@ +(* + * Copyright (c) 2018, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the "hack" directory of this source tree. + * + *) + +(* Intentionally left blank *) diff --git a/hphp/hack/src/dune b/hphp/hack/src/dune index 704961a9093..9a2f28ef4e5 100644 --- a/hphp/hack/src/dune +++ b/hphp/hack/src/dune @@ -143,6 +143,7 @@ hh_server.exe hh_single_compile.exe hh_single_type_check.exe + ai/zoncolan.exe )) (alias @@ -176,4 +177,3 @@ hh_single_compile.bc hh_single_type_check.bc )) - diff --git a/hphp/hack/src/stubs/ai_init.ml b/hphp/hack/src/stubs/ai_init.ml new file mode 100644 index 00000000000..48daec9215a --- /dev/null +++ b/hphp/hack/src/stubs/ai_init.ml @@ -0,0 +1,10 @@ +(* + * Copyright (c) 2020, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the "hack" directory of this source tree. + * + *) + +(* Intentionally left blank *) diff --git a/hphp/hack/src/stubs/dune b/hphp/hack/src/stubs/dune index 5b5f81f3ebc..226e289319b 100644 --- a/hphp/hack/src/stubs/dune +++ b/hphp/hack/src/stubs/dune @@ -3,6 +3,7 @@ (wrapped false) (modules ai + ai_init ai_options) (libraries errors) diff --git a/hphp/hack/test/integration/hh_paths.py b/hphp/hack/test/integration/hh_paths.py index 97ffa634d43..5d1147a2466 100644 --- a/hphp/hack/test/integration/hh_paths.py +++ b/hphp/hack/test/integration/hh_paths.py @@ -10,3 +10,4 @@ recorder_cat = "recorder_cat" turntable_bin = "turntable_bin" server_driver_bin = "server_driver_bin" watchman_event_watcher = "watchman_event_watcher" +zoncolan = "zoncolan" -- 2.11.4.GIT