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

Improve incompatible version errors on boot #389

Merged
merged 4 commits into from
Oct 20, 2023
Merged

Conversation

zachallaun
Copy link
Collaborator

@zachallaun zachallaun commented Sep 25, 2023

This commit makes a few improvements to the errors shown when Lexical boots with incompatible Elixir/Erlang versions:

  • Consistent formatting for all errors
  • Prevent an exception that would occur if using an incompatible major version (e.g. Elixir 1.12)
  • If both Elixir and Erlang are incompatible, show both errors
  • Show full range of compatible versions instead of just the range for the current major version

Example before:

image

Example after:

image

@zachallaun zachallaun requested a review from scohen September 25, 2023 13:13
@zachallaun zachallaun changed the base branch from za-allowed-versions to main September 25, 2023 13:16
Copy link
Collaborator

@scohen scohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried running this under incompatible erlang versions? I don't think it'll even boot.

@zachallaun
Copy link
Collaborator Author

Have you tried running this under incompatible erlang versions? I don't think it'll even boot.

You're right, it doesn't. That check was there previously, however, so I figured there might be some circumstances where it does boot and then fails later.

@zachallaun zachallaun force-pushed the za-boot-cleanup branch 2 times, most recently from bfbaafd to c07c792 Compare September 29, 2023 17:33
Copy link
Collaborator

@scohen scohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My main question is if this will even work for erlang version mismatches. I think it'll only work if we were compiled on an older version and are running on a newer version.

apps/common/lib/lexical/vm/versions.ex Show resolved Hide resolved
apps/server/lib/lexical/server/boot.ex Show resolved Hide resolved
apps/server/lib/lexical/server/boot.ex Outdated Show resolved Hide resolved
@zachallaun
Copy link
Collaborator Author

@scohen Updated this based on your feedback.

My main question is if this will even work for erlang version mismatches. I think it'll only work if we were compiled on an older version and are running on a newer version.

I think you're right -- packaging_errors is very likely useless because Erlang won't boot. packaging_errors was there to replace verify_packaging, which I believe had the exact same problem. Should we just get rid of packaging_errors entirely?

@scohen
Copy link
Collaborator

scohen commented Oct 13, 2023

Should we just get rid of packaging_errors entirely?

Yes.

This commit makes a few improvements to the errors shown when Lexical
boots with incompatible Elixir/Erlang versions:

* Consistent formatting for all errors
* Prevent an exception that would occur if using an incompatible major
  version (e.g. Elixir 1.12)
* If both Elixir and Erlang are incompatible, show both errors
* Show full range of compatible versions instead of just the range for
  the current major version
@zachallaun zachallaun merged commit cb138a8 into main Oct 20, 2023
@zachallaun zachallaun deleted the za-boot-cleanup branch October 20, 2023 17:44
zachallaun added a commit that referenced this pull request Oct 20, 2023
This commit makes a few improvements to the errors shown when Lexical
boots with incompatible Elixir/Erlang versions:

* Consistent formatting for all errors
* Prevent an exception that would occur if using an incompatible major
  version (e.g. Elixir 1.12)
* If both Elixir and Erlang are incompatible, show both errors
* Show full range of compatible versions instead of just the range for
  the current major version
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