Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/mix/lib/mix/dep.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ defmodule Mix.Dep do
scm: Mix.SCM.t(),
app: atom,
requirement: String.t() | Regex.t() | nil,
status: atom,
status: {:ok, String.t() | nil} | atom | tuple,
opts: keyword,
top_level: boolean,
manager: :rebar | :rebar3 | :mix | :make | nil,
Expand Down
11 changes: 4 additions & 7 deletions lib/mix/lib/mix/dep/fetcher.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ defmodule Mix.Dep.Fetcher do
end

if new do
File.touch!(Path.join(opts[:dest], ".fetch"))
dep = put_in(dep.opts[:lock], new)
{dep, [app | acc], Map.put(lock, app, new)}
else
Expand Down Expand Up @@ -92,22 +93,18 @@ defmodule Mix.Dep.Fetcher do
# dependency is missing, it could directly affect one of the
# dependencies we are trying to compile, causing the whole thing
# to fail.
#
# If there is any other dependency that is not ok, we include
# it for compilation too, this is our best to try to solve the
# maximum we can at each deps.get and deps.update.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed this comment since it doesn't seem to be true?

deps =
parent_deps =
if Enum.all?(all_deps, &available?/1) do
Enum.uniq_by(with_depending(deps, all_deps), & &1.app)
else
deps
[]
Copy link
Member Author

@ericmj ericmj Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have to mark these as fetched since they are marked immediately after fetching.

end

# Merge the new lock on top of the old to guarantee we don't
# leave out things that could not be fetched and save it.
lock = Map.merge(old_lock, new_lock)
Mix.Dep.Lock.write(lock)
mark_as_fetched(deps)
mark_as_fetched(parent_deps)

# See if any of the deps diverged and abort.
show_diverged!(Enum.filter(all_deps, &Mix.Dep.diverged?/1))
Expand Down