Skip to content

Commit 72eb5c7

Browse files
committed
Do not unload deps for MIX_NO_DEPS=1
Signed-off-by: Eric Meadows-Jönsson <eric.meadows.jonsson@gmail.com>
1 parent 982aba3 commit 72eb5c7

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

foo.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
diff --git a/lib/mix/lib/mix/tasks/deps.loadpaths.ex b/lib/mix/lib/mix/tasks/deps.loadpaths.ex
2+
index 671db2a..8ef1361 100644
3+
--- a/lib/mix/lib/mix/tasks/deps.loadpaths.ex
4+
+++ b/lib/mix/lib/mix/tasks/deps.loadpaths.ex
5+
@@ -33,7 +33,9 @@ defmodule Mix.Tasks.Deps.Loadpaths do
6+
path
7+
end
8+

9+
- prune_deps(load_paths, "--no-deps-check" in args or System.get_env("MIX_NO_DEPS") in ~w(1 true))
10+
+ unless "--no-deps-check" in args or System.get_env("MIX_NO_DEPS") in ~w(1 true) do
11+
+ prune_deps(load_paths)
12+
+ end
13+
end
14+

15+
# If the build is per environment, we should be able to look
16+
@@ -46,11 +48,10 @@ defmodule Mix.Tasks.Deps.Loadpaths do
17+
# We also expect env_path to be nil. If it is not nil, it means
18+
# it was set by a parent application and the parent application
19+
# should be the one doing the pruning.
20+
- defp prune_deps(load_paths, no_check?) do
21+
+ defp prune_deps(load_paths) do
22+
config = Mix.Project.config
23+

24+
- shared_build? =
25+
- no_check? or config[:build_path] != nil or config[:build_per_environment] == false
26+
+ shared_build? = config[:build_path] != nil or config[:build_per_environment] == false
27+

28+
config
29+
|> Mix.Project.build_path

lib/mix/lib/mix/tasks/deps.loadpaths.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ defmodule Mix.Tasks.Deps.Loadpaths do
3333
path
3434
end
3535

36-
prune_deps(load_paths, "--no-deps-check" in args or System.get_env("MIX_NO_DEPS") in ~w(1 true))
36+
unless System.get_env("MIX_NO_DEPS") in ~w(1 true) do
37+
prune_deps(load_paths, "--no-deps-check" in args)
38+
end
3739
end
3840

3941
# If the build is per environment, we should be able to look

0 commit comments

Comments
 (0)