compilationerlangchicagoboss

Syntax error while compiling bson in chicaogboss


We upgraded chicagoboss which has the dependency of 'bson'. When we compile the chicagoboss using ./rebar update-deps compile. While compiling the chicagoboss it throws syntax error. But basically we pull it from 'HEAD'. I'm not sure if that is the good idea though.

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

Here is the compile error:

$./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

Can anyone suggest the solution?


Solution

  • Source of the problem is that mongodb-erlang ce9bf77902 from BossDB v0.8.15 (current ChickagoBoss) uses HEAD version of bson which is incompatible with Erlang/OTP < 17 now.

    You can specify working version of bson in rebar.config before boss_db dependency. As I can see tag v0.2 is ok for R16B03-1.