Browse Source

ci: unset compile time vsn in dev profiles

Before this commit source had been compiling with inconsistent
`erl_opts` under test profile with `PROFILE` env set to `emqx`.

```
{compile_info,[{emqx_vsn,"5.0.0-beta.5-g948d4170"}]},
{d,'EMQX_RELEASE_EDITION',ce},
```

Instead stop passing `emqx_vsn` through compile options as is
expected by `emqx_release:version/0`.
Andrew Mayorov 3 years ago
parent
commit
aece9fb96f
1 changed files with 7 additions and 8 deletions
  1. 7 8
      rebar.config.erl

+ 7 - 8
rebar.config.erl

@@ -119,7 +119,7 @@ is_win32() ->
     win32 =:= element(1, os:type()).
 
 project_app_dirs() ->
-    project_app_dirs(get_edition_from_profille_env()).
+    project_app_dirs(get_edition_from_profile_env()).
 
 project_app_dirs(Edition) ->
     ["apps/*"] ++
@@ -154,14 +154,14 @@ test_deps() ->
         {erl_csv, "0.2.0"}
     ].
 
-common_compile_opts(Vsn) ->
-    common_compile_opts(get_edition_from_profille_env(), Vsn).
+common_compile_opts() ->
+    common_compile_opts(get_edition_from_profile_env(), undefined).
 
 common_compile_opts(Edition, Vsn) ->
     % always include debug_info
     [
         debug_info,
-        {compile_info, [{emqx_vsn, Vsn}]},
+        {compile_info, [{emqx_vsn, Vsn} || Vsn /= undefined]},
         {d, 'EMQX_RELEASE_EDITION', Edition}
     ] ++
         [{d, 'EMQX_BENCHMARK'} || os:getenv("EMQX_BENCHMARK") =:= "1"] ++
@@ -180,7 +180,7 @@ warn_profile_env() ->
     end.
 
 %% this function is only used for test/check profiles
-get_edition_from_profille_env() ->
+get_edition_from_profile_env() ->
     case os:getenv("PROFILE") of
         "emqx-enterprise" ++ _ ->
             ee;
@@ -243,15 +243,14 @@ profiles_ee() ->
 
 %% EE has more files than CE, always test/check with EE options.
 profiles_dev() ->
-    Vsn = get_vsn('emqx-enterprise'),
     [
         {check, [
-            {erl_opts, common_compile_opts(Vsn)},
+            {erl_opts, common_compile_opts()},
             {project_app_dirs, project_app_dirs()}
         ]},
         {test, [
             {deps, test_deps()},
-            {erl_opts, common_compile_opts(Vsn) ++ erl_opts_i()},
+            {erl_opts, common_compile_opts() ++ erl_opts_i()},
             {extra_src_dirs, [{"test", [{recursive, true}]}]},
             {project_app_dirs, project_app_dirs()}
         ]}