I just upgraded to 1.4 and received the following error when I tried running my tests. My dev env compiles and runs successfully.
** (Mix) Could not start application http_server: could not find application file: http_server.app
http_server is a :test
env dependency of my application dependency ExVCR. http_server is listed among my deps explicity.
I don’t get much more of an error than this, so this is the strack trace I’ve inferred:
elixir/lib/application.ex (Invoked from Application.format_error/1
)
defp do_format_error({'no such file or directory', file}) do
"could not find application file: #{file}"
end
elixir/lib/kernel/cli.ex (Invoked from Kernel.CLI.main/1
)
defp process_command({:app, app}, _config) when is_binary(app) do
case Application.ensure_all_started(String.to_atom(app)) do
{:error, {app, reason}} ->
{:error, "--app : Could not start application #{app}: " <>
Application.format_error(reason)}
{:ok, _} ->
:ok
end
end
start_cli() ->
{ok, _} = application:ensure_all_started(?MODULE),
%% We start the Logger so tools that depend on Elixir
%% always have the Logger directly accessible. However
%% Logger is not a dependency of the Elixir application,
%% which means releases that want to use Logger must
%% always list it as part of its applications.
_ = case code:ensure_loaded('Elixir.Logger') of
{module, _} -> application:start(logger);
{error, _} -> ok
end,
'Elixir.Kernel.CLI':main(init:get_plain_arguments()).
Once we get into Erlang territory, the .app
suffix on http_server error starts to make sense. There is no such file anywhere in my project or the http_server dependency, so it’s where the trail runs cold for me.
I saw a similar ticket on github related to logger and escript bug and application dependencies in the application/0
function. ExVCR includes http_server in its mixfile application function (below). I know this is treated differently now in 1.4, which is the only reason I could think of as to why mix test
is no longer working.
def application do
[ applications: [:http_server] ]
end
I tried deleting my _build directory, mix.lockfile and all that, but nothing worked.
Any ideas what’s going on here?