silviucpp / erlkaf

Erlang kafka driver based on librdkafka
MIT License
84 stars 41 forks source link

remove rebar2 compatibility script #8

Closed tsloughter closed 5 years ago

tsloughter commented 5 years ago

We'll be using erlkaf in some Elixir projects as well and for some reason Mix pukes on this script. Other rebar.config.scripts seem to work fine so I was going to try figuring out what was wrong, but I didn't see anything obvious and figured I'd check if you still needed rebar2 support anyway?

silviucpp commented 5 years ago

I personally don't use rebar any longer. But I have no idea if anyone else using this lib is using it.

If this problem is not fixable we can remove it. I have no experience with mix/elixir. But I know somebody using the project into elixir with mix and didn't complained about any problem.

tsloughter commented 5 years ago

rebar has been unmaintained for years now. I don't know of any stragglers except couchdb.

It does seem to work with mix, a big red error is printed out during compilation but it does seem to ignore it. So fine if you close this.

silviucpp commented 5 years ago

Ok then I'll close it.

Thanks, Silviu

tsloughter commented 5 years ago

Actually realized a better way is to just exclude it from the hex package. Since rebar can't use hex anyway removing it won't harm anything but will clean up mix output. I'll send a PR for that later. Thanks.

silviucpp commented 5 years ago

You are right :) please submit the pr

On Tue, 2 Apr 2019 at 17:41, Tristan Sloughter notifications@github.com wrote:

Actually realized a better way is to just exclude it from the hex package. Since rebar can't use hex anyway removing it won't harm anything but will clean up mix output. I'll send a PR for that later. Thanks.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/silviucpp/erlkaf/pull/8#issuecomment-479029268, or mute the thread https://github.com/notifications/unsubscribe-auth/AEl3i2i4hWtBXrXjEkRePgUthOFRPw0Kks5vc2w0gaJpZM4cWkC_ .

lud commented 3 years ago

Hello, I am not sure if this is related but I cannot build from elixir project with version 2.0.4. Using git/master works fine.

{:erlkaf, git: "https://github.com/silviucpp/erlkaf.git", branch: "master"},
# {:erlkaf, "~> 2.0.4"},
silviucpp commented 3 years ago

@lud what error do you get? between 2.0.4 and master there are only 2 minor commits that shouldn't have any impact

lud commented 3 years ago

Hi @silviucpp

First I have this:

* Getting erlkaf (Hex package)
* Updating esq (Hex package)
Error evaluating Rebar config script ./rebar.config.script:22: evaluation failed with reason error:{badmatch,{error,enoent}} and stacktrace [{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,450}]},{erl_eval,exprs,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,123}]},{erl_eval,expr_list,6,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,893}]},{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,426}]},{file,eval_stream2,6,[{file,[102,105,108,101,46,101,114,108]},{line,1504}]},{file,script,2,[{file,[102,105,108,101,46,101,114,108]},{line,1142}]},{'Elixir.File','cd!',2,[{file,[108,105,98,47,102,105,108,101,46,101,120]},{line,1560}]},{'Elixir.Mix.Rebar',eval_script,2,[{file,[108,105,98,47,109,105,120,47,114,101,98,97,114,46,101,120]},{line,204}]}]
Any dependencies defined in the script won't be available unless you add them to your Mix project
* Updating jsone (Hex package)
* Updating lager (Hex package)
* Updating goldrush (Hex package)
* Updating datum (Hex package)
* Updating pipe (Hex package)
* Updating uid (Hex package)

As mentionned before the error seems ignored.

Then:

repo=https://github.com/edenhill/librdkafka.git rev=1a722553638bba85dbda5050455f7b9a5ef302de branch=master
~/agilap/pleenk/src/business-backend-pleenk/deps/erlkaf/deps ~/agilap/pleenk/src/business-backend-pleenk/deps/erlkaf
~/agilap/pleenk/src/business-backend-pleenk/deps/erlkaf/deps/librdkafka ~/agilap/pleenk/src/business-backend-pleenk/deps/erlkaf/deps ~/agilap/pleenk/src/business-backend-pleenk/deps/erlkaf
fatal: la référence n'est pas un arbre : 1a722553638bba85dbda5050455f7b9a5ef302de
error with git
make: *** [Makefile:4 : get_deps] Erreur 1
===> Hook for compile failed!

la référence n'est pas un arbre means "the ref is not a tree".

And finally:

** (Mix) Could not compile dependency :erlkaf,
"/home/lud/.asdf/installs/elixir/1.12.1-otp-24/.mix/rebar3 bare compile --paths
/home/lud/xxxxxxxxxxxxxxxxx/_build/dev/lib/*/ebin"
command failed. You can recompile this dependency with "mix deps.compile
erlkaf", update it with "mix deps.update erlkaf" or clean it with "mix
deps.clean erlkaf"

Then I retry, I get:

librdkafka fork already exist. delete deps/librdkafka for a fresh checkout ...
concurrentqueue fork already exist. delete deps/concurrentqueue for a fresh checkout ...

...

make[1] : on entre dans le répertoire « /home/lud/xxxxxxxxxxxxxxxxx/deps/erlkaf/c_src »
 CPP    queuecallbacksdispatcher.cc
/home/lud/xxxxxxxxxxxxxxxxx/deps/erlkaf/c_src/queuecallbacksdispatcher.cc: In member function ‘void QueueCallbacksDispatcher::watch(rd_kafka_t*, bool)’:
/home/lud/xxxxxxxxxxxxxxxxx/deps/erlkaf/c_src/queuecallbacksdispatcher.cc:47:75: error: ‘stoull’ is not a member of ‘std’
   47 |         objects_[instance] = item(is_consumer, static_cast<uint64_t>(std::stoull(buffer)/2), now_ms());
      |                                                                           ^~~~~~
make[1]: *** [nif.mk:78 : /home/lud/xxxxxxxxxxxxxxxxx/deps/erlkaf/c_src/queuecallbacksdispatcher.o] Erreur 1
make[1] : on quitte le répertoire « /home/lud/xxxxxxxxxxxxxxxxx/deps/erlkaf/c_src »
make: *** [Makefile:7 : compile_nif] Erreur 2
===> Hook for compile failed!

Finally I run rm -rvf deps/erlkaf/deps/librdkafka and try once more. This time I get the classic output from a ./configure script, a lot of gcc logs, but ultimately I get error: ‘stoull’ is not a member of ‘std’.

silviucpp commented 3 years ago

I published a new release 2.0.5 . Your problem was caused by https://github.com/silviucpp/erlkaf/issues/31 which is in master but not in 2.0.4

lud commented 3 years ago

It works, thank you very much.

lud commented 3 years ago

By the way, regarding the original topic of this issue, there is still this error:

Error evaluating Rebar config script ./rebar.config.script:22: evaluation failed with reason error:{badmatch,{error,enoent}} and stacktrace [{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,450}]},{erl_eval,exprs,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,123}]},{erl_eval,expr_list,6,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,893}]},{erl_eval,expr,5,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,426}]},{file,eval_stream2,6,[{file,[102,105,108,101,46,101,114,108]},{line,1504}]},{file,script,2,[{file,[102,105,108,101,46,101,114,108]},{line,1142}]},{'Elixir.File','cd!',2,[{file,[108,105,98,47,102,105,108,101,46,101,120]},{line,1560}]},{'Elixir.Mix.Rebar',eval_script,2,[{file,[108,105,98,47,109,105,120,47,114,101,98,97,114,46,101,120]},{line,204}]}]
Any dependencies defined in the script won't be available unless you add them to your Mix project

Though I don't undernstand as there is not rebar.config.script in erlkaf when used in a mix project.

silviucpp commented 3 years ago

I don't have clue how rebar.config.script is added into the build for hex.. You have this when you build from master or how ?

lud commented 3 years ago

Yep building from master. I saw that you commented the issue on esq, so let's see if they make the fix.