Skip to content

Add CI job for checking stdlib semver compatibility - #160253

Open
Kobzol wants to merge 3 commits into
rust-lang:mainfrom
Kobzol:csc-ci
Open

Add CI job for checking stdlib semver compatibility#160253
Kobzol wants to merge 3 commits into
rust-lang:mainfrom
Kobzol:csc-ci

Conversation

@Kobzol

@Kobzol Kobzol commented Jul 31, 2026

Copy link
Copy Markdown
Member

This CI job installs the latest published version of cargo-semver-checks and then runs the x test std-semver-check bootstrap command added in #159671.

If csc finds semver breakage, the job will fail. If csc cannot parse the rustdoc JSON data (e.g. because the format was bumped), the job will print an error, but it will not fail.

One thing I'm not sure about is whether the stdlib will actually run into any breakages (or perceived breakages, from the perspective of csc), and how to deal with that, because then the job would just be red and the PR couldn't be merged. We could make the job optional, but we don't yet have a good mechanism for finding out about failures from optional jobs (that can be added later though).

CC @rust-lang/libs @obi1kenobi

r? @jieyouxu (for bootstrap and CI stuff)

@rustbot

rustbot commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

This PR modifies src/bootstrap/src/core/config.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

Warning

If you are changing how CI LLVM is built or linked, make sure to bump
src/bootstrap/download-ci-llvm-stamp.

cc @jieyouxu

This PR modifies bootstrap.example.toml.

If appropriate, please update CONFIG_CHANGE_HISTORY in src/bootstrap/src/utils/change_tracker.rs.

@rustbot rustbot added A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc labels Jul 31, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Jul 31, 2026
@Kobzol

Kobzol commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-gnu-stdlib-semver-check

rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
Add CI job for checking stdlib semver compatibility


try-job: x86_64-gnu-stdlib-semver-check
@rust-bors

This comment has been minimized.

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 31, 2026
@rust-bors

rust-bors Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 79f5ace failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@Kobzol
Kobzol marked this pull request as draft July 31, 2026 07:55
@Kobzol

Kobzol commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

@bors try jobs=x86_64-gnu-stdlib-semver-check

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Jul 31, 2026
Add CI job for checking stdlib semver compatibility


try-job: x86_64-gnu-stdlib-semver-check
@rust-bors

rust-bors Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: cf27501 (cf2750129ae79b5df875523f88c46d6fe8a84b4c)
Base parent: 922325b (922325bb13bfea5b41454318563f2a65e83c2336)

@Kobzol
Kobzol marked this pull request as ready for review July 31, 2026 08:41
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 31, 2026
@Urgau

Urgau commented Jul 31, 2026

Copy link
Copy Markdown
Member

I expect quite a few semver breaking changes over the development of nightly features, how are contributors supposed to bypass the CI for changes that are okay? What about stable feature where the breakage is accepted?

@Kobzol

Kobzol commented Jul 31, 2026

Copy link
Copy Markdown
Member Author

That's a very good question, that I don't yet know the answer to :) In terms of implementation, we could have some file in the standard library subtree (something like the LLVM bootstrap stamp files) that could be manually bumped in PRs that expect a breaking change. And for those PRs the test would just be green.

@cuviper

cuviper commented Jul 31, 2026

Copy link
Copy Markdown
Member

A file-based bypass sounds good to me.

@obi1kenobi

Copy link
Copy Markdown
Member

Just a note that I don't expect CI to be red over development of nightly features. cargo-semver-checks is now aware of stability (including special cases like const-stability) and will not consider those cases SemVer-breaking.

If it would be useful to have a separate report that also considers unstable features' breakage, that's easy enough to add as well (just remove a flag from the invocation) but probably beyond the scope of this PR.

Comment on lines +494 to +495
- name: x86_64-gnu-stdlib-semver-check
<<: *job-linux-4c

@jieyouxu jieyouxu Aug 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remark: also thinking about the failure handling

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CI Area: Our Github Actions CI A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants