Skip to content

Commit 4162d23

Browse files
committed
Emit a warning if path dependency does not exist, closes #13915
1 parent 8e1d041 commit 4162d23

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

lib/mix/lib/mix/dep/fetcher.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ defmodule Mix.Dep.Fetcher do
5151
cond do
5252
# Dependencies that cannot be fetched are always compiled afterwards
5353
not scm.fetchable?() ->
54+
if not scm.checked_out?(opts) do
55+
Mix.shell().error("warning: missing dependency #{format_dep(dep)}")
56+
end
57+
5458
{dep, [app | acc], lock}
5559

5660
# If the dependency is not available or we have a lock mismatch

lib/mix/test/mix/dep_test.exs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,11 @@ defmodule Mix.DepTest do
295295

296296
Mix.Tasks.Deps.run([])
297297
assert_received {:mix_shell, :info, ["* deps_repo1" <> _]}
298-
assert_received {:mix_shell, :info, [_]}
299298
assert_received {:mix_shell, :info, ["* deps_repo2" <> _]}
300-
assert_received {:mix_shell, :info, [_]}
301299
assert_received {:mix_shell, :info, ["* git_repo" <> _]}
302-
assert_received {:mix_shell, :info, [msg]}
303-
assert msg =~ "different specs were given for the git_repo"
300+
301+
assert_received {:mix_shell, :info,
302+
[" different specs were given for the git_repo app" <> _]}
304303
end)
305304
end)
306305
end
@@ -343,12 +342,11 @@ defmodule Mix.DepTest do
343342

344343
Mix.Tasks.Deps.run([])
345344
assert_received {:mix_shell, :info, ["* deps_repo1" <> _]}
346-
assert_received {:mix_shell, :info, [_]}
347345
assert_received {:mix_shell, :info, ["* deps_repo2" <> _]}
348-
assert_received {:mix_shell, :info, [_]}
349346
assert_received {:mix_shell, :info, ["* git_repo" <> _]}
350-
assert_received {:mix_shell, :info, [msg]}
351-
assert msg =~ "different specs were given for the git_repo"
347+
348+
assert_received {:mix_shell, :info,
349+
[" different specs were given for the git_repo app" <> _]}
352350
end)
353351
end)
354352
end

0 commit comments

Comments
 (0)