benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

Can't compile on Elixir 1.11 #660

Closed jaimeiniesta closed 3 years ago

jaimeiniesta commented 4 years ago

I'm using Hackney on an Elixir 1.10.4 project, but when upgrading to Elixir 1.11 I get this error:

===> Compiling src/hackney_metrics.erl failed
src/hackney_metrics.erl:19: can't find include file "hackney.hrl"
src/hackney_metrics.erl:24: undefined macro 'CONFIG'
src/hackney_metrics.erl:27: undefined macro 'CONFIG'

src/hackney_metrics.erl:13: function get_engine/0 undefined
src/hackney_metrics.erl:13: function init/0 undefined

==> e111
** (Mix) Could not compile dependency :hackney, "/Users/jaime/.mix/rebar3 bare compile --paths /Users/jaime/temp/e111/_build/dev/lib/*/ebin" command failed. You can recompile this dependency with "mix deps.compile hackney", update it with "mix deps.update hackney" or clean it with "mix deps.clean hackney"

Any ideas why this is failing?

I'm using these versions:

➔ elixir -v
Erlang/OTP 23 [erts-11.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]

Elixir 1.11.0 (compiled with Erlang/OTP 23)
josevalim commented 4 years ago

Can you please try this:

$ rebar3 --version
$ ~/.mix/rebar3 --version

And then try running mix local.rebar to update your rebar to see if it changes the result. If it still fails, go to deps/hackney and run one of rebar3 compile or ~/.mix/rebar3 compile.

jaimeiniesta commented 4 years ago

Thanks @josevalim - updating rebar fixed the issue, it looks like the 3.14.0-rc2 version causes the issue.

Here's the version I had:

➔ ~/.mix/rebar3 --version
rebar 3.14.0-rc2+build.4681.refaa546d24 on Erlang/OTP 23 Erts 11.0

after the update I'm on:

➔ ~/.mix/rebar3 --version
rebar 3.13.1 on Erlang/OTP 23 Erts 11.0
josevalim commented 4 years ago

Do you remember how you get 3.14.0-rc2? In any case, it is perhaps a bug to report on the Rebar 3 issues tracker if it hasn't been reported yet.

jaimeiniesta commented 4 years ago

I'm not really sure. I'm using kiex for managing elixir versions.

benoitc commented 3 years ago

closing the issue. It works for me when you use latest stable rebar3 with last mix version version. Feel free to reopen the issue if needed.