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

fix(runtime): use correct archive locations (e.g. Hex) for bundled Elixir #510

Merged
merged 2 commits into from
Jun 12, 2024

Conversation

soundmonster
Copy link
Contributor

@soundmonster soundmonster commented Jun 5, 2024

Set MIX_ARCHIVES explicitly to make sure to override any existing setting, e.g. from asdf or mise.

What happens on main currently is that hex is installed into whatever the environment variable MIX_ARCHIVES points at. The var is set by e.g. mise. So if the "regular" project setup is running on Elixir < 1.17, its installation of Hex will be overridden by NextLS and it stops working after that.

This patch makes sure to set MIX_ARCHIVES explicitly so the hex archive ends up in the right place.

@soundmonster soundmonster marked this pull request as draft June 5, 2024 14:13
@soundmonster soundmonster marked this pull request as ready for review June 5, 2024 14:30
@soundmonster
Copy link
Contributor Author

After a closer look I realized that installing into the right folder is only one part of it, we also need to make sure we call Hex from that place going forward. Hence the second commit that sets MIX_ARCHIVES in all places where MIX_HOME is being set. This makes sure to override what asdf/mise have set up, so that hex works with bundled mix even if it's not installed outside of the LSP.

@soundmonster soundmonster changed the title fix(runtime): install hex to correct dir fix(runtime): install and use archives to/from correct dirs for bundled Elixir Jun 7, 2024
@soundmonster soundmonster changed the title fix(runtime): install and use archives to/from correct dirs for bundled Elixir fix(runtime): use correct archive locations (e.g. Hex) for bundled Elixir Jun 7, 2024
Set `MIX_ARCHIVES` explicitly to make sure to override any existing
setting, e.g. from `asdf` or `mise`.
@mhanberg mhanberg merged commit 2e9c45f into elixir-tools:main Jun 12, 2024
14 checks passed
@mhanberg
Copy link
Collaborator

Thanks!

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.

2 participants