gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
17.39k stars 723 forks source link

Infer minimum Gleam version #3492

Closed lpil closed 1 day ago

lpil commented 1 month ago

Currently you can specify the minimum required Gleam version, but there's nothing to ensure that you have got it correct.

When analysing the code keep track of what features are used and use that to determine what the minimum Gleam version would be, and then complain if the version in gleam.toml is too permissive.

We don't need to worry about v0.* versions.

We could automatically add it to the package config before publishing if none is set.

adamroyle commented 1 month ago

This would be a good addition to gleam fix. It would be ideal if it could look at dependencies as well.

sobolevn commented 3 weeks ago

Questions:

I would say that I would only trust the minimal version number if I have a CI with this version passing and the CI with version-1 is failing. Maybe we can somehow work with this metadata?

lpil commented 3 weeks ago

Just features, we won't attempt to infer for bugs, and we won't depend on any CI systems or such for this information as there's too many factors for us to do it reliably, and it won't tell us the bounds.

giacomocavalieri commented 3 weeks ago

@sobolevn are you planning to work on this? Otherwise I'll be giving it a shot today

sobolevn commented 3 weeks ago

@giacomocavalieri, please, go ahead :) I don't know the project's history well enough to do this.

giacomocavalieri commented 3 weeks ago

So after reading through the changelogs I've written down all the features I think should be taken into account, I'll go with this in the coming PR, please let me know if anything shouldn't be included or if you notice something is missing!

Needs v1.1

Needs v1.2

Needs v1.3

Needs v1.4

Needs v1.5