在chicaogboss中编译bson时出现语法错误

时间:2015-07-31 07:02:00

标签: compilation erlang chicagoboss

我们升级了具有'bson'依赖性的chicagoboss。当我们使用./rebar update-deps compile编译chicagoboss时。编译chicagoboss时会引发语法错误。 但基本上我们把它从'HEAD'中拉出来。我不确定这是不是一个好主意。

Pulling bson from {git,"git://github.com/mongodb/bson-erlang","HEAD"}
Cloning into 'bson'...

这是编译错误:

$./rebar update-deps compile
...
...
...
==> erlando (compile)
Compiled src/cut.erl
Compiled src/do.erl
Compiled src/monad.erl
Compiled src/monad_plus.erl
Compiled src/identity_m.erl
Compiled src/test.erl
Compiled src/error_m.erl
Compiled src/error_t.erl
Compiled src/list_m.erl
Compiled src/maybe_m.erl
Compiled src/import_as.erl
Compiled src/omega_m.erl
Compiled src/state_t.erl
==> aleppo (compile)
src/aleppo_parser.yrl: Warning: conflicts: 1 shift/reduce, 0 reduce/reduce
workspace/ChicagoBoss/deps/aleppo/src/aleppo_parser.yrl:none: Warning: conflicts: 1 shift/reduce, 0 reduce/reduce
Compiled src/aleppo_parser.yrl
Compiled src/aleppo_parser.erl
Compiled src/aleppo.erl
==> medici (compile)
Compiled src/medici.erl
Compiled src/medici_port_srv.erl
Compiled src/principe_table.erl
Compiled src/medici_native_conn.erl
Compiled src/medici_native_controller.erl
Compiled src/medici_conn_sup.erl
Compiled src/medici_sup.erl
Compiled src/medici_conn.erl
Compiled src/medici_port_sup.erl
Compiled src/medici_app.erl
Compiled src/medici_controller.erl
Compiled src/principe.erl
==> bson (compile)
Compiling workspace/ChicagoBoss/deps/bson/src/bson_binary.erl failed:
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:40: syntax error before: '{'
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:55: syntax error before: '{'
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:4: function get_map/1 undefined
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:33: function get_fields/2 undefined
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:36: spec for undefined function bson_binary:get_map/1
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:36: type map() undefined
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:78: illegal guard expression
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:92: function get_map/1 undefined
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:86: function get_field/4 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:142: function get_field/2 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:153: function get_string/1 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:172: function get_array/2 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:179: function get_values/3 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:194: function get_binary/1 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:207: function get_closure/1 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:219: function get_unixtime/1 is unused
workspace/ChicagoBoss/deps/bson/src/bson_binary.erl:228: function get_oid/1 is unused
ERROR: compile failed while processing workspace/ChicagoBoss/deps/bson: rebar_abort
make: *** [all] Error 1
Build step 'Execute shell' marked build as failure
Finished: FAILURE

有人可以提出解决方案吗?

1 个答案:

答案 0 :(得分:1)

问题的根源是来自BossDB mongodb-erlang(当前ChickagoBoss)的ce9bf77902 v0.8.15使用HEAD版本的bson与Erlang / OTP不兼容< 17现在。

您可以在bson依赖项之前在rebar.config中指定boss_db的工作版本。我可以看到v0.2的标记R16B03-1正常。