1
1
# SPDX-License-Identifier: Apache-2.0
2
2
# SPDX-FileCopyrightText: 2021 The Elixir Team
3
3
4
- defmodule Mix.Tasks.Deps.Parallel do
4
+ defmodule Mix.Tasks.Deps.Partition do
5
5
@ moduledoc false
6
6
use Mix.Task
7
7
@@ -20,7 +20,7 @@ defmodule Mix.Tasks.Deps.Parallel do
20
20
defp server ( socket , deps , count , force? ) do
21
21
elixir =
22
22
System . find_executable ( "elixir" ) ||
23
- raise "cannot find elixir executable for parallel compilation"
23
+ raise "cannot find elixir executable for partition compilation"
24
24
25
25
{ :ok , { ip , port } } = :inet . sockname ( socket )
26
26
ansi_flag = if IO.ANSI . enabled? ( ) , do: ~c" --color" , else: ~c" --no-color"
@@ -30,7 +30,7 @@ defmodule Mix.Tasks.Deps.Parallel do
30
30
ansi_flag ,
31
31
~c" -e" ,
32
32
~c" Mix.CLI.main()" ,
33
- ~c" deps.parallel " ,
33
+ ~c" deps.partition " ,
34
34
force_flag ,
35
35
~c" --port" ,
36
36
Integer . to_charlist ( port ) ,
@@ -51,7 +51,7 @@ defmodule Mix.Tasks.Deps.Parallel do
51
51
clients =
52
52
Enum . map ( 1 .. count // 1 , fn index ->
53
53
if Mix . debug? ( ) do
54
- IO . puts ( "-> Starting mix deps.parallel ##{ index } " )
54
+ IO . puts ( "-> Starting mix deps.partition ##{ index } " )
55
55
end
56
56
57
57
port = Port . open ( { :spawn_executable , String . to_charlist ( elixir ) } , options )
@@ -62,7 +62,7 @@ defmodule Mix.Tasks.Deps.Parallel do
62
62
63
63
error ->
64
64
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 ) }
66
66
67
67
The spawned operating system process wrote the following output:
68
68
#{ close_port ( port , "" ) }
@@ -85,7 +85,7 @@ defmodule Mix.Tasks.Deps.Parallel do
85
85
86
86
{ dep , deps } ->
87
87
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 } " )
89
89
end
90
90
91
91
:gen_tcp . send ( client . socket , "#{ dep . app } \n " )
@@ -110,20 +110,20 @@ defmodule Mix.Tasks.Deps.Parallel do
110
110
{ client , busy } = pop_with ( busy , & ( & 1 . socket == socket ) )
111
111
112
112
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 } " )
114
114
end
115
115
116
116
send_deps_and_server_loop ( [ client | available ] , busy , deps , [ { app , status } | completed ] )
117
117
118
118
{ :tcp_closed , socket } ->
119
119
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" )
121
121
122
122
{ :tcp_error , socket , error } ->
123
123
shutdown_clients ( available ++ busy )
124
124
125
125
Mix . shell ( ) . error (
126
- "ERROR! mix deps.parallel #{ inspect ( socket ) } errored: #{ inspect ( error ) } "
126
+ "ERROR! mix deps.partition #{ inspect ( socket ) } errored: #{ inspect ( error ) } "
127
127
)
128
128
129
129
{ port , { :data , { eol , data } } } ->
@@ -147,7 +147,7 @@ defmodule Mix.Tasks.Deps.Parallel do
147
147
defp shutdown_clients ( clients ) do
148
148
Enum . each ( clients , fn % { socket: socket , port: port , index: index } ->
149
149
if Mix . debug? ( ) do
150
- IO . puts ( "-> Closing mix deps.parallel ##{ index } " )
150
+ IO . puts ( "-> Closing mix deps.partition ##{ index } " )
151
151
end
152
152
153
153
_ = :gen_tcp . close ( socket )
0 commit comments