basho / riak-erlang-client

The Riak client for Erlang.
Apache License 2.0
311 stars 188 forks source link

Feature/erlang 20 bryan enhanced #367

Closed bryanhuntesl closed 6 years ago

bryanhuntesl commented 6 years ago

So @manifest modified the rebar.config to make it work with Erlang 20. On my system it wouldn't run the eunit because in Erlang 20 -compiler(export_all) produces warnings, and rebar.config defines warnings as build errors. So I've explicitly exported the necessary functions. I've tested this with kerl erlang versions:

Tested with:

rm -rf .eunit ebin deps && ./rebar get-deps && ./rebar compile && ./rebar eunit

Eunit tests passed.

russelldb commented 6 years ago

WFM, but before I +1, can I ask if there is a way to ignore this warning as a compiler option, since it is used often in Riak code, especially in ifdef(test) blocks

bryanhuntesl commented 6 years ago

@russelldb - I could not find a way to do so, short of removing the rebar configuration which makes warnings as build errors. Probably best practice to not use export_all anyway.

russelldb commented 6 years ago

Not going to argue best practice wrt export_all, but if this the best way to get around the warning, then +1 from me.

bryanhuntesl commented 6 years ago

Ta @russelldb

martincox commented 6 years ago

Stumbled across this whilst looking into something else related. Can specify -compile(nowarn_export_all) to suppress compiler errors. Bit quicker than exporting all functions, which I guess is fine for test modules.

bryanhuntesl commented 6 years ago

What do you want to pass this test case? Make all public by default and ignore error on newer erlang version? Or stick with what we've got?

On Thu, 28 Dec 2017 5:21 AM Martin Cox, notifications@github.com wrote:

Stumbled across this whilst looking into something else related. Can specify -compile(nowarn_export_all) to suppress compiler errors. Bit quicker than exporting all functions, which I guess is fine for test modules.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/basho/riak-erlang-client/pull/367#issuecomment-354287497, or mute the thread https://github.com/notifications/unsubscribe-auth/Aego9kNMP9_I-DZGa5ubd8yDDqhPzFREks5tE5XNgaJpZM4QVT8J .

martincox commented 6 years ago

Definitely stick with what we've got I guess. Was just mentioning as I was looking into making another repo support OTP20.