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 specifying of the minimum required Inko version in inko.pkg #723

Closed
yorickpeterse opened this issue Jun 18, 2024 · 3 comments · Fixed by #739
Closed

Allow specifying of the minimum required Inko version in inko.pkg #723

yorickpeterse opened this issue Jun 18, 2024 · 3 comments · Fixed by #739
Labels
accepting contributions Issues that are suitable to be worked on by anybody, not just maintainers compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module
Milestone

Comments

@yorickpeterse
Copy link
Collaborator

yorickpeterse commented Jun 18, 2024

Description

inko.pkg is used to specify the dependencies of a project. I'd like to extend it to also support specifying the minimum Inko version required to build the project.

The syntax for the rule is require inko X.Y.Z, i.e. require inko 0.15.0, such that a final inko.pkg might look like this:

require inko 0.15.0
require https://github.com/yorickpeterse/inko-optparse 0.3.0 ce2d3df0ffc4be53a83e2ca8e4e1a190f57e837e

Since inko isn't a valid URL, this won't introduce any conflicts with package dependencies.

When running inko build, we then check if the used version of Inko is compatible with the required minimum version. The version check is based on semantic versioning, meaning that e.g. 0.16.0 isn't compatible with a minimum 0.15.0, but 1.2.3 is compatible with a minimum of 1.1.0.

The check should be performed before we parse any Inko source code, and the compiler should terminate with an error if the versions aren't compatible. For dependencies in ./dep we should also verify the version requirements. We need to do this every time inko build runs as one may upgrade an Inko version without running inko pkg sync (e.g. because there's no need for this).

If a package doesn't provide an inko.pkg file, we just build it without performing any checks.

Related work

No response

@yorickpeterse yorickpeterse added accepting contributions Issues that are suitable to be worked on by anybody, not just maintainers feature New things to add to Inko, such as a new standard library module compiler Changes related to the compiler labels Jun 18, 2024
@uasi
Copy link
Contributor

uasi commented Aug 9, 2024

Should we allow to specify that a module is compatible with multiple major or 0.minor versions, such as Inko 0.15.0 and 0.16.0? If so, how should we format those specifiers?

# Multiple lines (I think this is confusing. Does this require _both_ versions to be installed?)
require inko 0.15.0
require inko 0.16.0

# Multiple fields
require inko 0.15.0 0.16.0

@yorickpeterse
Copy link
Collaborator Author

@uasi The version would be the minimum required version, similar to how we do this for packages. This means that if your package is compatible with both 0.15.0 and 0.16.0, you'd simply specify 0.15.0 as the version.

If multiple require inko lines exist in the same manifest, we should produce an error as this is almost guaranteed to be a mistake by the user.

@yorickpeterse
Copy link
Collaborator Author

To add to that: looking at our version selection logic for packages, it seems that we treat 0.X and 0.Y as compatible, but following semantic versioning that isn't necessarily the case. While we probably should enforce semantic versioning there (meaning 0.23.1 isn't compatible with 0.24.0), if we do this for the Inko version this can be rather annoying, as you'd have to update your package every 0.X release.

Based on this we should just treat the version as the minimum regardless of semantic versioning, and I'll create a separate issue for handling 0.X versions per semantic versioning.

yorickpeterse pushed a commit to uasi/inko that referenced this issue Aug 11, 2024
This adds support for specifying a minimum version of Inko that's
required to build a project. Semantic versioning isn't applied, meaning
that a minimum requirement of 0.15.0 is satisfied by 0.16.0, 1.2.3, etc.

This fixes inko-lang#723.

Changelog: added
yorickpeterse pushed a commit to uasi/inko that referenced this issue Aug 11, 2024
This adds support for specifying a minimum version of Inko that's
required to build a project. Semantic versioning isn't applied, meaning
that a minimum requirement of 0.15.0 is satisfied by 0.16.0, 1.2.3, etc.

This fixes inko-lang#723.

Changelog: added
yorickpeterse pushed a commit to uasi/inko that referenced this issue Aug 11, 2024
This adds support for specifying a minimum version of Inko that's
required to build a project. Semantic versioning isn't applied, meaning
that a minimum requirement of 0.15.0 is satisfied by 0.16.0, 1.2.3, etc.

This fixes inko-lang#723.

Changelog: added
@yorickpeterse yorickpeterse added this to the 0.16.0 milestone Aug 12, 2024
yorickpeterse pushed a commit to uasi/inko that referenced this issue Aug 12, 2024
This adds support for specifying a minimum version of Inko that's
required to build a project. Semantic versioning isn't applied, meaning
that a minimum requirement of 0.15.0 is satisfied by 0.16.0, 1.2.3, etc.

This fixes inko-lang#723.

Changelog: added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepting contributions Issues that are suitable to be worked on by anybody, not just maintainers compiler Changes related to the compiler feature New things to add to Inko, such as a new standard library module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants