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

Unify tool version manager detection #766

Open
zachallaun opened this issue Jun 2, 2024 · 1 comment
Open

Unify tool version manager detection #766

zachallaun opened this issue Jun 2, 2024 · 1 comment

Comments

@zachallaun
Copy link
Collaborator

We currently do tool version detection (asdf/mise/system) twice: once in bash when we boot the server, and once in Elixir when we boot the remote control node:

It's fine if we have to do this twice, but we should find a way to share code here. There was a reason I didn't do this immediately when I rewrote the bash side of things, but I don't recall what it was.

@zachallaun
Copy link
Collaborator Author

Here's one way this could be done:

  • start_lexical.sh can be modified to pass the full path as an argument to boot.exs:
    $elixir_command \
      --cookie "lexical" \
      --no-halt \
      "$script_dir/boot.exs" \
      "$(which $elixir_command)"
  • This could then be passed Lexical.Server.Boot.start which could set Application.put_env(:server, :elixir_executable, elixir_executable) (or perhaps Application.put_env(:lexical, ...)?)
  • This app env var could then be read when starting the remote control node instead of going through elixir_executable/0

Doing this would, I think, guarantee that the remote control node always be started using the exact same Elixir executable that started the server. I also believe it would be more future-proof: while Lexical doesn't currently support Windows, this removes a code-path in RemoteControl that assumes a unix-like environment.

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

No branches or pull requests

1 participant