Add CI job for checking stdlib semver compatibility - #160253
Conversation
|
This PR modifies If appropriate, please update Warning If you are changing how CI LLVM is built or linked, make sure to bump cc @jieyouxu This PR modifies If appropriate, please update |
|
@bors try jobs=x86_64-gnu-stdlib-semver-check |
Add CI job for checking stdlib semver compatibility try-job: x86_64-gnu-stdlib-semver-check
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 79f5ace failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
@bors try jobs=x86_64-gnu-stdlib-semver-check |
This comment has been minimized.
This comment has been minimized.
Add CI job for checking stdlib semver compatibility try-job: x86_64-gnu-stdlib-semver-check
|
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? |
|
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. |
|
A file-based bypass sounds good to me. |
Add CI job for checking stdlib semver compatibility try-job: x86_64-gnu-stdlib-semver-check
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 0bb0391 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Add CI job for checking stdlib semver compatibility try-job: x86_64-gnu-stdlib-semver-check
This comment has been minimized.
This comment has been minimized.
|
💔 Test for 7920893 failed: CI. Failed job:
|
This comment has been minimized.
This comment has been minimized.
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Add CI job for checking stdlib semver compatibility try-job: x86_64-gnu-stdlib-semver-check
|
@bors try |
This comment has been minimized.
This comment has been minimized.
Add CI job for checking stdlib semver compatibility try-job: x86_64-gnu-stdlib-semver-check
This comment has been minimized.
This comment has been minimized.
|
Ok, should be ready now, including an opt-out mechanism. I updated the PR description and added CI links to the various cases that can happen. @rustbot ready |
There was a problem hiding this comment.
Some behavioral / dealing with job failure questions, but otherwise CI/bootstrap changes look good to me.
@rustbot author
| // 101 marks that csc was unable to parse the JSON data, but it did not fail with a | ||
| // semver breakage. | ||
| Some(status) if status.code() == Some(101) => { | ||
| eprintln!( | ||
| "cargo-semver-checks was unable to process {library} (this is not a fatal error)\n{}\n{}", | ||
| res.stderr(), | ||
| res.stdout() | ||
| ); | ||
| } |
There was a problem hiding this comment.
Question: hm, is it possible that the JSON data remains borked but this swallows the problem? I assume that if std JSON data becomes borked there's additional mechanisms to catch that, or at least is possible for library maintainers to notice?
There was a problem hiding this comment.
Unless the breakage is something super specific, like "only std is broken and nothing else", there are plenty of other things that could catch this including both rustdoc tests and cargo-semver-checks CI which runs vs nightly. std/core etc. aren't that special AFAIK in rustdoc JSON so the likelihood of such narrow breakage is very low.
In the reasonably near future cargo-semver-checks should start connecting rustdoc JSON for std/core/alloc together with the user's crate, at which point its CI will become even more attuned to finding possible breakage in rustdoc output.
So I think we're reasonably well set up for success here, and feel that more complexity here is probably not worth the possible payoff.
| - name: x86_64-gnu-stdlib-semver-check | ||
| <<: *job-linux-4c |
There was a problem hiding this comment.
Question: could we maybe provide a doc_url for how to handle failures from this job? Or alternatively, if it's possible to allow co-posting a more general "job failure help message".
| - name: x86_64-gnu-stdlib-semver-check | ||
| <<: *job-linux-4c |
There was a problem hiding this comment.
NB: Hm, this is an auto job. I wonder how often we would hit csc failures in practice for libs changes, I suppose we'll have to find out. But seems fine to start with this to try it out.
There was a problem hiding this comment.
Based on my historical analysis, we expect about one instance of breakage per year. We may get a few more false-positives but I hope not many.
With that in mind, I think having even a pretty manual process like "post in this Zulip topic if you aren't sure what to do" should be okay, and I'd be happy to watch that topic and help people who might be stuck or confused.
View all comments
This CI job installs the latest published version of
cargo-semver-checksand then runs thex test std-semver-checkbootstrap 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.
If a PR wants to explicitly go around the csc check (either there is an actual semver break or csc produces a false positive), if the
src/bootstrap/stdlib-semver-check-stampis changed in the same PR, then the check will be skippedCI runs:
CC @rust-lang/libs @obi1kenobi
r? @jieyouxu (for bootstrap and CI stuff)
try-job: x86_64-gnu-stdlib-semver-check