Skip to content

Commit

Permalink
Merge #526
Browse files Browse the repository at this point in the history
526: Update MSRV policy r=thalesfragoso a=adamgreig

This PR updates our MSRV policy in line with RFC #523. 

Co-authored-by: Adam Greig <adam@adamgreig.com>
  • Loading branch information
bors[bot] and adamgreig committed Nov 30, 2020
2 parents 28c9817 + 13ab43d commit 2de781c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 53 deletions.
64 changes: 19 additions & 45 deletions ops/msrv.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,48 +2,22 @@

This text documents the MSRV policy used in the crates maintained by the WG.

- The MSRV shall always be strictly smaller than the latest available minor
stable release. For example, if the latest stable Rust version was 1.32.1 a
new minor release of the `cortex-m` crate can't bump the MSRV higher than
1.31.

- Changing the MSRV of a crate is a breaking change and requires a semver bump:
minor version bump if the crate is pre-1.0 and a major version bump if the
crate is (post-)1.0.

- Cargo features are allowed to depend a on Rust version greater than the MSRV,
even a nightly compiler. For example, a "const-fn" can bump the required
version to 1.34.0 (effectively, nightly channel at the time of writing).

- When doing a semver bump (i.e. minor version bump in pre-1.0 crates), for
whatever reason, the team in charge of the crate should consider bumping the
MSRV as well.

- The MSRV will be documented in the crate level documentation of the crate,
like so:

``` markdown
# Minimum Supported Rust Version (MSRV)

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

- The MSRV will be tested in the CI of the crate as a separate build job, like
so:

``` yaml
matrix:
include:
# MSRV
- env: TARGET=thumbv7m-none-eabi
rust: 1.31.0

- env: TARGET=thumbv7m-none-eabi
rust: stable

- env: TARGET=thumbv7m-none-eabi
rust: beta

# etc.
```
1. Crates released by the Embedded WG must compile on the most recent stable
Rust release at all times. If a dependency releases an update which causes a
published crate to no longer build on the most recent stable release, a new
version must be released to resolve the issue.
2. Individual crates may specify a more restrictive MSRV if the crate's team
agrees to do so, as long as it is at least as restrictive as this policy.
3. It is permissible for specifically-indicated features of a crate to not
build on stable, to support the use of nightly-only features. All features
not specifically indicated in the README or documentation must build on
stable.

It is recommended that all crates use a CI system to check that a PR does not
break building on stable Rust, and schedule regular CI jobs to check that a
newly released stable Rust has not broken the crate's build. Crates may also
consider regular CI runs against the latest released version of the crate.

This policy was most recently updated by [RFC 0523].

[RFC 0523]: https://github.com/rust-embedded/wg/pull/523
11 changes: 3 additions & 8 deletions ops/post-transfer.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,6 @@ name: Continuous integration
- uses the latest ubuntu
- setup a matrix which runs all tests for stable Rust and deviates for others
- Defines a `TARGET` env variable containing all default targes
- Defines deviations for the MSRV test (using Rust `1.35.0` and only tests for `x86_64-unknown-linux-gnu`)
- Defines deviations for nightly tests and marks them as `experimental`, i.e.
it will only generate warnings if this part fails instead of aborting the whole job
``` yaml
Expand All @@ -189,18 +188,14 @@ jobs:
continue-on-error: ${{ matrix.experimental || false }}
strategy:
matrix:
# All generated code should be running on stable now
# All published crates must build on stable.
rust: [stable]
# The default target we're compiling on and for
# The default target we're compiling on and for.
TARGET: [x86_64-unknown-linux-gnu, thumbv6m-none-eabi, thumbv7m-none-eabi]
include:
# Test MSRV
- rust: 1.35.0
TARGET: x86_64-unknown-linux-gnu
# Test nightly but don't fail
# Test nightly but don't fail the build.
- rust: nightly
experimental: true
TARGET: x86_64-unknown-linux-gnu
Expand Down

0 comments on commit 2de781c

Please sign in to comment.