Skip to content

Commit b7361ba

Browse files
committed
fix: build engine for elixir 1.16.1 and below versions
1 parent eff68bf commit b7361ba

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

apps/expert/priv/build_engine.exs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,18 @@ Mix.install([{:engine, path: engine_source_path, env: :dev}],
2626
lockfile: Path.join(engine_source_path, "mix.lock")
2727
)
2828

29-
install_path = Mix.install_project_dir()
29+
install_path =
30+
with false <- Version.match?(System.version(), ">= 1.16.2"),
31+
false <- is_nil(Process.whereis(Mix.State)),
32+
cache_id <- Mix.State.get(:installed) do
33+
install_root =
34+
System.get_env("MIX_INSTALL_DIR") || Path.join(Mix.Utils.mix_cache(), "installs")
35+
36+
version = "elixir-#{System.version()}-erts-#{:erlang.system_info(:version)}"
37+
Path.join([install_root, version, cache_id])
38+
else
39+
_ -> Mix.install_project_dir()
40+
end
3041

3142
dev_build_path = Path.join([install_path, "_build", "dev"])
3243
ns_build_path = Path.join([install_path, "_build", "dev_ns"])

0 commit comments

Comments
 (0)