Skip to content

Commit a825f5a

Browse files
author
José Valim
committed
Force recompilation if dependency was recently fetched
1 parent 3c0d26c commit a825f5a

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ defmodule Mix.Dep.Fetcher do
9696
# it for compilation too, this is our best to try to solve the
9797
# maximum we can at each deps.get and deps.update.
9898
if Enum.all?(all_deps, &available?/1) do
99-
deps = (with_depending(deps, all_deps) ++
100-
Enum.filter(all_deps, fn dep -> not ok?(dep) end))
101-
|> Enum.uniq(&(&1.app))
99+
deps = Enum.uniq_by(with_depending(deps, all_deps), &(&1.app))
102100
end
103101

104102
# Merge the new lock on top of the old to guarantee we don't

lib/mix/lib/mix/tasks/deps.compile.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,11 @@ defmodule Mix.Tasks.Deps.Compile do
100100
"but you are running on v#{System.version}"
101101
end
102102

103+
# Force recompilation on compile status
104+
if dep.status == :compile do
105+
Mix.Dep.Lock.touch_manifest
106+
end
107+
103108
try do
104109
res = Mix.Task.run("compile", ["--no-deps", "--no-elixir-version-check"])
105110
:ok in List.wrap(res)

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,6 @@ defmodule Mix.Tasks.DepsGitTest do
146146
assert_received {:mix_shell, :info, ["Compiled lib/a.ex"]}
147147

148148
# Clear up to prepare for the update
149-
File.rm("_build/dev/lib/git_repo/ebin/Elixir.GitRepo.beam")
150-
File.rm("_build/dev/lib/git_repo/.compile.elixir")
151-
File.rm("deps/git_repo/.fetch")
152149
Mix.Task.clear
153150
Mix.shell.flush
154151
purge [A, B, C, GitRepo]

0 commit comments

Comments
 (0)