Emysql icon indicating copy to clipboard operation
Emysql copied to clipboard

Error occurred when installing Emysql

Open linrl3 opened this issue 6 years ago • 2 comments

When I run "make" inside Emysql, the error occured: (My erlang version is 21)

Generating "include/crypto_compat.hrl" ...
...supports cryto:hash/2
...no changes needed to "include/crypto_compat.hrl". Skipping writing new file
(cd src;/Applications/Xcode.app/Contents/Developer/usr/bin/make)
erlc -W -I ../include  +nowarn_deprecated_type +debug_info -o ../ebin emysql.erl
/Users/linrl3/Desktop/Emysql/src/../include/emysql.hrl:38: type gb_tree() undefined
/Users/linrl3/Desktop/Emysql/src/../include/emysql.hrl:39: type queue() undefined
emysql.erl:672: type dict() undefined
make[1]: *** [../ebin/emysql.beam] Error 1
make: *** [all] Error 2

Does anyone know how to solve the problem? It seems that it's about type definition.

linrl3 avatar Jul 13 '18 02:07 linrl3

emysql.erl and rebar.config for reference

{erl_opts, [
        {platform_define, "^([1-9][0-9][0-9].*?)|([2-9][0-9].*?)|(1[8-9])", namespaced_types},
        ... ...
]}.
-export_type([
         t_gb_tree/0,
         t_queue/0,
         t_dict/0
]).

-ifdef(namespaced_types).
-type t_gb_tree() :: gb_trees:tree().
-type t_queue() :: queue:queue().
-type t_dict() :: dict:dict().
-else.
-type t_gb_tree() :: gb_tree().
-type t_queue() :: queue().
-type t_dict() :: dict().
-endif.

qingchuwudi avatar Jul 13 '18 03:07 qingchuwudi

The issue is with Erlang/OTP 18.0 and it changing where dict() as a type comes from. Changing it to dict:dict() should fix the issue.

See https://github.com/basho/riak_pb/issues/128 for some context.

EDIT Also this pr https://github.com/Eonblast/Emysql/pull/169

tmcgilchrist avatar Jul 13 '18 03:07 tmcgilchrist