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

Cleaner README, remove MSRV shields #1417

Merged
merged 2 commits into from
Mar 25, 2024
Merged

Cleaner README, remove MSRV shields #1417

merged 2 commits into from
Mar 25, 2024

Conversation

dhardy
Copy link
Member

@dhardy dhardy commented Mar 22, 2024

  • Inherit several package fields from the workspace. Exceptions: licence (pedantic), authors (pedantic and not always constant).
  • Clean up the README a bit. I don't think we need to discuss the MSRV there; it also wasn't accurate since rust-version prevents older rust versions from attempting to compile the code-base.
  • Remove MSRV shields from READMEs: this is no longer common practice for crates, nor particularly useful.
  • MSRV version number from the CI script (hacky, copying some code from the Bevy CI).

This reduces the MSRV to one place: the top Cargo.toml.

@dhardy dhardy requested review from vks and newpavlov March 22, 2024 12:41
Copy link
Member

@newpavlov newpavlov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense to share the version field. A minor change in, say, rand will not warrant new releases of other crates.

MSRV of crates also may evolve differently (e.g. adding new SIMD backends to rand_chacha may bump its MSRV), especially considering that in future we will get MSRV-aware resolver and thus will be able to bump MSRV "backward compatibly".

@newpavlov
Copy link
Member

On a somewhat relevant note: it may be worth to consider moving rand into its own folder and use virtual manifest for workspace.

@dhardy
Copy link
Member Author

dhardy commented Mar 22, 2024

MSRV of crates also may evolve differently

I take the view that if it isn't tested, it doesn't work, and we only have one CI test for MSRV. We've been using a common policy across this repo for a while already.

I suspect rand_core and RNG crates may work with a lower rustc, but don't really care; half our deps now require a higher MSRV anyway (at least if you count dev deps).

@newpavlov
Copy link
Member

newpavlov commented Mar 22, 2024

It's matter of bumping MSRV in future, e.g. why should MSRV bump for rand_distr bump MSRV for rand? Yes, different crate MSRVs would require some CI changes, but it's nothing impossible.

Also, I don't think that this:

edition.workspace = true
rust-version.workspace = true

is cleaner than this:

edition = "2021"
rust-version = "1.61"

Yes, it helps with bumping MSRV/edition, but we do it quite rarely, while user often look into Cargo.toml for information about crate and such indirection only wastes their time.

@dhardy
Copy link
Member Author

dhardy commented Mar 22, 2024

It's matter of bumping MSRV in future,

It doesn't prevent that.

Also, I don't think that this: ... is cleaner than this:

No. The only advantage is making those values easier to change.

Bevy have a cleaner set-up, but I couldn't find doc on how it works and .workspace = true was needed in testing...

Either way, this stuff isn't very important.

@vks
Copy link
Collaborator

vks commented Mar 23, 2024

it also wasn't accurate since rust-version prevents older rust versions from attempting to compile the code-base.

I don't think so, older Rust versions will just ignore rust-version and print a warning.

I agree makes sense to have the same MSRV for all crates if that is what we are testing. If the MSRVs diverge, it should be reflected by the CI, and we can still change that later.

README.md Show resolved Hide resolved
@dhardy
Copy link
Member Author

dhardy commented Mar 24, 2024

Workspace inheritance was only stabilised in 1.64 so we can't do that yet.

We should probably still link the upgrade guide?

Done.

I don't think so, older Rust versions will just ignore rust-version and print a warning.

No (at least not since versions which support rust-version).

$ cargo +1.60 test
error: package `rand_core v0.9.0-alpha.1 (..)` cannot be built because it requires rustc 1.61 or newer, while the currently active rustc version is 1.60.0

@dhardy dhardy changed the title Cleaner README, inherit properties Cleaner README, remove MSRV shields Mar 24, 2024
@dhardy dhardy merged commit 0e626c7 into master Mar 25, 2024
12 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants