rebar3 icon indicating copy to clipboard operation
rebar3 copied to clipboard

Internal crash when deps missing during escriptize

Open richcarl opened this issue 3 years ago • 3 comments

When rebar3 runs escriptize and a dependency is missing, there is no error message, just an internal crash in rebar_prv_escriptize:

find_deps_of_deps([Name|Names], Apps, Acc) ->
    ?DIAGNOSTIC("processing ~p", [Name]),
    {ok, App} = rebar_app_utils:find(Name, Apps),    %% crashes with badmatch, error

richcarl avatar Nov 26 '20 09:11 richcarl

Usually that would be because deps should not be missing (since we built them first).

Better error handling would probably make sense. In this case is this a dependency that the app declared but is neither in the stdlib nor your dep set? -- i.e. does it make sense to crash and blame the user, or would this be an internal bug?

ferd avatar Nov 26 '20 13:11 ferd

Yeah, it happens when you're cargo cult programming and trying to get something to work by imitating someone elses rebar.config. :-) It's the user who is to blame, but right now you don't get any info about which dep was missing, just that it crashed. I had to instrument the code to see on which dep it died.

richcarl avatar Nov 26 '20 21:11 richcarl

ah yeah. You would see it with DIAGNOSTIC=1 right before the crash but that isn't helpful enough.

ferd avatar Nov 26 '20 23:11 ferd