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

Tracking issue for MSRV project #445

Closed
32 tasks done
adamgreig opened this issue Apr 14, 2020 · 13 comments
Closed
32 tasks done

Tracking issue for MSRV project #445

adamgreig opened this issue Apr 14, 2020 · 13 comments

Comments

@adamgreig
Copy link
Member

adamgreig commented Apr 14, 2020

This is a tracking issue for progress on #443.

Here's a link to the project document which explains the project in more detail.

How To Help

We're trying to make sure all WG crates have a well defined Minimum Supported Rust Version (MSRV), which is the oldest version of Rust that can build the crate and run its tests. All our crates should have their MSRV defined in their documentation, and have their CI system automatically run the tests using the MSRV to make sure we don't accidentally break it.

Getting Started

Thank you for your interest in helping! Depending on your skill level, you might find it easiest to just jump in, or you might want more assistance getting going. If you want to just jump in, pick an unclaimed repository from the list below and follow the steps. You can post here that you're working on a project, or just go ahead and open a PR if it's fairly quick.

If you'd like more assistance, please either leave a comment here, or message @adamgreig:matrix.org on the Rust Embedded Matrix, and we'll get you started!

1. Check Current Status

It might be that your repository already has its MSRV documented and/or tested, so it's worth reviewing the steps below quickly to see if this is the case. For repositories where the MSRV is documented and tested, we can tick them off this list with no further work. Please leave a comment here if that's the case!

Otherwise, go ahead and fork the repository from GitHub.

2. Finding the MSRV

First, make sure you can build the crate and run the tests. For most WG repositories, that means running their ci/script.sh script:

$ ci/script.sh

Many of our crates build for multiple targets, which is usually defined in their .travis.yml CI configuration file. To run your build for a different target, for example thumbv6m-none-eabi:

$ env TARGET=thumbv6m-none-eabi ci/script.sh

Once the build works on your default Rust toolchain, you'll need to test it on other toolchains. To install a custom toolchain (here 1.40.0), a target for it, and then run tests with it:

$ rustup toolchain install 1.40.0
$ rustup target add thumbv6m-none-eabi --toolchain 1.40.0
$ env TARGET=thumbv6m-none-eabi RUSTUP_TOOLCHAIN=stable ci/script.sh

Once you have this working, the game is to keep reducing the Rust version until it stops working, at which point you've found the MSRV. It might stop working for a trivial reason that is easily fixed, in which case it could be worth fixing and lowering the MSRV further, but we'll have to decide such issues on a case-by-case basis. We don't expect to go any lower than 1.31 (the first 2018 edition release), but would hope to get at least 1.40 in every case. Ten releases to try!

On the other hand, if this doesn't work for some reason (some projects have more complicated CI setups), please leave a comment here or open an issue on the relevant repository and we'll help figure out what to do.

3. Documenting the MSRV

Once the MSRV is found, add the following snippet to the project's README.md, src/lib.rs, or equivalent documentation:

# Minimum Supported Rust Version (MSRV)

This crate is guaranteed to compile on stable Rust 1.31.0 and up. It *might*
compile with older versions but that may change in any new patch release.

4. Testing the MSRV

To have the CI system run the tests on the MSRV, add the following snippet to the repository's .travis.yml configuration file. Note that the matrix section probably already exists; you want to add a new entry to it for the MSRV test.

matrix:
  include:
    # MSRV
    - env: TARGET=thumbv7-none-eabi
      rust: 1.31.0
    # ...

Many projects test on multiple targets, so add an MSRV entry for each target. If in doubt, seek advice on this issue or on the specific project.

5. Finishing Up

Make a GitHub PR with your changes and link it here. We'll use the PR to review and discuss the change and then get your changes merged in.

Crates Checklist

We'll update this list with a user who's working on that repository, a link to the relevant PR when opened, and tick off crates that are complete.

@teskje
Copy link

teskje commented Apr 14, 2020

I'd like to help out! I'll take the embedded-hal crate if nobody minds.

Edit: Oh, nvm, that already has a tested MSRV of 1.35. Can be ticked in the list.

@teskje
Copy link

teskje commented Apr 14, 2020

Here are the others that already have a MSRV:

  • rust-spidev (1.31)
  • rust-sysfs-gpio (1.31)
  • rust-sysfs-pwm (1.28)
  • svd2rust (1.37)

@ericevenchick
Copy link

Put something together to automate this, here are my results so far

repos/alloc-cortex-m: MSRV = nightly
repos/arm-dcc: MSRV = 1.31.0
repos/bare-metal: MSRV = 1.31.0
repos/cargo-binutils: MSRV = 1.32.0
repos/cortex-a: MSRV = nightly
repos/cortex-m: MSRV = 1.31.0
repos/cortex-m-rt: MSRV = 1.31.0
repos/cortex-m-semihosting: MSRV = 1.32.0
repos/cortex-r: MSRV = 1.31.0
repos/cross: MSRV = 1.32.0
repos/embedded-hal: MSRV = 1.31.0
repos/fixedvec-rs: MSRV = 1.30.0
repos/gpio-cdev: MSRV = 1.31.0
repos/gpio-utils: MSRV = 1.30.0
repos/itm: MSRV = 1.32.0
repos/linux-embedded-hal: MSRV = 1.32.0
repos/msp430: MSRV = nightly
repos/msp430-rt: MSRV = nightly
repos/mutex-trait: MSRV = 1.31.0
repos/panic-itm: MSRV = 1.31.0
repos/panic-semihosting: MSRV = 1.32.0
repos/r0: MSRV = 1.31.0
repos/register-rs: MSRV = nightly
repos/riscv: MSRV = 1.30.0
repos/riscv-rt: MSRV = 1.31.0
repos/rust-i2cdev: MSRV = 1.31.0
repos/rust-spidev: MSRV = 1.31.0
repos/rust-sysfs-gpio: MSRV = 1.31.0
repos/rust-sysfs-pwm: MSRV = 1.30.0
repos/svd: MSRV = 1.37.0
repos/svd2rust: MSRV = 1.36.0

All of the "nightly" MSRVs are due to #![feature] being used on the stable channel.

error[E0554]: `#![feature]` may not be used on the stable release channel

I have only tested from 1.30.0 to 1.42.0.

@adamgreig
Copy link
Member Author

Here are the others that already have a MSRV:

  • rust-spidev (1.31)
  • rust-sysfs-gpio (1.31)
  • rust-sysfs-pwm (1.28)
  • svd2rust (1.37)

Thanks for checking! I noticed most of those (and embedded-hal) specify the MSRV in their README instead of in the crate documentation, but I think that's just as effective. svd2rust itself doesn't actually say "MSRV" anywhere, though the README does mention it briefly. It might be worth a quick PR to just include the standard wording.

Put something together to automate this, here are my results so far

Amazing, thanks!

@teskje
Copy link

teskje commented Apr 18, 2020

I noticed most of those (and embedded-hal) specify the MSRV in their README instead of in the crate documentation, but I think that's just as effective.

True. Would it make sense to update the "Documenting the MSRV" to mention the README instead of lib.rs, so it gets done consistently? Or alternatively, should we update those crates to list the MSRV at both places?

@nastevens
Copy link
Member

I think it would make sense to incorporate it in both - the README is front and center on crates.io, but the top-level rustdoc is what appears on docs.rs.

@teskje
Copy link

teskje commented Apr 18, 2020

On the other hand it appears to be common practice in Rust projects to document the MSRV in the README only. Personally I wouldn't expect it to be documented on docs.rs, that is more like a reference to me and I usually have gone through the README on GitHub or crates.io before getting there. That doesn't mean putting it into the crate module docs would hurt, although there is some added maintenance burden of one more place to be updated when the MSRV is increased.

@teskje
Copy link

teskje commented Apr 19, 2020

cortex-m also already documents and tests its MSRV and can be ticked. Though in this case, the MSRV is documented only in the rustdoc, not the README.

@adamgreig
Copy link
Member Author

I think historically a lot of rust-embedded crates had very minimal READMEs with pretty much just a link to the documentation; personally I'm all in favour of more fully-fledged READMEs alongside the docs. As @nastevens points out, the README is the first thing a user sees on crates.io and on GitHub, while the documentation is what you see once you're on docs.rs, so I think it makes perfect sense to have the MSRV in the README first and foremost.

It is a bit of a pain to have the MSRV duplicated in the README and documentation as well as the CI config file, but maybe worth it for having the MSRV clear in both locations. Anyone else have thoughts on the matter? I'm happy to update the relevant docs to say the MSRV should be documented in the README/both places.

bors bot added a commit to rust-embedded/r0 that referenced this issue Apr 19, 2020
22: Document and test MSRV 1.31.0 r=almindor a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

Co-authored-by: Jan Teske <jteske@posteo.net>
bors bot added a commit to rust-embedded/bare-metal that referenced this issue Apr 19, 2020
31: Document and test MSRV 1.31.0 r=almindor a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

Co-authored-by: Jan Teske <jteske@posteo.net>
bors bot added a commit to rust-embedded/svd2rust that referenced this issue Apr 19, 2020
436: Use standard wording for the MSRV note r=ryankurte a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

svd2rust already has its MSRV documented and tested, but @adamgreig suggested updating it to use the standard wording. Since this is a special case in that the MSRV applies to the generated code, not svd2rust itself, the standard wording doesn't fully apply, so I changed it in a (hopefully) sensible way.

An open question is: Should we also document the MSRV of svd2rust itself? Looking at how the CI works, currently it's implicitly guaranteed to be the same version als the MSRV for the generated code, so we could just extend the note in the README to also include svd2rust itself.

Co-authored-by: Jan Teske <jteske@posteo.net>
bors bot added a commit to rust-embedded/svd2rust that referenced this issue Apr 20, 2020
436: Use standard wording for the MSRV note r=therealprof a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

svd2rust already has its MSRV documented and tested, but @adamgreig suggested updating it to use the standard wording. Since this is a special case in that the MSRV applies to the generated code, not svd2rust itself, the standard wording doesn't fully apply, so I changed it in a (hopefully) sensible way.

An open question is: Should we also document the MSRV of svd2rust itself? Looking at how the CI works, currently it's implicitly guaranteed to be the same version als the MSRV for the generated code, so we could just extend the note in the README to also include svd2rust itself.

Co-authored-by: Jan Teske <jteske@posteo.net>
@adamgreig
Copy link
Member Author

I've updated the list of issues with links to PRs and ticked off those that were merged. I've also opened a PR on cortex-m to change the README there; putting the MSRV in at least the readme seems a good plan. Thanks for all your work so far @ra-kete!

bors bot added a commit to rust-embedded/cortex-m-rt that referenced this issue Apr 21, 2020
264: Document MSRV in README r=korken89 a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-m-rt that referenced this issue Apr 21, 2020
264: Document MSRV in README r=korken89 a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-m that referenced this issue Apr 21, 2020
207: Add MSRV note to README r=korken89 a=adamgreig

Ref. rust-embedded/wg#445

Co-authored-by: Adam Greig <adam@adamgreig.com>
@adamgreig
Copy link
Member Author

I've further updated the list with the current PRs and status, thanks everyone!

@teskje
Copy link

teskje commented Apr 25, 2020

Mostly all of the crates that have no PR now make use of unstable features and thus require nightly. Those cannot be assigned an MSRV, obviously. But maybe it would be worth documenting that nightly-dependency in the README?

The only exception is cross, which has an MSRV of 1.32, except if it invokes xargo, in which case nightly is required. Not sure how we should deal with that.

bors bot added a commit to rust-embedded/gpio-utils that referenced this issue Apr 27, 2020
31: Document MSRV 1.26.2 r=nastevens a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/gpio-cdev that referenced this issue Apr 27, 2020
32: Add MSRV 1.34.0 r=nastevens a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/rust-i2cdev that referenced this issue Apr 27, 2020
62: Document and test MSRV 1.32.0 r=nastevens a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

Co-authored-by: Jan Teske <jteske@posteo.net>
bors bot added a commit to rust-embedded/rust-i2cdev that referenced this issue Apr 28, 2020
62: Document and test MSRV 1.32.0 r=nastevens a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

Co-authored-by: Jan Teske <jteske@posteo.net>
bors bot added a commit to rust-embedded/fixedvec-rs that referenced this issue May 4, 2020
19: Document MSRV 1.23.0 r=nastevens a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/svd that referenced this issue May 5, 2020
113: Document and test MSRV 1.35.0 r=adamgreig a=ra-kete

Part of [wg/#445](rust-embedded/wg#445).

This includes two minor changes to the code to lower the MSRV from 1.37.0 to 1.34.0.

Co-authored-by: Jan Teske <jteske@posteo.net>
bors bot added a commit to rust-embedded/mutex-trait that referenced this issue May 5, 2020
10: Document MSRV 1.31.0 on README r=adamgreig a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/arm-dcc that referenced this issue May 5, 2020
8: Document MSRV r=paoloteti a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/itm that referenced this issue May 5, 2020
29: Document MSRV on README r=adamgreig a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/arm-dcc that referenced this issue May 6, 2020
8: Document MSRV r=paoloteti a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-r that referenced this issue May 6, 2020
3: Document MSRV in README and test on Rust stable r=paoloteti a=eldruin

I documented the MSRV in accordance with rust-embedded/wg#445
I also added Rust stable to the build matrix as I think this would be useful. Maybe nightly or beta would also be interesting.

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-r that referenced this issue May 6, 2020
3: Document MSRV in README and test on Rust stable r=paoloteti a=eldruin

I documented the MSRV in accordance with rust-embedded/wg#445
I also added Rust stable to the build matrix as I think this would be useful. Maybe nightly or beta would also be interesting.

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-r that referenced this issue May 7, 2020
3: Document MSRV in README and test on Rust stable r=paoloteti a=eldruin

I documented the MSRV in accordance with rust-embedded/wg#445
I also added Rust stable to the build matrix as I think this would be useful. Maybe nightly or beta would also be interesting.

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-r that referenced this issue May 7, 2020
3: Document MSRV in README and test on Rust stable r=paoloteti a=eldruin

I documented the MSRV in accordance with rust-embedded/wg#445
I also added Rust stable to the build matrix as I think this would be useful. Maybe nightly or beta would also be interesting.

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-m that referenced this issue May 12, 2020
207: Add MSRV note to README r=therealprof a=adamgreig

Ref. rust-embedded/wg#445

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit to rust-embedded/cortex-m that referenced this issue May 12, 2020
207: Add MSRV note to README r=therealprof a=adamgreig

Ref. rust-embedded/wg#445

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit to rust-embedded/riscv that referenced this issue May 16, 2020
40: Document MSRV on README r=Disasm a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to rust-embedded/cortex-m that referenced this issue May 17, 2020
207: Add MSRV note to README r=therealprof a=adamgreig

Ref. rust-embedded/wg#445

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit to rust-embedded/linux-embedded-hal that referenced this issue May 21, 2020
41: Document MSRV 1.32.0 and test it on CI r=posborne a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
bors bot added a commit to cross-rs/cross that referenced this issue Jun 29, 2020
433: Change CI to build with Rust 1.32 and document that as MSRV r=reitermarkus a=adamgreig

This PR adds a documented MSRV, per rust-embedded/wg#445

As far as I can tell none of the Azure pipelines use Xargo or nightly Rust, so I think this small change should be sufficient, but we'll see what CI makes of it.

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit to cross-rs/cross that referenced this issue Jun 30, 2020
433: Change CI to build with Rust 1.32 and document that as MSRV r=reitermarkus a=adamgreig

This PR adds a documented MSRV, per rust-embedded/wg#445

As far as I can tell none of the Azure pipelines use Xargo or nightly Rust, so I think this small change should be sufficient, but we'll see what CI makes of it.

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit to cross-rs/cross that referenced this issue Jun 30, 2020
433: Change CI to build with Rust 1.32 and document that as MSRV r=reitermarkus a=adamgreig

This PR adds a documented MSRV, per rust-embedded/wg#445

As far as I can tell none of the Azure pipelines use Xargo or nightly Rust, so I think this small change should be sufficient, but we'll see what CI makes of it.

Co-authored-by: Adam Greig <adam@adamgreig.com>
bors bot added a commit to cross-rs/cross that referenced this issue Jun 30, 2020
433: Change CI to build with Rust 1.32 and document that as MSRV r=reitermarkus a=adamgreig

This PR adds a documented MSRV, per rust-embedded/wg#445

As far as I can tell none of the Azure pipelines use Xargo or nightly Rust, so I think this small change should be sufficient, but we'll see what CI makes of it.

Co-authored-by: Adam Greig <adam@adamgreig.com>
@adamgreig
Copy link
Member Author

Update: All done! Any future crates should ensure they have an MSRV defined, but for now this marks the completion of this focus project. Thanks everyone for all your work getting this done!

adamgreig pushed a commit to rust-embedded/cortex-m that referenced this issue Jan 12, 2022
264: Document MSRV in README r=korken89 a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
romancardenas pushed a commit to rust-embedded/riscv that referenced this issue Nov 17, 2023
50: Document MSRV on README r=Disasm a=eldruin

See: rust-embedded/wg#445

Co-authored-by: Diego Barrios Romero <eldruin@gmail.com>
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

No branches or pull requests

4 participants