     {runtime, optional} = Mix.Tasks.Compile.App.project_apps(config)
     parent = self()
     opts = [ordered: false, timeout: :infinity]
-    deps = for dep <- Mix.Dep.cached(), into: %{}, do: {dep.app, true}
+    deps = for dep <- Mix.Dep.cached(), into: %{}, do: {dep.app, lib_path}
 
-    stream_apps(runtime ++ optional)
-    |> Task.async_stream(&load_app(&1, parent, deps, lib_path, validate_compile_env?), opts)
+    stream_apps(runtime ++ optional, deps)
+    |> Task.async_stream(&load_stream_app(&1, parent, validate_compile_env?), opts)
     |> Stream.run()
   end
 
-  defp load_app(app, parent, deps, lib_path, validate_compile_env?) do
+  defp load_stream_app({app, lib_path}, parent, validate_compile_env?) do
     children =
-      case load_app(app, deps, lib_path, validate_compile_env?) do
+      case load_app(app, lib_path, validate_compile_env?) do
         :ok ->
           Application.spec(app, :applications) ++ Application.spec(app, :included_applications)
 


    app = config[:app]
    _ = Code.prepend_path(Mix.Project.compile_path())
    load_app(app, %{app => true}, lib_path, validate_compile_env?)
    result
  end


    end
  end

  # The app didn't come from a dep, go through the slow path (code/erl_prim_loader)
  defp read_app(app, nil) do
    name = Atom.to_charlist(app) ++ '.app'

    with [_ | _] = path <- :code.where_is_file(name),
         {:ok, bin, _full_name} <- :erl_prim_loader.get_file(path),
         do: {:ok, bin}
  end

  defp read_app(app, lib_path) do
    File.read("#{lib_path}/#{app}/ebin/#{app}.app")
  end

  defp consult_app_file(bin) do
