Skip to content

Commit

Permalink
doc(FAQ): refine MSRV policy
Browse files Browse the repository at this point in the history
  • Loading branch information
abonander committed Sep 3, 2024
1 parent 6cb6fce commit 998344d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 21 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ authors = [
"Chloe Ross <orangesnowfox@gmail.com>",
"Daniel Akhterov <akhterovd@gmail.com>",
]
# TODO: enable this for 0.9.0
# rust-version = "1.80.0"

[package]
name = "sqlx"
Expand Down
25 changes: 8 additions & 17 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,14 @@ For each database and where applicable, we test against the latest and oldest ve
-------------------------------------------------------------------
### What versions of Rust does SQLx support? What is SQLx's MSRV\*?

Officially, we will only ever support the latest stable version of Rust.
It's just not something we consider to be worth keeping track of, given the current state of tooling.

Cargo does support a [`rust-version`] field now in the package manifest, however that will only ensure
that the user is using a `rustc` of that version or greater; it does not enforce that the crate's code is
actually compatible with that version of Rust. That would need to be manually enforced and checked with CI,
and we have enough CI passes already.

In practice, we tend not to reach for language or library features that are *too* new, either because
we don't need them or we just worked around their absence. There are language features we're waiting to be
stabilized that we want to use (Generic Associated Types and Async Traits, to name a couple) which we will
be utilizing when they're available, but that will be a major refactor with breaking API changes
which will then coincide with a major release.

Thus, it is likely that a given SQLx release _will_ work with older versions of Rust. However,
we make no guarantees about which exact versions it will work with besides the latest stable version,
and we don't factor MSRV bumps into our semantic versioning.
SQLx's MSRV is the second-to-latest stable release as of the beginning of the current release cycle (`0.x.0`).
It will remain there until the next major release (`0.{x + 1}.0`).

This guarantees that SQLx will compile with a Rust version that is _at least_ six weeks old, which should be plenty
of time for it to make it through any packaging system that is being actively kept up to date.

We do _not_ recommend installing Rust through operating system packages,
as they can often be a whole year or more out-of-date.

\*Minimum Supported Rust Version

Expand Down
6 changes: 2 additions & 4 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# NOTE: this does NOT indicate a Minimum Supported Rust Version (MSRV) of SQLx.
# We reserve the right to increase this version at any time without considering it to be a breaking change.
# See the answer in FAQ.md for details.
# Note: should NOT increase during a minor/patch release cycle
[toolchain]
channel = "1.80"
channel = "1.78"
profile = "minimal"

0 comments on commit 998344d

Please sign in to comment.