-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Specify minimum supported Rust version in fuels-rs
manifest
#243
Conversation
This ensures that users are warned in the case that their installed Rust version predates the version required by `fuels-rs`. This should be particularly useful in `forc`-generated harnesses, as I believe we've already had a couple of reports of strange compile errors that just required a Rust version update. You can find documentation on this field [here][1]: [1]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field
d6ada24
to
58db256
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but will defer to @digorithm
I'm just realising we should probably have another CI check that uses the minimum specified version to I'm unsure whether or not specifying the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure whether or not specifying the rust-version like this will cause cargo to automatically error on use of language features that became available after the specified version - I suspect that it won't.
Yeah, that would be very weird. I think it should be fine.
* add ci check to ensure toolchains match
@adlerjohn Can you help me understand why we did this, this way?
(I have no answers here, I'm just curious) |
@ra0x3 fuel-rs is independent of forc. For example in our faucet app, we use the SDK to send genesis coins to users without interacting with contracts or forc at all. Forc is a sway app dev tool, but SDK usecases can go far beyond that. |
Put another way, fuels-rs is independent of the particular high level language used. |
Thanks for finishing this off / landing this! |
This ensures that users are warned in the case that their installed Rust version predates the version required by
fuels-rs
.This should be particularly useful for users building
forc
-generated test harnesses, as I believe we've already had a couple of reports of strange compile errors that just required a Rust version update.You can find documentation on this field here.
Originally I had planned on exposing this minimum required Rust version from a function in the crate root like so. The idea was that
forc
could use this function to specify the necessaryrust-version
field in the generated test harness manifest files.However after thinking on this a little more, I realised it should be enough to simply specify the minimum required version here as
fuels
will be a dependency within the generated test harness anyway, meaning the user will be notified either way. As a result, I believe this closes FuelLabs/sway#1239.