Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make remote execution cell work regardless of Elixir and OTP versions #363

Merged
merged 8 commits into from
Nov 8, 2023

Conversation

jonatanklosko
Copy link
Member

🐈‍⬛

lib/kino/rpc.ex Outdated Show resolved Hide resolved
lib/kino/rpc.ex Outdated Show resolved Hide resolved
@mrluc
Copy link

mrluc commented Nov 8, 2023

Haha, seems like an obvious way to fix this in retrospect! There's elixir on the other side, so do version-safe rpc of just Code.eval_string, on a string of user's code, instrumented.

...
    {nil, binding} =
      :erpc.call(node, Code, :eval_string, [   #<-- this line right here
        eval_string,
        [input: {string, binding, opts}],
        [file: @relative_file, line: line]
      ])

    {result, diagnostics} = binding[:output]

    for diagnostic <- diagnostics do
      Code.print_diagnostic(diagnostic)
    end

    case result do
      {:ok, value} ->
        value
...

DECE

lib/kino/rpc.ex Outdated Show resolved Hide resolved
lib/kino/rpc.ex Outdated Show resolved Hide resolved
Co-authored-by: José Valim <[email protected]>
lib/kino/rpc.ex Outdated Show resolved Hide resolved
@jonatanklosko jonatanklosko merged commit f107cfa into main Nov 8, 2023
1 check passed
@jonatanklosko jonatanklosko deleted the jk-remote-eval-string branch November 8, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants