           all_warnings = previous_warnings ++ Enum.map(warnings, &diagnostic(&1, :warning))
           unless_previous_warnings_as_errors(previous_warnings, opts, {:ok, all_warnings})
 
-        {:error, errors, warnings} ->
+        {:error, errors, warnings, state} ->
           # In case of errors, we show all previous warnings and all new ones.
           # Print the new ones if --all-warnings was given.
-          {_, _, sources, _, _} = get_compiler_info()
+          {_, _, sources, _, _} = state
           errors = Enum.map(errors, &diagnostic(&1, :error))
           warnings = Enum.map(warnings, &diagnostic(&1, :warning))
           {:error, previous_warnings(sources, opts[:all_warnings]) ++ warnings ++ errors}


      acc_modules = Enum.reduce(modules, acc_modules, &Map.put(&2, &1, true))
      {[source(source: file, size: size) | acc_sources], acc_modules}
    end)
  end

  # Define empty records for the sources that needs
  # to be recompiled (but were not changed on disk)
  defp update_stale_sources(sources, changed) do
    Enum.reduce(changed, {sources, %{}}, fn file, {acc_sources, acc_modules} ->
      {source(size: size, digest: digest, modules: modules), acc_sources} =
        List.keytake(acc_sources, file, source(:source))

      acc_modules = Enum.reduce(modules, acc_modules, &Map.put(&2, &1, true))
      {[source(source: file, size: size, digest: digest) | acc_sources], acc_modules}
    end)
  end


      end)

    Mix.ProjectStack.compile_env(all_compile_env)
  end

  ## Resolution
