@@ -103,12 +103,13 @@ defmodule Mix.Tasks.Compile.Elixir do
103103 manifest = manifest ( )
104104 configs = [ Mix.Project . config_mtime ( ) | Mix.Tasks.Compile.Erlang . manifests ( ) ]
105105 force = opts [ :force ] || Mix.Utils . stale? ( configs , [ manifest ] )
106+ { tracers , opts } = pop_tracers ( opts )
106107
107108 opts =
108109 ( project [ :elixirc_options ] || [ ] )
109110 |> Keyword . merge ( opts )
110111 |> xref_exclude_opts ( project )
111- |> tracers_opts ( )
112+ |> tracers_opts ( tracers )
112113 |> profile_opts ( )
113114
114115 Mix.Compilers.Elixir . compile ( manifest , srcs , dest , [ :ex ] , force , opts )
@@ -134,17 +135,21 @@ defmodule Mix.Tasks.Compile.Elixir do
134135 end
135136 end
136137
137- defp tracers_opts ( opts ) do
138+ defp pop_tracers ( opts ) do
138139 case Keyword . pop_values ( opts , :tracer ) do
139140 { [ ] , opts } ->
140- opts
141+ { [ ] , opts }
141142
142143 { tracers , opts } ->
143- tracers = Enum . map ( tracers , & Module . concat ( [ & 1 ] ) )
144- Keyword . update ( opts , :tracers , tracers , & ( tracers ++ & 1 ) )
144+ { Enum . map ( tracers , & Module . concat ( [ & 1 ] ) ) , opts }
145145 end
146146 end
147147
148+ defp tracers_opts ( opts , tracers ) do
149+ tracers = tracers ++ Code . get_compiler_option ( :tracers )
150+ Keyword . update ( opts , :tracers , tracers , & ( tracers ++ & 1 ) )
151+ end
152+
148153 defp profile_opts ( opts ) do
149154 case Keyword . fetch ( opts , :profile ) do
150155 { :ok , "time" } -> Keyword . put ( opts , :profile , :time )
0 commit comments