Skip to content

Commit 9708e77

Browse files
committed
Rename env var
1 parent e3fa67a commit 9708e77

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,12 @@ defmodule Mix.Tasks.Deps.Compile do
8383
|> reject_umbrella_children(options)
8484
|> reject_local_deps(options)
8585

86-
count = System.get_env("MIX_DEPS_COMPILE_PARALLEL_COUNT", "0") |> String.to_integer()
86+
count = System.get_env("MIX_OS_DEPS_COMPILE_PARTITION_COUNT", "0") |> String.to_integer()
8787

8888
compiled? =
8989
if count > 1 and length(deps) > count do
90-
Mix.shell().info("mix deps.compile running in parallel with count=#{count}")
91-
Mix.Tasks.Deps.Parallel.server(deps, count, force?)
90+
Mix.shell().info("mix deps.compile running across #{count} OS processes")
91+
Mix.Tasks.Deps.Partition.server(deps, count, force?)
9292
else
9393
config = Mix.Project.deps_config()
9494
true in Enum.map(deps, &compile_single(&1, force?, config))

lib/mix/lib/mix/tasks/deps.parallel.ex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22
# SPDX-FileCopyrightText: 2021 The Elixir Team
33

4-
defmodule Mix.Tasks.Deps.Parallel do
4+
defmodule Mix.Tasks.Deps.Partition do
55
@moduledoc false
66
use Mix.Task
77

@@ -20,7 +20,7 @@ defmodule Mix.Tasks.Deps.Parallel do
2020
defp server(socket, deps, count, force?) do
2121
elixir =
2222
System.find_executable("elixir") ||
23-
raise "cannot find elixir executable for parallel compilation"
23+
raise "cannot find elixir executable for partition compilation"
2424

2525
{:ok, {ip, port}} = :inet.sockname(socket)
2626
ansi_flag = if IO.ANSI.enabled?(), do: ~c"--color", else: ~c"--no-color"
@@ -30,7 +30,7 @@ defmodule Mix.Tasks.Deps.Parallel do
3030
ansi_flag,
3131
~c"-e",
3232
~c"Mix.CLI.main()",
33-
~c"deps.parallel",
33+
~c"deps.partition",
3434
force_flag,
3535
~c"--port",
3636
Integer.to_charlist(port),
@@ -51,7 +51,7 @@ defmodule Mix.Tasks.Deps.Parallel do
5151
clients =
5252
Enum.map(1..count//1, fn index ->
5353
if Mix.debug?() do
54-
IO.puts("-> Starting mix deps.parallel ##{index}")
54+
IO.puts("-> Starting mix deps.partition ##{index}")
5555
end
5656

5757
port = Port.open({:spawn_executable, String.to_charlist(elixir)}, options)
@@ -62,7 +62,7 @@ defmodule Mix.Tasks.Deps.Parallel do
6262

6363
error ->
6464
raise """
65-
could not start parallel dependency compiler, no connection made to TCP port: #{inspect(error)}
65+
could not start partition dependency compiler, no connection made to TCP port: #{inspect(error)}
6666
6767
The spawned operating system process wrote the following output:
6868
#{close_port(port, "")}
@@ -85,7 +85,7 @@ defmodule Mix.Tasks.Deps.Parallel do
8585

8686
{dep, deps} ->
8787
if Mix.debug?() do
88-
Mix.shell().info("-- Sending #{dep.app} to mix deps.parallel #{client.index}")
88+
Mix.shell().info("-- Sending #{dep.app} to mix deps.partition #{client.index}")
8989
end
9090

9191
:gen_tcp.send(client.socket, "#{dep.app}\n")
@@ -110,20 +110,20 @@ defmodule Mix.Tasks.Deps.Parallel do
110110
{client, busy} = pop_with(busy, &(&1.socket == socket))
111111

112112
if Mix.debug?() do
113-
Mix.shell().info("-- mix deps.parallel #{client.index} compiled #{app}")
113+
Mix.shell().info("-- mix deps.partition #{client.index} compiled #{app}")
114114
end
115115

116116
send_deps_and_server_loop([client | available], busy, deps, [{app, status} | completed])
117117

118118
{:tcp_closed, socket} ->
119119
shutdown_clients(available ++ busy)
120-
Mix.shell().error("ERROR! mix deps.parallel #{inspect(socket)} closed unexpectedly")
120+
Mix.shell().error("ERROR! mix deps.partition #{inspect(socket)} closed unexpectedly")
121121

122122
{:tcp_error, socket, error} ->
123123
shutdown_clients(available ++ busy)
124124

125125
Mix.shell().error(
126-
"ERROR! mix deps.parallel #{inspect(socket)} errored: #{inspect(error)}"
126+
"ERROR! mix deps.partition #{inspect(socket)} errored: #{inspect(error)}"
127127
)
128128

129129
{port, {:data, {eol, data}}} ->
@@ -147,7 +147,7 @@ defmodule Mix.Tasks.Deps.Parallel do
147147
defp shutdown_clients(clients) do
148148
Enum.each(clients, fn %{socket: socket, port: port, index: index} ->
149149
if Mix.debug?() do
150-
IO.puts("-> Closing mix deps.parallel ##{index}")
150+
IO.puts("-> Closing mix deps.partition ##{index}")
151151
end
152152

153153
_ = :gen_tcp.close(socket)

0 commit comments

Comments
 (0)