Skip to content

Tracking issue for MSRV project #445

Closed
@adamgreig

Description

@adamgreig

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions