From 0ccd0576afbca12c1a1633578986ceb618e81e7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Muska=C5=82a?= Date: Thu, 31 Oct 2024 11:25:46 -0700 Subject: [PATCH] Make vendored json into proper target Summary: This changes the vendored json module to be a proper target. This is necessary, since in some places where toolchain applications using json were included in release or otherwise packaged, the json module would be missing. This solves the issue and simplifies internals removing the need to prepend the utility modules path all over the place. This is first part - that we need to sync back before progressing and using the new application for testing Reviewed By: TheGeorge Differential Revision: D65274428 fbshipit-source-id: a92a1dc38cddbaa708093e9a5f8c72c5294b71cb --- prelude/erlang/toolchain/BUCK.v2 | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/prelude/erlang/toolchain/BUCK.v2 b/prelude/erlang/toolchain/BUCK.v2 index 33e43e8e403e..ebeceeecb4e4 100644 --- a/prelude/erlang/toolchain/BUCK.v2 +++ b/prelude/erlang/toolchain/BUCK.v2 @@ -43,3 +43,21 @@ toolchain_utilities( ], visibility = ["PUBLIC"], ) + +# exported for use in shell & test binary, they have a runtime dependency on json +# can be removed once we're on OTP 27 +erlang_application( + name = "toolchain_json", + srcs = ["json.erl"], + applications = [ + "kernel", + "stdlib", + ], + erl_opts = [ + "+deterministic", + "+warnings_as_errors", + ], + shell_libs = [], + use_global_parse_transforms = False, + visibility = ["PUBLIC"], +)