Closed nguyenbatam closed 8 years ago
I can't replicate your failure. Using a fresh build, I however get:
===> Verifying dependencies...
===> Fetching amqp_client ({git,
"https://github.com/rabbitmq/rabbitmq-erlang-client.git",
{tag,"rabbitmq_v3_5_3"}})
===> Dependency failure: Application amqp_client not found at the top level
of directory /tmp/rmq/_build/default/lib/amqp_client
That specific project appears to have a need for custom erlang.mk plugins to work https://github.com/rabbitmq/rabbitmq-erlang-client/blob/master/Makefile and specifies no format of configuration either rebar or rebar3 can understand.
As far as I can tell we can't do anything about that dependency.
As far as I know rabbitmq libs aren't compatible with rebar or rebar3.
When I test a new project with rebar , it's dont have problem . So I think this problem is belong rebar3 with https://github.com/rabbitmq/rabbitmq-common.git :(
{lib_dirs, ["lib"]}. {erl_opts, [debug_info,{parse_transform, lager_transform}]}. {erl_opts, [ {src_dirs, ["src","rel"]}]}. {deps, [{lager,"3.0.2",{git,"https://github.com/basho/lager.git",{tag,"3.0.2"}}}, {protobuffs,"0.8.2",{git,"https://github.com/basho/erlang_protobuffs.git",{tag,"0.8.2"}}}, {eredis,"1.0.8",{git,"https://github.com/wooga/eredis.git",{tag,"v1.0.8"}}}, {jiffy,"0.14.7",{git,"https://github.com/davisp/jiffy.git",{tag,"0.14.7"}}}, {rabbitcommon,".",{git,"https://github.com/rabbitmq/rabbitmq-common.git",{tag,"rabbitmq_v3_6_1"}}}, {amqpclient,".",{git,"https://github.com/rabbitmq/rabbitmq-erlang-client.git",{tag,"rabbitmq_v3_6_1"}}}, {cowboy, "1.0.4", {git, "https://github.com/ninenines/cowboy.git",{tag,"1.0.4"}}}]}.
{eunit_compile_opts, [export_all]}. {eunit_opts, [verbose, {report, {eunit_surefire, [{dir, "."}]}}]}.
{cover_enabled, true}. {cover_export_enabled, true}.
I get a similar failure with the old rebar:
==> rabbit_common (compile)
/tmp/rttt/deps/rabbit_common/src/rabbit_misc.erl:19: can't find include file "rabbit_framing.hrl"
Compiling /tmp/rttt/deps/rabbit_common/src/rabbit_misc.erl failed:
ERROR: compile failed while processing /tmp/rttt/deps/rabbit_common: rebar_abort
and for rebar3:
===> Compiling cowlib
===> Compiling rabbit_common
===> Compiling /tmp/rttt/_build/default/lib/rabbit_common/src/rabbit_misc.erl failed
/tmp/rttt/_build/default/lib/rabbit_common/src/rabbit_misc.erl:19: can't find include file "rabbit_framing.hrl"
I don't know where that file ought to be, but it's not in path right now, nor being generated with rebar 2.6.1.
@nguyenbatam I don't now how that can be possible since rabbit_framing.hrl
requires running the Makefile to generate.
/bin/sh: -c: line 0: syntax error near unexpected token (' /bin/sh: -c: line 0:
echo " DEP " rabbitmq_codegen; fetch_url1='https://github.com/rabbitmq/rabbitmq-codegen.git'; fetch_url2='https://github.com/rabbitmq/rabbitmq-codegen.git'; if test "$fetch_url1" != 'https://github.com/rabbitmq/rabbitmq-common.git' && git clone -q -n -- "$fetch_url1" /home/tamnb/workspace_Erlang/test/_build/default/lib/rabbit_common/deps/rabbitmq_codegen; then fetch_url="$fetch_url1"; push_url='https://github.com/rabbitmq/rabbitmq-codegen.git'; elif git clone -q -n -- "$fetch_url2" /home/tamnb/workspace_Erlang/test/_build/default/lib/rabbit_common/deps/rabbitmq_codegen; then fetch_url="$fetch_url2"; push_url='git@github.com:rabbitmq/rabbitmq-codegen.git'; fi; cd /home/tamnb/workspace_Erlang/test/_build/default/lib/rabbit_common/deps/rabbitmq_codegen && ( git checkout -q (no >/dev/null 2>&1 || git checkout -q branch) >/dev/null 2>&1 || git checkout -q master >/dev/null 2>&1 || git checkout -q master >/dev/null 2>&1 || (echo "error: no valid pathspec among: (no branch) master master" 1>&2 && false) ) && (test "$fetch_url" = "$push_url" || git remote set-url --push origin "$push_url")'
make: *\ [/home/tamnb/workspace_Erlang/test/_build/default/lib/rabbit_common/deps/rabbitmq_codegen] Error 1
{relx, [{release, { test, "0.1.0" }, [test, sasl]},
{sys_config, "./config/sys.config"},
{vm_args, "./config/vm.args"},
{dev_mode, true},
{include_erts, false},
{extended_start_script, true}]
}.
{profiles, [{prod, [{relx, [{dev_mode, false}, {include_erts, true}]}] }] }. {overrides, [{override, rabbit_common, [{pre_hooks, [{compile, "rm -Rf .git & make"}]}]}]}.
We can't have hacks in rebar3 for individual apps. You'll have to use the override unless rabbit adds support for rebar3.
Tristan Sloughter t@crashfast.com
On Tue, Jun 7, 2016, at 11:07 PM, nguyenbatam wrote:
- With rebar3 in file rebar.config . I insert more , so it's ok {overrides, [{override, rabbit_common, [{pre_hooks, [{compile, "rm -Rf .git & make"}]}]}]}.
- Because when I go directory _build/default/lib/rabbit_common/ . First i must remove directory .git and after run make .
This is my config {erl_opts, [debug_info]}. {deps, [{lager,"3.0.2",{git," https://github.com/basho/lager.git",{tag,"3.0.2"}[1]}}, {protobuffs,"0.8.2",{git," https://github.com/basho/erlang_protobuffs.git",{tag,"0.8.2"}[2]}}, {eredis,"1.0.8",{git," https://github.com/wooga/eredis.git",{tag,"v1.0.8"}[3]}}, {jiffy,"0.14.7",{git," https://github.com/davisp/jiffy.git",{tag,"0.14.7"}[4]}}, {rabbitcommon,".",{git," https://github.com/rabbitmq/rabbitmq-common.git",{tag,"rabbitmq_v3_6_1"}[5]}}, {amqpclient,".",{git," https://github.com/rabbitmq/rabbitmq-erlang-client.git",{tag,"rabbitmq_v3_6_1"}[6]}}, {cowboy, "1.0.4", {git, " https://github.com/ninenines/cowboy.git",{tag,"1.0.4"}[7]}}]}. {relx, [{release, { test, "0.1.0" }, [test, sasl]},
{sys_config, "./config/sys.config"}, {vm_args, "./config/vm.args"}, {dev_mode, true}, {include_erts, false}, {extended_start_script, true}]
}. {profiles, [{prod, [{relx, [{dev_mode, false}, {include_erts, true}]}] }] }. {overrides, [{override, rabbit_common, [{pre_hooks, [{compile, "rm -Rf .git & make"}]}]}]}.
- I think rebar3 need check it when it fetch rabbit-common lib — You are receiving this because you commented. Reply to this email directly, view it on GitHub[8], or mute the thread[9].
Links:
I am a newbie Erlang . So it's only a question ! This is the first , I learn Erlang . Tks for yours answer !
rebar3 compile ===> Verifying dependencies... ===> Package <<"rebar_gdb_plugin">> not found. Fetching registry updates and trying again... ===> Updating package registry... ===> Writing registry to /home/tamnb/.cache/rebar3/hex/default/registry ===> Generating package index... ===> [cloudi_service_oauth1:1.5.1] Only existing version of cloudi_service_db_riak is 1.3.3 which does not match constraint ~> 1.5.1. Using anyway, but it is not guaranteed to work. ===> Writing index to /home/tamnb/.cache/rebar3/hex/default/packages.idx ===> Plugin rebar_gdb_plugin not available. It will not be used. ===> Compiling rabbit_common ===> Compiling /home/tamnb/workspace_Erlang/my_project/_build/default/lib/rabbit_common/src/rabbit_misc.erl failed /home/tamnb/workspace_Erlang/my_project/_build/default/lib/rabbit_common/src/rabbit_misc.erl:19: can't find include file "rabbit_framing.hrl"
This is my rebar.config ` {erl_opts, [debug_info,{parse_transform, lager_transform}]}. {deps, [{lager,"3.0.2", {git,"https://github.com/basho/lager.git",{tag,"3.0.2"}}}, {protobuffs,"0.8.2", {git,"https://github.com/basho/erlang_protobuffs.git",{tag,"0.8.2"}}}, {eredis,"1.0.8", {git,"https://github.com/wooga/eredis.git",{tag,"v1.0.8"}}}, {jiffy,"0.14.7", {git,"https://github.com/davisp/jiffy.git",{tag,"0.14.7"}}}, {cowboy, "1.0.4", {git, "https://github.com/ninenines/cowboy.git",{tag,"1.0.4"}}}, {rabbitcommon, ".", {git, "git://github.com/jbrisbin/rabbit_common.git", "rabbitmq-3.5.6"}}, {amqpclient,".", {git,"https://github.com/rabbitmq/rabbitmq-erlang-client.git",{tag,"rabbitmq_v3_5_3"}}} ]}. {relx, [{release, { my_project, "0.1.0" }, [my_project, sasl]},
}. {profiles, [{prod, [{relx, [{dev_mode, false}, {include_erts, true}]}] }] }. `
(' /bin/sh: -c: line 0:
echo " DEP " rabbitmq_codegen; fetch_url1='https://github.com/rabbitmq/rabbitmq-codegen.git'; fetch_url2='https://github.com/rabbitmq/rabbitmq-codegen.git'; if test "$fetch_url1" != 'https://github.com/rabbitmq/rabbitmq-common.git' && git clone -q -n -- "$fetch_url1" /home/tamnb/workspace_Erlang/my_project/_build/default/lib/rabbit_common/deps/rabbitmq_codegen; then fetch_url="$fetch_url1"; push_url='https://github.com/rabbitmq/rabbitmq-codegen.git'; elif git clone -q -n -- "$fetch_url2" /home/tamnb/workspace_Erlang/my_project/_build/default/lib/rabbit_common/deps/rabbitmq_codegen; then fetch_url="$fetch_url2"; push_url='git@github.com:rabbitmq/rabbitmq-codegen.git'; fi; cd /home/tamnb/workspace_Erlang/my_project/_build/default/lib/rabbit_common/deps/rabbitmq_codegen && ( git checkout -q (no >/dev/null 2>&1 || git checkout -q branch) >/dev/null 2>&1 || git checkout -q master >/dev/null 2>&1 || git checkout -q master >/dev/null 2>&1 || (echo "error: no valid pathspec among: (no branch) master master" 1>&2 && false) ) && (test "$fetch_url" = "$push_url" || git remote set-url --push origin "$push_url")' make: *\ [/home/tamnb/workspace_Erlang/my_project/_build/default/lib/rabbit_common/deps/rabbitmq_codegen] Error 1 ===> Hook for compile failed!