@@ -209,31 +209,38 @@ defmodule Mix.Tasks.Deps.Compile do
209209 end
210210
211211 defp do_mix ( dep , _config ) do
212- Mix.Dep . in_dependency ( dep , fn _ ->
213- config = Mix.Project . config ( )
214-
215- if req = old_elixir_req ( config ) do
216- Mix . shell ( ) . error (
217- "warning: the dependency #{ inspect ( dep . app ) } requires Elixir #{ inspect ( req ) } " <>
218- "but you are running on v#{ System . version ( ) } "
219- )
220- end
221-
222- try do
223- options = [ "--from-mix-deps-compile" , "--no-warnings-as-errors" , "--no-code-path-pruning" ]
224- res = Mix.Task . run ( "compile" , options )
225- match? ( { :ok , _ } , res )
226- catch
227- kind , reason ->
228- app = dep . app
212+ Mix.Dep.Loader . with_system_env ( dep , fn ->
213+ Mix.Dep . in_dependency ( dep , fn _ ->
214+ config = Mix.Project . config ( )
229215
216+ if req = old_elixir_req ( config ) do
230217 Mix . shell ( ) . error (
231- "could not compile dependency #{ inspect ( app ) } , \" mix compile \" failed. " <>
232- deps_compile_feedback ( app )
218+ "warning: the dependency #{ inspect ( dep . app ) } requires Elixir #{ inspect ( req ) } " <>
219+ "but you are running on v #{ System . version ( ) } "
233220 )
234-
235- :erlang . raise ( kind , reason , __STACKTRACE__ )
236- end
221+ end
222+
223+ try do
224+ options = [
225+ "--from-mix-deps-compile" ,
226+ "--no-warnings-as-errors" ,
227+ "--no-code-path-pruning"
228+ ]
229+
230+ res = Mix.Task . run ( "compile" , options )
231+ match? ( { :ok , _ } , res )
232+ catch
233+ kind , reason ->
234+ app = dep . app
235+
236+ Mix . shell ( ) . error (
237+ "could not compile dependency #{ inspect ( app ) } , \" mix compile\" failed. " <>
238+ deps_compile_feedback ( app )
239+ )
240+
241+ :erlang . raise ( kind , reason , __STACKTRACE__ )
242+ end
243+ end )
237244 end )
238245 end
239246
0 commit comments