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

Set and verify all MSRVs in CI #12654

Merged
merged 4 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 35 additions & 5 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,59 @@
{
customType: 'regex',
fileMatch: [
'^Cargo.toml$',
'Cargo.toml$',
],
matchStrings: [
'rust-version.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'\bMSRV:1\b.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?\bMSRV:1\b',
],
depNameTemplate: 'latest-msrv',
depNameTemplate: 'MSRV:1', // Support 1 version of rustc
packageNameTemplate: 'rust-lang/rust',
datasourceTemplate: 'github-releases',
},
{
customType: 'regex',
fileMatch: [
'Cargo.toml$',
],
matchStrings: [
'\bMSRV:3\b.*?(?<currentValue>\\d+\\.\\d+(\\.\\d+)?)',
'(?<currentValue>\\d+\\.\\d+(\\.\\d+)?).*?\bMSRV:3\b',
],
depNameTemplate: 'MSRV:3', // Support 3 versions of rustc
packageNameTemplate: 'rust-lang/rust',
datasourceTemplate: 'github-releases',
},
],
packageRules: [
{
commitMessageTopic: 'Latest MSRV',
commitMessageTopic: 'MSRV (1 version)',
matchManagers: [
'regex',
],
matchPackageNames: [
'MSRV:1',
],
schedule: [
'* * * * *',
],
groupName: 'msrv',
},
{
commitMessageTopic: 'MSRV (3 versions)',
matchManagers: [
'regex',
],
matchPackageNames: [
'latest-msrv',
'MSRV:3',
],
"extractVersion": "^(?<version>\\d+\\.\\d+)", // Drop the patch version
schedule: [
'* * * * *',
],
minimumReleaseAge: '85 days', // 2 releases back * 6 weeks per release * 7 days per week + 1
internalChecksFilter: 'strict',
groupName: 'msrv',
},
// Goals:
// - Rollup safe upgrades to reduce CI runner load
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
needs:
- build_std
- clippy
- credential_msrv
- msrv
- docs
- lockfile
- resolver
Expand All @@ -38,7 +38,7 @@ jobs:
needs:
- build_std
- clippy
- credential_msrv
- msrv
- docs
- lockfile
- resolver
Expand Down Expand Up @@ -249,9 +249,9 @@ jobs:
curl -sSLO https://raw.githubusercontent.com/rust-lang/rust/master/src/tools/linkchecker/linkcheck.sh
sh linkcheck.sh --all --path ../src/doc cargo

credential_msrv:
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/install-action@cargo-hack
- run: cargo hack check --all-targets --rust-version -p cargo-credential
- run: cargo hack check --all-targets --rust-version --workspace --ignore-private
14 changes: 7 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ exclude = [
]

[workspace.package]
rust-version = "1.73"
rust-version = "1.73" # MSRV:1
edition = "2021"
license = "MIT OR Apache-2.0"

Expand Down Expand Up @@ -108,6 +108,7 @@ name = "cargo"
version = "0.76.0"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
homepage = "https://crates.io"
repository = "https://github.com/rust-lang/cargo"
documentation = "https://docs.rs/cargo"
Expand Down
3 changes: 2 additions & 1 deletion crates/cargo-platform/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "cargo-platform"
version = "0.1.5"
version = "0.1.6"
edition.workspace = true
license.workspace = true
rust-version = "1.70.0" # MSRV:3
Copy link
Member

Choose a reason for hiding this comment

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

This comment seems like a magic and is prone to remove? Do we have a way to avoid a remove even when maintainers aren't familiar with the msrv CI job?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only thing I could think of is to add additional text after saying this is a renovatebot marker.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

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

Or MSRV_DO_NOT_REMOVE:3 😆. Let's move on and deal with it later

homepage = "https://github.com/rust-lang/cargo"
repository = "https://github.com/rust-lang/cargo"
documentation = "https://docs.rs/cargo-platform"
Expand Down
1 change: 1 addition & 0 deletions crates/home/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "home"
version = "0.5.8"
authors = ["Brian Anderson <andersrb@gmail.com>"]
rust-version = "1.70.0" # MSRV:3
documentation = "https://docs.rs/home"
edition.workspace = true
include = [
Expand Down
3 changes: 2 additions & 1 deletion credential/cargo-credential-1password/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "cargo-credential-1password"
version = "0.4.0"
version = "0.4.1"
edition.workspace = true
license.workspace = true
rust-version = "1.70.0" # MSRV:3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

From #12381 (comment)

Just realized, with this pull request and #12395, it is inevitable that every time a Rust release comes out, cargo-util and crates-io will be forced to release a version due to the bump of package.rust-version, even when there is no actual code change involved.

Is that something we've considered? It feels like a bit unnecessary.

What we could do is swap workspace.rust-version so it is MSRV:3 and so these packages will be "untouched" despite getting MSRV bumps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@weihanglo any thoughts on whether workspace.package.rust-version should track the MSRV for internal packages (MSRV:1) or user-facing packages (MSRV:3)?

Copy link
Member

Choose a reason for hiding this comment

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

It seems good starting from tracking MSRV:1, given it's more likely every user-facing package was an internal package from the beginning.

repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens in a 1password vault."

Expand Down
3 changes: 2 additions & 1 deletion credential/cargo-credential-libsecret/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "cargo-credential-libsecret"
version = "0.3.2"
version = "0.3.3"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens with GNOME libsecret."

Expand Down
3 changes: 2 additions & 1 deletion credential/cargo-credential-macos-keychain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "cargo-credential-macos-keychain"
version = "0.3.1"
version = "0.3.2"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens in a macOS keychain."

Expand Down
3 changes: 2 additions & 1 deletion credential/cargo-credential-wincred/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[package]
name = "cargo-credential-wincred"
version = "0.3.1"
version = "0.3.2"
edition.workspace = true
license.workspace = true
rust-version.workspace = true
repository = "https://github.com/rust-lang/cargo"
description = "A Cargo credential process that stores tokens with Windows Credential Manager."

Expand Down
4 changes: 2 additions & 2 deletions credential/cargo-credential/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "cargo-credential"
version = "0.4.0"
version = "0.4.1"
edition.workspace = true
license.workspace = true
rust-version = "1.70.0"
rust-version = "1.70.0" # MSRV:3
repository = "https://github.com/rust-lang/cargo"
description = "A library to assist writing Cargo credential helpers."

Expand Down