Skip to content

Commit 67109b2

Browse files
author
José Valim
committed
Ensure path dependencies manifests point to the proper path
Closes #1888
1 parent bee0e28 commit 67109b2

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

lib/mix/lib/mix/deps.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,18 @@ defmodule Mix.Deps do
180180
"""
181181
def in_dependency(dep, post_config // [], fun)
182182

183-
def in_dependency(Mix.Dep[app: app, opts: opts], post_config, fun) do
183+
def in_dependency(Mix.Dep[app: app, opts: opts], config, fun) do
184+
# Set the app_path to be the one stored in the dependency.
185+
# This is important because the name of application in the
186+
# mix.exs file can be different than the actual name and we
187+
# choose to respect the one in the mix.exs.
188+
config = Keyword.put(config, :app_path, opts[:build])
184189
env = opts[:env] || :prod
185190
old_env = Mix.env
186191

187192
try do
188193
Mix.env(env)
189-
Mix.Project.in_project(app, opts[:dest], post_config, fun)
194+
Mix.Project.in_project(app, opts[:dest], config, fun)
190195
after
191196
Mix.env(old_env)
192197
end

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

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,7 @@ defmodule Mix.Tasks.Deps.Compile do
8484
:ok
8585
end
8686

87-
defp do_mix(Mix.Dep[app: app, opts: opts] = dep, config) do
88-
# Set the app_path to be the one stored in the dependency.
89-
# This is important because the name of application in the
90-
# mix.exs file can be different than the actual name and we
91-
# choose to respect the one in the mix.exs.
92-
config = Keyword.put(config, :app_path, opts[:build])
93-
87+
defp do_mix(Mix.Dep[app: app] = dep, config) do
9488
Mix.Deps.in_dependency dep, config, fn _ ->
9589
case dev_compilation(app, config) do
9690
{ source, target } ->
@@ -122,7 +116,7 @@ defmodule Mix.Tasks.Deps.Compile do
122116
defp dev_compilation(app, config) do
123117
if config[:build_per_environment] do
124118
source = config[:build_path] |> Path.dirname |> Path.join("dev/lib/#{app}")
125-
target = Mix.Project.manifest_path(config)
119+
target = Mix.Project.manifest_path
126120
source != target && Mix.Deps.Lock.mix_env(source) == to_string(Mix.env) &&
127121
not Mix.Utils.stale?([target], [source]) && { source, target }
128122
else

lib/mix/test/mix/umbrella_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ defmodule Mix.UmbrellaTest do
177177

178178
future = { { 2020, 4, 17 }, { 14, 0, 0 } }
179179

180-
manifest = "../foo/_build/shared/lib/foo/.compile.elixir"
180+
manifest = "_build/shared/lib/foo/.compile.elixir"
181181
File.mkdir_p!(Path.dirname(manifest))
182182
File.touch!(manifest, future)
183183
assert Mix.Tasks.Compile.Elixir.run([]) == :ok

0 commit comments

Comments
 (0)