tikv / pprof-rs

A Rust CPU profiler implemented with the help of backtrace-rs
Apache License 2.0
1.32k stars 105 forks source link

Document the MSRV policy #98

Closed str4d closed 2 years ago

str4d commented 2 years ago

Currently, this repo has no documented MSRV policy, which can lead to miscommunications about how downstream users can depend on it, and how it is altered by the crate maintainers.

The motivating example is #91, which migrated pprof to Rust 2021 edition. This removed support for Rust versions prior to 1.56 (which is the first version supporting edition = "2021"). However, it was released as a point release (0.6.2), which meant that any downstream users with pprof = "0.6" in their Cargo.toml would automatically update. If those users were enforcing their own MSRV prior to 1.56 (as in my case, I am), it resulted in unprompted inconsistent compilation breakage (depending on when the user last updated their Cargo.lock).

I note that the GitHub Actions workflow for pprof tests it against the current stable Rust version. If "only supports latest stable" is the intended MSRV policy, it would be helpful to state this in the README, so that users of pprof know that they need to handle it separately from their own MSRVs.

Alternatively, I would recommend an MSRV policy of a similar style used in the RustCrypto ecosystem, which makes it easier for downstream users to prevent automatic upgrades breaking their workflows:

Minimum Supported Rust Version

Rust 1.56 or higher.

Minimum supported Rust version can be changed in the future, but it will be done with a minor version bump.

YangKeao commented 2 years ago

Good! Thanks for pointing out this problem 🥂 . I will add this policy and follow it in the later versions.