Skip to content

fix: support multiple elixir versions on multiroot projects#413

Merged
doorgan merged 3 commits intomainfrom
doorgan/multiroot-ex-versions
Feb 24, 2026
Merged

fix: support multiple elixir versions on multiroot projects#413
doorgan merged 3 commits intomainfrom
doorgan/multiroot-ex-versions

Conversation

@doorgan
Copy link
Collaborator

@doorgan doorgan commented Feb 19, 2026

#344 fixed the case when SHELL isn't available and we can't use it to find elixir, but apparently that change causes us to only be able to find a single elixir version in a multiroot project, so we need the shell approach too.

This PR reintroduces the shell approach, and adds the #344 as a fallback if SHELL is not available.

Testing this I also found that having multiple projects with different elixir versions made them download different hex versions, and that sporadically caused issues on my tests, so I had to make expert remove more environment variables than we did before.

Also on windows I am now using mise, which has the elixir shim as elixir.cmd and Expert was struggling to find it even if it was in the path.

@doorgan doorgan force-pushed the doorgan/multiroot-ex-versions branch 3 times, most recently from cd60477 to 3a54178 Compare February 19, 2026 08:19
@doorgan doorgan force-pushed the doorgan/multiroot-ex-versions branch from 3a54178 to 245f890 Compare February 19, 2026 08:28
@doorgan doorgan marked this pull request as ready for review February 20, 2026 20:26
@doorgan
Copy link
Collaborator Author

doorgan commented Feb 20, 2026

@giddie could you verify if this PR works in your setup? Thank you!

@giddie
Copy link
Contributor

giddie commented Feb 23, 2026

Yeah, still seems OK. Looks like the fallback is working as intended 👍

@doorgan doorgan merged commit dee595d into main Feb 24, 2026
37 checks passed
@doorgan doorgan deleted the doorgan/multiroot-ex-versions branch February 24, 2026 00:58
mhanberg pushed a commit that referenced this pull request Feb 24, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.1.0-rc.2](v0.1.0-rc.1...v0.1.0-rc.2)
(2026-02-24)


### Features

* add `instance_id` metadata to logs
([#380](#380))
([5c209be](5c209be))


### Bug Fixes

* ensure `MIX_BUILD_PATH` is set for child processes
([#436](#436))
([3178302](3178302))
* **expert:** check start_child return in initialized handler
([#371](#371))
([de979ce](de979ce))
* forward logs through window log handler
([#418](#418))
([c608dc8](c608dc8)),
closes [#382](#382)
* support multiple elixir versions on multiroot projects
([#413](#413))
([dee595d](dee595d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@mhanberg
Copy link
Member

@doorgan unfortunately I think this patch is making it not work for folks (like myself) who use Nix and devshells.

The devshell puts the locations of the tools it installs directly in the path, and doesn't activate when we boot a login shell in the project directory because the user might be using direnv to load it or they manually do nix develop to enter the devShell.

So when we reset the PATH to do the login shell, all those exes are lost and it can't find them (and they might not be installed globally)

@giddie
Copy link
Contributor

giddie commented Feb 25, 2026

@mhanberg Does the fallback method work if you unset SHELL?

@mhanberg
Copy link
Member

Looking at the logs, showing this for me right now

09:04:09.841 instance_id=19C951D4626 [warning] Failed to find elixir for project, falling back to packaged elixir: Couldn't find an elixir executable for project at /home/mitchell/src/expert/apps/expert. Using shell at /nix/store/ghzs95qyvdr92d45xx52vfa778qhw908-zsh-5.9/bin/zsh with PATH=/home/mitchell/.bin:/home/mitchell/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/home/mitchell/.config/zsh/plugins/ohmyzsh-key-bindings

09:04:09.936 instance_id=19C951D4626 [warning] Failed to find erl for project, falling back to packaged elixir: Couldn't find an erl executable for project at /home/mitchell/src/expert/apps/expert. Using shell at /nix/store/ghzs95qyvdr92d45xx52vfa778qhw908-zsh-5.9/bin/zsh with PATH=/home/mitchell/.bin:/home/mitchell/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/home/mitchell/.config/zsh/plugins/ohmyzsh-key-bindings

09:04:09.936 instance_id=19C951D4626 [info] [Project file:///home/mitchell/src/expert/apps/expert] Using path: /nix/store/yxkzbzkqybrwlsswy18cxff7zrsv4drw-expert-0.1.0-rc.2-/erts-15.2.7.5/bin:/nix/store/yxkzbzkqybrwlsswy18cxff7zrsv4drw-expert-0.1.0-rc.2-/bin:/nix/store/i2vmgx46q9hd3z6rigaiman3wl3i2gc4-coreutils-9.9/bin:/nix/store/ryz8kcrm2bxpccllfqlb7qldsfnqp5c2-gnused-4.9/bin:/nix/store/02vv0r262agf9j5n2y1gmbjvdf12zkl0-gnugrep-3.12/bin:/nix/store/2xq9rayckw8zq26k274xxlikn77jn60j-gawk-5.3.2/bin:/nix/store/797dxmvb5g0492zwlq5cn6h8k4h8i8y3-elixir-1.17.3/bin:/nix/store/x30vwvjkck78yichkws5jdrx8lwjz19m-erlang-27.3.4.1/bin:/nix/store/fb7bcmpn0v08b7mr28qss0p7bn9g2dh9-inotify-tools-4.25.9.0/bin:/nix/store/fqc2w0lqhnfilywlf8q2r6dc98q9ppby-alejandra-4.0.0/bin:/nix/store/anhqgh20jqazy2h03h97rlv6kcl88qq7-zig-0.15.2/bin:/nix/store/zys6d102zp171wpwcs08g632886w2qxs-xz-5.8.2-bin/bin:/nix/store/n4g7fjn0b4m0rfjaqw2y4czvz6za1iwr-just-1.46.0/bin:/nix/store/bck5lpyz0sphkv0vnq8isigjaa1854qz-7zz-25.01/bin:/nix/store/ipwndaag56mm8g8gn8j98z0jvn8x4mk1-git-2.52.0/bin:/nix/store/c2p7haf4zzkbrir9zs662r68c5dmylbq-patchelf-0.15.2/bin:/nix/store/a245z3cvf9x9sn0xlk6k8j9xhxbhda1z-gcc-wrapper-15.2.0/bin:/nix/store/mjf8jlq9grydcdvyw6hb063x5c34g5gf-gcc-15.2.0/bin:/nix/store/0bdqq2z98kg2hfn3k60if6pb5fd5p10h-glibc-2.42-47-bin/bin:/nix/store/i6ppbrlpp6yki8qvka7nyv091xa8dchx-binutils-wrapper-2.44/bin:/nix/store/47mn80zqpygykqailwzw8zlag4cgl75q-binutils-2.44/bin:/nix/store/i2vmgx46q9hd3z6rigaiman3wl3i2gc4-coreutils-9.9/bin:/nix/store/16wfacfgap3chf7mcjnd8dwi85dj4qqi-findutils-4.10.0/bin:/nix/store/3p87h6dn5i87i3iq9364imzbqgwvkg2p-diffutils-3.12/bin:/nix/store/qyg62bc2xnpwz0fa9prqxvvk00zj4g9q-gnutar-1.35/bin:/nix/store/84yyzmxs7mb8nhkvcfv9n1l9irpb6mnq-gzip-1.14/bin:/nix/store/90yw24gqmwph4xjp4mqhpx1y1gcrvqla-bzip2-1.0.8-bin/bin:/nix/store/vbah5c4rzy1q1hbqhginyxjhj8d4dj8j-gnumake-4.4.1/bin:/nix/store/f15k3dpilmiyv6zgpib289rnjykgr1r4-bash-5.3p9/bin:/nix/store/wwij6563c6wbg4kzgjhng7vlhf7api19-patch-2.8/bin:/nix/store/zys6d102zp171wpwcs08g632886w2qxs-xz-5.8.2-bin/bin:/nix/store/nyy0bvgjwd98x7ih8pl6pr79qjljgsf7-file-5.45/bin:/home/mitchell/src/expert/.direnv/bin:/home/mitchell/.yarn/bin:/home/mitchell/.bin:/home/mitchell/.bin:/home/mitchell/.bin:/run/wrappers/bin:/home/mitchell/.nix-profile/bin:/nix/profile/bin:/home/mitchell/.local/state/nix/profile/bin:/etc/profiles/per-user/mitchell/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/mitchell/.config/zsh/plugins/ohmyzsh-key-bindings:/nix/store/67lzqabpcabrvlrady7hbd2s4zs08fd1-wl-clipboard-2.2.1/bin

09:04:09.936 instance_id=19C951D4626 [debug] sent notification server -> client window/logMessage

09:04:09.936 instance_id=19C951D4626 [info] [Project file:///home/mitchell/src/expert/apps/expert] Found elixir executable at /nix/store/797dxmvb5g0492zwlq5cn6h8k4h8i8y3-elixir-1.17.3/bin/elixir

09:04:09.936 instance_id=19C951D4626 [debug] sent notification server -> client window/logMessage

09:04:09.936 instance_id=19C951D4626 [info] [Project file:///home/mitchell/src/expert/apps/expert] Found erl executable at /nix/store/yxkzbzkqybrwlsswy18cxff7zrsv4drw-expert-0.1.0-rc.2-/erts-15.2.7.5/bin/erl

I think it finding the erl from the expert build might be related to the nix packaging right now. It did actually end up finding the right elixir tho.

@doorgan
Copy link
Collaborator Author

doorgan commented Feb 25, 2026

I'm confused, this PR brings back old behavior. I'll take another look because it's odd that it reports failure to find the executables, but then finds them all of a sudden

@doorgan
Copy link
Collaborator Author

doorgan commented Feb 25, 2026

@mhanberg I did some more investigation and I think #456 should have fixed your issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants