From 5abec3709858e581ebf120a2d693bf186a854e16 Mon Sep 17 00:00:00 2001 From: k32 <10274441+k32@users.noreply.github.com> Date: Thu, 5 Aug 2021 19:05:49 +0200 Subject: [PATCH] chore(build): Globally set snk_kind macro to msg --- apps/emqx/rebar.config | 2 +- rebar.config | 5 +++-- rebar.config.erl | 11 +++++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/apps/emqx/rebar.config b/apps/emqx/rebar.config index 7b72f12d3..ebe46559b 100644 --- a/apps/emqx/rebar.config +++ b/apps/emqx/rebar.config @@ -18,7 +18,7 @@ , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.11.0"}}} , {pbkdf2, {git, "https://github.com/emqx/erlang-pbkdf2.git", {tag, "2.0.4"}}} , {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}} - , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.13.0"}}} + , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.14.1"}}} ]}. {plugins, [rebar3_proper]}. diff --git a/rebar.config b/rebar.config index 8d1d7c3d7..b59909dbe 100644 --- a/rebar.config +++ b/rebar.config @@ -10,7 +10,8 @@ {edoc_opts, [{preprocess,true}]}. {erl_opts, [warn_unused_vars,warn_shadow_vars,warn_unused_import, warn_obsolete_guard,compressed, nowarn_unused_import, - {d, snk_kind, msg}]}. + {d, snk_kind, msg} + ]}. {xref_checks,[undefined_function_calls,undefined_functions,locals_not_used, deprecated_function_calls,warnings_as_errors,deprecated_functions]}. @@ -59,7 +60,7 @@ , {recon, {git, "https://github.com/ferd/recon", {tag, "2.5.1"}}} , {observer_cli, "1.6.1"} % NOTE: depends on recon 2.5.1 , {getopt, "1.0.2"} - , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.13.0"}}} + , {snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "0.14.1"}}} , {hocon, {git, "https://github.com/emqx/hocon.git", {tag, "0.11.0"}}} , {emqx_http_lib, {git, "https://github.com/emqx/emqx_http_lib.git", {tag, "0.4.0"}}} , {esasl, {git, "https://github.com/emqx/esasl", {tag, "0.1.0"}}} diff --git a/rebar.config.erl b/rebar.config.erl index f97aecb55..fed96cb95 100644 --- a/rebar.config.erl +++ b/rebar.config.erl @@ -52,13 +52,17 @@ overrides() -> [ {add, [ {extra_src_dirs, [{"etc", [{recursive,true}]}]} , {erl_opts, [{compile_info, [{emqx_vsn, get_vsn()}]}]} ]} - , {add, snabbkaffe, - [{erl_opts, common_compile_opts()}]} - ] ++ community_plugin_overrides(). + ] ++ snabbkaffe_overrides() ++ community_plugin_overrides(). community_plugin_overrides() -> [{add, App, [ {erl_opts, [{i, "include"}]}]} || App <- relx_plugin_apps_extra()]. +%% Temporary workaround for a rebar3 erl_opts duplication +%% bug. Ideally, we want to set this define globally +snabbkaffe_overrides() -> + Apps = [snabbkaffe, ekka], + [{add, App, [{erl_opts, [{d, snk_kind, msg}]}]} || App <- Apps]. + config(HasElixir) -> [ {cover_enabled, is_cover_enabled()} , {profiles, profiles()} @@ -132,7 +136,6 @@ common_compile_opts() -> AppNames = app_names(), [ debug_info % alwyas include debug_info , {compile_info, [{emqx_vsn, get_vsn()}]} - , {d, snk_kind, msg} ] ++ [{d, 'EMQX_DEP_APPS', AppNames -- [emqx, emqx_machine]}] ++ [{d, 'EMQX_ENTERPRISE'} || is_enterprise()] ++