mirror of
https://github.com/livebook-dev/livebook.git
synced 2026-02-04 15:28:52 +08:00
Fix attached runtime to not rely on Mix
This commit is contained in:
parent
0438c5fbe2
commit
912ec796da
1 changed files with 8 additions and 1 deletions
|
|
@ -855,7 +855,7 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
|||
# We propagate Mix.install/2 project dir in the transient state,
|
||||
# so that future runtimes can set it as the starting point for
|
||||
# Mix.install/2
|
||||
if dir = state.mix_install_project_dir == nil && Mix.install_project_dir() do
|
||||
if dir = state.mix_install_project_dir == nil && mix_install_project_dir() do
|
||||
send(state.owner, {:runtime_transient_state, %{mix_install_project_dir: dir}})
|
||||
%{state | mix_install_project_dir: dir}
|
||||
else
|
||||
|
|
@ -863,6 +863,13 @@ defmodule Livebook.Runtime.ErlDist.RuntimeServer do
|
|||
end
|
||||
end
|
||||
|
||||
defp mix_install_project_dir() do
|
||||
# Make sure Mix is loaded (for attached runtime it may not)
|
||||
if Code.ensure_loaded?(Mix) do
|
||||
Mix.install_project_dir()
|
||||
end
|
||||
end
|
||||
|
||||
defp scan_binding_async(_ref, %{scan_binding: nil} = info, _state), do: info
|
||||
|
||||
# We wait for the current scanning to finish, this way we avoid
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue