Drop crypto app reliance By doing this, we fix two issues at once. First, there's no need to have crypto available anymore. While not having crypto in your Erlang installation is a questionable packaging decision, it tends to happen in the wild with users installing Erlang and missing crypto. Sometimes this is not due to a distro's package but users building Erlang without the needed OpenSSL dependencies. Second, this resolves the Erlang 20 rng deprecation warnings.
Project: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/commit/bb79416b Tree: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/tree/bb79416b Diff: http://git-wip-us.apache.org/repos/asf/couchdb-rebar/diff/bb79416b Branch: refs/heads/master Commit: bb79416b6ef536c1b64876d8c9fe5e596dd1320a Parents: 0dcac8a Author: Tuncer Ayaz <[email protected]> Authored: Fri Aug 18 19:01:54 2017 +0000 Committer: Tuncer Ayaz <[email protected]> Committed: Fri Aug 18 21:44:00 2017 +0000 ---------------------------------------------------------------------- ebin/rebar.app | 1 - rebar.config | 3 ++- src/rebar.erl | 6 ------ src/rebar_ct.erl | 2 +- src/rebar_eunit.erl | 2 +- 5 files changed, 4 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/bb79416b/ebin/rebar.app ---------------------------------------------------------------------- diff --git a/ebin/rebar.app b/ebin/rebar.app index 9449e1e..b4c8b5a 100644 --- a/ebin/rebar.app +++ b/ebin/rebar.app @@ -55,7 +55,6 @@ stdlib, sasl, compiler, - crypto, syntax_tools, tools, eunit, http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/bb79416b/rebar.config ---------------------------------------------------------------------- diff --git a/rebar.config b/rebar.config index eda5a2c..6765415 100644 --- a/rebar.config +++ b/rebar.config @@ -32,7 +32,8 @@ - (\"diameter_dict_util\":\"parse\"/\"2\") - (\"erlang\":\"timestamp\"/\"0\") - (\"rebar_rnd\":\"seed\"/\"1\") - - (\"rebar_rnd\":\"uniform\"/\"0\"))", + - (\"rebar_rnd\":\"uniform\"/\"0\") + - (\"rebar_rnd\":\"uniform\"/\"1\"))", []}]}. {dialyzer, http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/bb79416b/src/rebar.erl ---------------------------------------------------------------------- diff --git a/src/rebar.erl b/src/rebar.erl index 6f78fe6..fa7d060 100644 --- a/src/rebar.erl +++ b/src/rebar.erl @@ -208,12 +208,6 @@ profile(_Config, _Commands, Profiler) -> ?ABORT("Unsupported profiler: ~s~n", [Profiler]). run_aux(BaseConfig, Commands) -> - %% Make sure crypto is running - case crypto:start() of - ok -> ok; - {error,{already_started,crypto}} -> ok - end, - %% Make sure memoization server is running case rmemo:start() of {ok, _} -> ok; http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/bb79416b/src/rebar_ct.erl ---------------------------------------------------------------------- diff --git a/src/rebar_ct.erl b/src/rebar_ct.erl index b27f661..7c0f9d9 100644 --- a/src/rebar_ct.erl +++ b/src/rebar_ct.erl @@ -288,7 +288,7 @@ search_ct_specs_from(Cwd, TestDir, Config) -> build_name(Config) -> %% generate a unique name for our test node, we want %% to make sure the odds of name clashing are low - Random = integer_to_list(crypto:rand_uniform(0, 10000)), + Random = integer_to_list(rebar_rnd:uniform(10000)), case rebar_config:get_local(Config, ct_use_short_names, false) of true -> "-sname test" ++ Random; false -> " -name test" ++ Random ++ "@" ++ net_adm:localhost() http://git-wip-us.apache.org/repos/asf/couchdb-rebar/blob/bb79416b/src/rebar_eunit.erl ---------------------------------------------------------------------- diff --git a/src/rebar_eunit.erl b/src/rebar_eunit.erl index ebf76bc..538f88b 100644 --- a/src/rebar_eunit.erl +++ b/src/rebar_eunit.erl @@ -279,7 +279,7 @@ randomize_suites(Config, Modules) -> undefined -> Modules; "true" -> - Seed = crypto:rand_uniform(1, 65535), + Seed = rebar_rnd:uniform(65535), randomize_suites1(Modules, Seed); String -> try list_to_integer(String) of
