rebar3



Build better Erlang.

Ask A Question

Questions

3

Why tasks doesn't get executed in dependency projects with the same profile as their top level projects

I was wondering what the correct usage of `profiles` in the aspect of `{erl_opts, [debug_info]}` and dependencies is. In your [profiles example](http://www.rebar3.org/docs/profiles#example) you put `debug_info` in the `test` profile and `no_debug_info` in the `prod` profile. That is the behavior I also would have assumed to be a best practice for erlang apps and libraries. I did this for example in a migration to `rebar3` of a library project [boss_db](https://github.com/synlay/boss_db/tree/456df1b613dd6d5efe1465123429f5e9ac0089b0). From another top level erlang project I would like to use this library as a dependency, where I also define the `debug_info`/`no_debug_info` according to your example in the corresponding profiles. But when I then run `rebar3 as test dialyzer` from the top level project the dialyzer will fail with the error message: `Could not get abstract code for file: .../_build/default/lib/boss_db/ebin/boss_cache.beam (please recompile it with +debug_info)`. You can find the travis build [here](https://travis-ci.org/synlay/boss_db_success_app/builds/120403977). So my question is why doesn't the dependencies also get compiled with the same profile as the top level project in general? To fix this I could define `debug_info` right within the `default` profile in the dependency but then the dependency would be compiled with `debug_info` even when I will create a release with `rebar3 as prod tar` right?

Posted by David Robakowski 3 years ago