benoitc / hackney

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

SSL-related compile error #644

Closed johnnyplaydrums closed 3 years ago

johnnyplaydrums commented 4 years ago

Hey folks - I'm on MacOS 10.15.5 trying to compile hackney 1.16.0 with elixir 1.6.3 and erlang 20.2. Any ideas whats wrong? Here's the debug error, along with asdf install to show versions and :crypto.start() to show that ssl libraries are installed (I think?)

$ DEBUG=1 mix deps.compile hackney                                                                                                                                                                                  
===> Expanded command sequence to be run: []
===> Provider: {default,do}
===> Expanded command sequence to be run: [{default,app_discovery},
                                           {bare,compile}]
===> Provider: {default,app_discovery}
===> Provider: {bare,compile}
===> Compiling hackney
===> run_hooks("/Users/johnspencer/bowery/code/falkner/deps/hackney", pre_hooks, compile) -> no hooks defined

===> run_hooks("/Users/johnspencer/bowery/code/falkner/deps/hackney", pre_hooks, erlc_compile) -> no hooks defined

===> erlopts [debug_info,
              {d,namespaced_types},
              {d,no_customize_hostname_check},
              {d,buggy_chacha_ciphers}]
===> files to compile ["/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_stream.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_connect.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_date.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_headers_new.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_socks5.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_cookie.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_trace.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_response.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_util.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_local_tcp.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_url.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_tcp.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_ssl.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_headers.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_connection.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_ssl_certificate.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_multipart.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_metrics.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_http_connect.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_app.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_bstr.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_manager.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_http.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_pool_handler.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_pool.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_connections.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_request.erl",
                       "/Users/johnspencer/bowery/code/falkner/deps/hackney/src/hackney_sup.erl"]
===> Starting 1 compile worker(s)
===> Compiling src/hackney_ssl.erl failed
src/hackney_ssl.erl:58: {undef,[{ssl,cipher_suites,[default,'tlsv1.2'],[]},
        {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,670}]},
        {erl_eval,eval_lc1,6,[{file,"erl_eval.erl"},{line,696}]},
        {erl_eval,eval_generate,7,[{file,"erl_eval.erl"},{line,725}]},
        {erl_eval,eval_lc,6,[{file,"erl_eval.erl"},{line,682}]},
        {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,438}]},
        {erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,122}]},
        {ct_expand,xform_fun,6,
                   [{file,"/Users/johnspencer/bowery/code/falkner/deps/parse_trans/src/ct_expand.erl"},
                    {line,95}]}]}

** (Mix) Could not compile dependency :hackney, "/Users/johnspencer/.asdf/installs/elixir/1.6.3/.mix/rebar3 bare compile --paths "/Users/johnspencer/bowery/code/falkner/_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"
$ asdf install                                                                                                                                                                                                      
elixir 1.6.3 is already installed
erlang 20.2 is already installed
$ iex
Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:10] [kernel-poll:false]

Interactive Elixir (1.6.3) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)> :crypto.start()
:ok

I've tried re-install elixir and erlang, no luck so far. Interestingly, I was able to build hackney from source with rebar3 compile without error.

benoitc commented 4 years ago

i am in vacation until monday, but I will have a look. It seems that building with elixir doesn't pass the macros or something like it. I wil have to try (and add the build to the CI).

johnnyplaydrums commented 4 years ago

Thanks @benoitc!

benoitc commented 4 years ago

are you using a compiled version of elixir or one that you compile with the same erlang version with asdf?

johnnyplaydrums commented 4 years ago

I'm using one that I compiled via asdf with the same erlang version.

sntran commented 3 years ago

I would like to add that I have the same error when building my library on Travis.

https://travis-ci.org/github/sntran/google_maps/builds/742151800

Travis is set to use Elixir 1.6.6 on OTP 20.

mjsommer commented 3 years ago

Having the exact same issue, trying to compile multiple code sets. Here is a working example: https://github.com/era/pay

===> Compiling src/hackney_ssl.erl failed
src/hackney_ssl.erl:58: {undef,[{ssl,cipher_suites,[default,'tlsv1.2'],[]},
        {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,670}]},
        {erl_eval,eval_lc1,6,[{file,"erl_eval.erl"},{line,696}]},
        {erl_eval,eval_generate,7,[{file,"erl_eval.erl"},{line,725}]},
        {erl_eval,eval_lc,6,[{file,"erl_eval.erl"},{line,682}]},
        {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,438}]},
        {erl_eval,exprs,5,[{file,"erl_eval.erl"},{line,122}]},
        {ct_expand,xform_fun,6,
                   [{file,"/Users/mjsommer/Projects/sample_code/pay/deps/parse_trans/src/ct_expand.erl"},
                    {line,95}]}]}

If I can make this compile, I believe the others will work as well.

benoitc commented 3 years ago

can you test the master and let me know if it solves your issue?

johnnyplaydrums commented 3 years ago

I'm on MacOS 11.0.1 (originally posted the issue while on MacOS 10.15.5) and can confirm that compiling master now works! Thanks @benoitc!

benoitc commented 3 years ago

@johnnyplaydrums thanks for the feedback. Closing the issue as fixed.