summaryrefslogtreecommitdiff
path: root/src/rebar_core.erl
diff options
context:
space:
mode:
authorFred Hebert <mononcqc@ferd.ca>2017-10-20 09:42:51 -0400
committerFred Hebert <mononcqc@ferd.ca>2017-10-20 09:42:51 -0400
commite57c8b74274cc43cc23ca0f4f76dd18f70a9241d (patch)
tree0ace25496ed5b5d7e73a656da1fa020fb817f6e7 /src/rebar_core.erl
parent0e15a4cf22b50e4df2100052a332205aeba98972 (diff)
Prevent hard crash on duplicate plugin paths
When a global plugin is used both locally and within the project, there are cases when the rebar3 program will hard crash (killed in do_boot). This has been traced to plugin-handling in compilation, where the same code path may be purged twice in a row without further reloading for the compile operation. This of course yields the result where the code handling on the VM kills all processes holding references to the module in memory, in this case the rebar3 process itself. By deduplicating the paths first, we ensure at most one purge before reloading plugins and paths, and this prevents a hard crash.
Diffstat (limited to 'src/rebar_core.erl')
-rw-r--r--src/rebar_core.erl1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/rebar_core.erl b/src/rebar_core.erl
index 3ef7a0d..6132a5e 100644
--- a/src/rebar_core.erl
+++ b/src/rebar_core.erl
@@ -136,6 +136,7 @@ process_command(State, Command) ->
do([], State) ->
{ok, State};
do([ProviderName | Rest], State) ->
+ ?DEBUG("Provider: ~p", [ProviderName]),
%% Special providers like 'as', 'do' or some hooks may be passed
%% as a tuple {Namespace, Name}, otherwise not. Handle them
%% on a per-need basis.