Skip to content

Commit 6a594e2

Browse files
author
José Valim
committed
Ensure changes in child deps forces the parent to recompile
This test fell through the cracks when we changed mix to no longer compile dependencies on get but during project compilation. Therefore, this patch fixes the bug and ensures the test is up to date to check the original scenario it was supposed to. Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
1 parent 10dd8f8 commit 6a594e2

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ defmodule Mix.Dep.Fetcher do
133133
dep_names = Enum.map(deps, fn dep -> dep.app end)
134134

135135
parents = Enum.filter all_deps, fn dep ->
136-
Enum.any?(dep.deps, &(&1 in dep_names))
136+
Enum.any?(dep.deps, &(&1.app in dep_names))
137137
end
138138

139139
do_with_depending(parents, all_deps) ++ parents

lib/mix/test/mix/tasks/deps.git_test.exs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ defmodule Mix.Tasks.DepsGitTest do
100100
assert File.exists?("deps/git_repo/mix.exs")
101101
assert File.rm("deps/git_repo/.fetch") == :ok
102102

103-
Mix.Tasks.Deps.Update.run ["deps_on_git_repo"]
103+
# Compile the dependencies
104+
Mix.Tasks.Deps.Compile.run []
105+
106+
# Now update children and make sure it propagates
107+
Mix.Tasks.Deps.Update.run ["git_repo"]
104108
assert File.exists?("deps/deps_on_git_repo/.fetch")
105109
assert File.exists?("deps/git_repo/.fetch")
106110

@@ -109,7 +113,7 @@ defmodule Mix.Tasks.DepsGitTest do
109113
assert File.exists?("_build/dev/lib/git_repo/ebin")
110114
Code.delete_path("_build/dev/lib/git_repo/ebin")
111115

112-
# Deps on git repo loads it automatically on compile.
116+
# Deps on git repo loads it automatically on compile
113117
Mix.Task.reenable "deps.loadpaths"
114118
Mix.Tasks.Deps.Compile.run ["deps_on_git_repo"]
115119
assert File.exists?("_build/dev/lib/deps_on_git_repo/ebin")

0 commit comments

Comments
 (0)