Closed eproxus closed 7 years ago
Rebar3 uses it in the configuration to turn down the size of the compiled escript, which turns out to have important performance impact on more constrained platforms (like raspberry pis), as far as I can remember.
Hm yea, but dialyzer should use your relx dep not the one in the escript. So def a bug.
Tristan Sloughter t@crashfast.com
On Tue, Jul 12, 2016, at 05:05 AM, Fred Hebert wrote:
Rebar3 uses it in the configuration to turn down the size of the compiled escript, which turns out to have important performance impact on more constrained platforms (like raspberry pis), as far as I can remember. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub[1], or mute the thread[2].
Links:
@eproxus maybe the dialyze
profile introduced in 57532fd1 fixes this?
@lrascao Not sure if that would get picked up when Relx is a dependency of another project.
do you have a public project where this is happening that i can take a look at?
@lrascao We used the following Elixir mix task, which had Relx as a dependency ({:relx, "~> 3.20"}
):
https://gist.github.com/eproxus/8529262fdef8254c5ed404eed7ef4fd1
@eproxus do you have a simpler project? can't really get any of this to work (terrible at Elixir)
@lrascao I think the problem is just that Relx is always built without debug info. It doesn't matter if it is then used in an Erlang or Elixir project, any Dialyzer task would not work for a project that has Relx as a dependency.
for an Erlang project (that uses rebar3) i'm able to specify a profile that overrides erl_opts
in order to add the debug_info
element, something like this:
{profiles, [
{dialyze, [
{overrides, [
{add, relx, [{erl_opts, [debug_info]}]},
{erl_opts, [debug_info]}
]}
]}
]}.
is there something similar for Elixir?
No idea if that is possible in Elixir. Maybe the compile opts can be overridden somehow.
Basic question: Why is debug_info
disabled at all for Relx in the first place?
I think ferd already discussed the reason, mainly to turn down binary size
I think as far as tradeoffs go it is more likely that people want to build tools on top of Relx than run it on a Raspberry Pi, but that's just my 2 cents. 🙂 (I.e. I rather the debug_info
being enabled by default as one would expect, and then disable it for special builds)
It is the config for building the default relx escript which should not, and people don't expect it to, have debug_info
. If relx is used as a dependency of a tool that wants it to have debug_info
it should enable override the config to enable.
Which is what we do in rebar3 to run dialyzer on the project: https://github.com/erlang/rebar3/blob/master/rebar.config#L43-L52
Same issue, still cannot run dialyzer over relx-as-a-dependency in 2017.
If you are using it as a dependency and want to turn on debug_info
you can use overrides.
If you are using it as a dependency and want to turn on debug_info you can use overrides.
I'm using mix
and dialyxer
, any clue how to add those there?
Ah, I don't know, you'll have to ask someone who knows mix if it can make overrides work.
@tsloughter I would like to propose an alternative though. Why don't we always include the debug_info and then change the escript task/command to strip debug_info? If stripping debug_info is important to reduce the size of escripts, then I believe we should do it automatically for the majority of escripts, instead of manually changing the few cases we control. What do you think? I would do the same changes to Mix as well.
@ferd maybe Jose's idea is doable, both on rebar3
and relx
escript, is there an escriptize
profile that can be overridden?
Currently there is not. Relx's bootstrap script (and README instructions) could define one and make use of it though.
closing via #575
Is there a reason the option
no_debug_info
is used in the Rebar configuration? This prevents running Dialyzer on projects which have Relx as a dependency: