ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
578 stars 241 forks source link

Failed to find dependency when building hackney using erlang.mk #923

Closed cliveyg closed 1 year ago

cliveyg commented 3 years ago

System: MacOS Big Sur 11.1 Brew installed version of Erlang (v23.2.3) Brew installed OpenSSL (OpenSSL 1.1.1i)

When I create a brand new project with make -f erlang.mk bootstrap-lib bootstrap-rel the project builds and compiles okay. However when I add hackney as a dependency I then get an error.

My Makefile:

PROJECT = test
PROJECT_DESCRIPTION = New project
PROJECT_VERSION = 0.1.0

DEPS = hackney

include erlang.mk

The error is:

src/hackney_ssl.erl:109: {undef,[{certifi,cacerts,[],[]},
        {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,680}]},
        {erl_eval,expr_list,6,[{file,"erl_eval.erl"},{line,888}]},
        {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,411}]},
        {ct_expand,xform_fun,6,[{file,"src/ct_expand.erl"},{line,95}]},
        {parse_trans,apply_F,5,[{file,"src/parse_trans.erl"},{line,872}]},
        {parse_trans,this_form_df,4,[{file,"src/parse_trans.erl"},{line,864}]},
        {parse_trans,mapfoldl,3,[{file,"src/parse_trans.erl"},{line,905}]}]}
make[2]: *** [/Users/joebloggs/dev/web/erlang_apps/test/erlang.mk:5442: ebin/hackney.app] Error 1 

Earlier in the error message is a reference to being unable to find a hackney dependency - certifi

 DEP    certifi (2.5.0)
tar: Error opening archive: Failed to open '/Users/joebloggs/dev/web/erlang_apps/test/.erlang.mk/hex/certifi.tar'

Could being unable to find this dependency cause the hackney ssl error? Or does the problem lie with hackney rather than erlang.mk?

Any help much appreciated!

essen commented 3 years ago

It's because hackney uses the ~ thing to select versions and Erlang.mk doesn't fully support it yet. I would suggest adding certifi as a build dep for the time being.

BUILD_DEPS = certifi
dep_certifi = hex 2.5.3

Then make distclean; make.

cliveyg commented 3 years ago

Excellent. That worked! Thank you very much for your quick response.