Skip to content

Commit 4f7d0bf

Browse files
committedMar 24, 2025·
Explicitly set env var
1 parent 8216f0e commit 4f7d0bf

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed
 

‎lib/mix/lib/mix/tasks/deps.partition.ex

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ defmodule Mix.Tasks.Deps.Partition do
2121

2222
defp server(socket, deps, count, force?) do
2323
elixir =
24-
System.find_executable("elixir") ||
24+
System.get_env("MIX_OS_DEPS_COMPILE_PARTITION_ELIXIR_EXECUTABLE") ||
25+
System.find_executable("elixir") ||
2526
raise "cannot find elixir executable for partition compilation"
2627

2728
{:ok, {ip, port}} = :inet.sockname(socket)

‎lib/mix/test/test_helper.exs

+14-8
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,6 @@ ExUnit.start(
4949
include: line_include
5050
)
5151

52-
# Clear environment variables that may affect tests
53-
Enum.each(
54-
~w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY) ++
55-
~w(MIX_ENV MIX_OS_DEPS_COMPILE_PARTITION_COUNT MIX_TARGET) ++
56-
~w(XDG_DATA_HOME XDG_CONFIG_HOME),
57-
&System.delete_env/1
58-
)
59-
6052
defmodule MixTest.Case do
6153
use ExUnit.CaseTemplate
6254

@@ -249,6 +241,20 @@ defmodule MixTest.Case do
249241
end
250242
end
251243

244+
# Prepare and clear environment variables
245+
System.put_env(
246+
"MIX_OS_DEPS_COMPILE_PARTITION_ELIXIR_EXECUTABLE",
247+
MixTest.Case.elixir_executable()
248+
)
249+
250+
# Clear environment variables that may affect tests
251+
Enum.each(
252+
~w(http_proxy https_proxy HTTP_PROXY HTTPS_PROXY) ++
253+
~w(MIX_ENV MIX_OS_DEPS_COMPILE_PARTITION_COUNT MIX_TARGET) ++
254+
~w(XDG_DATA_HOME XDG_CONFIG_HOME),
255+
&System.delete_env/1
256+
)
257+
252258
## Set up Rebar fixtures
253259

254260
rebar3_source = System.get_env("REBAR3") || Path.expand("fixtures/rebar3", __DIR__)

0 commit comments

Comments
 (0)