You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the current version of Forc is too low, it should error out and tell the user how to update by linking to the Sway Book's page on installing and updating.
Motivation
A common source of user issues is simply an outdated forc. This will eliminate tech support and provide actual information to the end user.
Will also avoid using a library that assumes certain compiler features (e.g. safety checks) from being used in an older codebase.
I think we should definitely have this as it would mean a lot better error messages in many scenarios.
One thing that we may want to keep in mind is checking the required minimum forc version. This may require us to check all dependencies of the project and if the minimum required version coming from the dependencies is higher than the one provided with the root project we may want to produce an error.
For anyone interested in having a go at this, take a look at the forc_pkg::pkg::validate_dep_manifest function introduced in #2234. This is likely where we will want to check for a minimum version within the dependency manifests (this will handle not just direct deps, but transitive deps too). validate_dep_manifest will only handle depedencies however, so we should be sure to check the top-level project's manifest too.
We'll also want to document this entry in the book and mention what forc version the feature was introduced in.
Proposal
Add a field, e.g.
project.forc_version
that defines the minimum version of Forc supported. Example:Cargo ref for similar field: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
If the current version of
Forc
is too low, it should error out and tell the user how to update by linking to the Sway Book's page on installing and updating.Motivation
forc
. This will eliminate tech support and provide actual information to the end user.Misc
cc @mitchmindtree and @kayagokalp for thoughts. Should this also apply transitively?
The text was updated successfully, but these errors were encountered: