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

Allow pre-release versions in attached runtime version check #2905

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

SteffenDE
Copy link
Contributor

I often run with the most recent Elixir version from GitHub locally. Currently Livebook does not allow connecting nodes both running 1.19.0-dev because

Connecting runtime failed - the node uses Elixir 1.19.0-dev, but ~> 1.19.0 is required

This PR changes the minor check to include a -dev suffix. I think any suffix would do, but that's what Elixir uses.

@CLAassistant
Copy link

CLAassistant commented Jan 2, 2025

CLA assistant check
All committers have signed the CLA.

Comment on lines 94 to 95
current = Version.parse!(System.version())
same_minor = "#{current.major}.#{current.minor}.0"
same_minor = "#{current.major}.#{current.minor}.0-dev"
Copy link
Member

@jonatanklosko jonatanklosko Jan 2, 2025

Choose a reason for hiding this comment

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

What about this?

current = System.version()

same_minor =
  current
  |> Version.parse!()
  |> Map.replace!(:patch, 0)
  |> Version.to_string()

This means that if Livebook is running on -dev, we include -dev in the requirement, otherwise we don't.

If the user is not used to running Elixir main, showing -dev in the error message may be unnecessarily confusing.

(Note the intentional current = System.version(), it's expected to be a string below, currently it is a bug)

Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Thanks!

@jonatanklosko jonatanklosko changed the title allow pre-release versions in elixir_version_requirement check Allow pre-release versions in attached runtime version check Jan 2, 2025
@jonatanklosko jonatanklosko merged commit 0438c5f into livebook-dev:main Jan 2, 2025
1 check passed
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