Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OTP20+ #399

Open
SserwangaV opened this issue Dec 15, 2020 · 6 comments
Open

Support for OTP20+ #399

SserwangaV opened this issue Dec 15, 2020 · 6 comments

Comments

@SserwangaV
Copy link

@martinsumner how can we be able to use rebar2 in rebar.config {deps,[]} for riak-erlang-client to compile on OTP20 and later ? Right now the edoc states this {riakc, "2.5.*", {git, "https://github.com/basho/riak-erlang-client", {tag, "2.5.1"}}}, which is only supported on not later than OTP19.

@martinsumner
Copy link
Contributor

The latest release - https://github.com/basho/riak-erlang-client/tree/riak_kv-3.0.1 is OTP 20 + - so the tag riak_kv-3.0.1 should work in your rebar.config.

Apologies the edocs, readme and release notes aren't up to date with the recent release history.

I've not tried this with rebar2 though, so I don't know if this will cause issues - everything in riak is now using rebar3.

@SserwangaV
Copy link
Author

SserwangaV commented Dec 15, 2020

riak-erlang-client is used as a dependency in a Nitrogen web framework application that uses rebar2 currently. We are also connecting to Riak-KV 2.2.5. We are failing to upgrade the application to OTP20+ because of this dependency problem. Can the branch https://github.com/basho/riak-erlang-client/tree/develop-3.0-higherotp provide a workaround?

@martinsumner
Copy link
Contributor

A OTP 20+ riak erlang client pointing at riak_kv 2.2.5 is not something I've tried to get working yet - there may be some issues with the riak_pb dependancy. I will have a look at this tomorrow.

@martinsumner
Copy link
Contributor

I didn't get chance to look at this today, in terms of actually proving anything, but having thought about it there shouldn't be any issues pointing the up-to-date riak erlang client (with OTP 20+ support) at an older version of Riak (e.g. 2.2.5). The PB API has been updated, but only with new additions, so using old functionality should not be changed.

@SserwangaV
Copy link
Author

It worked - able to make CRUD operations, but I had to compile it independently (without including it to rebar.config) and then copy all the contents of its /lib directory to /lib of the application ~/myapp/lib.

This is exactly what I did:
~$ git clone git://github.com/basho/riak-erlang-client.git
~$ cd riak-erlang-client
~$ make
Then I copied the contents thusly
~$ cp ~/riak-erlang-client/_build/default/lib/* ~/myapp/lib/

When added to rebar.config:
It failed to compile when added as a dependency from the rebar.config file. This is the error
Pulling riakc from {git,"git://github.com/basho/riak-erlang-client", {tag,"riak_kv-3.0.1"}}
Cloning into 'riakc'...
==> riakc (get-deps)
Pulling riak_pb from {git,"https://github.com/basho/riak_pb", {tag,"riak_kv-3.0.1"}}
Cloning into 'riak_pb'...
Uncaught error in rebar_core: {'EXIT', {function_clause, [{code,which, [{rebar3_gpb_plugin, {git, "https://github.com/basho/rebar3_gpb_plugin", {tag,"riak-3.0.1"}}}], [{file,"code.erl"},{line,790}]}, {rebar_core,'-plugin_modules/3-lc$^0/1-0-', 1, [{file,"src/rebar_core.erl"},{line,573}]}, {rebar_core,plugin_modules,3, [{file,"src/rebar_core.erl"},{line,573}]}, {rebar_core,process_dir1,7, [{file,"src/rebar_core.erl"},{line,244}]}, {rebar_core,process_each,5, [{file,"src/rebar_core.erl"},{line,351}]}, {rebar_core,process_dir1,7, [{file,"src/rebar_core.erl"},{line,271}]}, {rebar_core,process_each,5, [{file,"src/rebar_core.erl"},{line,351}]}, {rebar_core,process_dir1,7, [{file,"src/rebar_core.erl"},{line,271}]}]}}
make: *** [Makefile:15: get-deps] Error 1

I'm running a Nitrogen web framework application which is still built on rebar2.
Running on OTP 23.

@lgmfred
Copy link

lgmfred commented Apr 6, 2022

This was very useful for setting up my development environment (.... after scratching my chin a few times and going "Hmmm..."). Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants