Skip to content

Commit 2e7bb9b

Browse files
committed
Do not spawn partitions when all dependencies are local and ok, closes #14843
1 parent 83c68ce commit 2e7bb9b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,11 @@ defmodule Mix.Tasks.Deps.Compile do
102102

103103
count = System.get_env("MIX_OS_DEPS_COMPILE_PARTITION_COUNT", "0") |> String.to_integer()
104104

105+
# If all dependencies are local and ok, do not bother starting
106+
# processes as it will likely slow everything down.
105107
compiled? =
106-
if count > 1 and length(deps) > 1 do
108+
if count > 1 and match?([_, _ | _], deps) and
109+
not Enum.all?(deps, &(Mix.Dep.ok?(&1) and not &1.scm.fetchable?())) do
107110
Mix.shell().info("mix deps.compile running across #{count} OS processes")
108111
Mix.Tasks.Deps.Partition.server(deps, count, force?)
109112
else

0 commit comments

Comments
 (0)