g-andrade / locus

MMDB reader for geolocation and ASN lookup of IP addresses
https://hexdocs.pm/locus/
MIT License
111 stars 15 forks source link

Noisy warning about rebar3_hank #35

Closed sneako closed 2 years ago

sneako commented 2 years ago

https://github.com/g-andrade/locus/blob/master/rebar.config.script#L14

This new warning message is quite noisy and not something I believe any of the consumers of this application would normally care about.

Is there any way that we could only make it appear if you are actually working directly on this library? In my application which depends on locus, this warning appears every time I compile, run tests, or start a shell.

g-andrade commented 2 years ago

That's fair! I didn't account for the warning being so common - in hindsight, it was clear it would be.

Fixed on 10f0231ae and released as 2.3.3

sneako commented 2 years ago

:heart: thank you!

sneako commented 2 years ago

Testing out 2.3.3 (in an Elixir project) and now the hank warning has been replaced with this error:

Error evaluating Rebar config script ./rebar.config.script:58: evaluation failed with reason error:undef and stacktrace [{rebar_api,debug,[[68,105,115,97,98,108,105,110,103,32,96,109,97,121,98,101,95,101,120,112,114,96,32,102,111,114,32,96,107,97,116,97,110,97,95,99,111,100,101,96,32,97,115,32,105,116,32,109,97,121,32,110,111,116,32,98,101,32,97,118,97,105,108,97,98,108,101],[]],[]},{erl_eval,do_apply,7,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,744}]},{erl_eval,exprs,6,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,136}]},{erl_eval,try_clauses,10,[{file,[101,114,108,95,101,118,97,108,46,101,114,108]},{line,993}]},{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,186}]}]
Any dependencies defined in the script won't be available unless you add them to your Mix project

I guess rebar_api is not available when running Rebar3 through Mix? Not sure how Mix could use rebar3 without also including rebar_api since it is just a module in the rebar3 library. Looking in to that a bit more, but figured I would let you know in the mean time.

sneako commented 2 years ago

It looks like elixir uses file:script/2 to run the rebar script, so any modules that aren't included in otp will not be available.

g-andrade commented 2 years ago

Hopefully fixed under 26eb059 / 2.3.4

2.3.3 retired.

g-andrade commented 2 years ago

I tested with a new Mix project, it appears to be OK now - let me know if this isn't the case

sneako commented 2 years ago

Confirmed! Things look good on my end as well, thank you so much!