Add semver check test command for checking API compatibility of stdlib#159671
Add semver check test command for checking API compatibility of stdlib#159671Kobzol wants to merge 1 commit into
Conversation
|
(I'll look at this during the weekend.) |
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
…, r=Mark-Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang#159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
…, r=Mark-Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang#159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
…, r=Mark-Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang#159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
…, r=Mark-Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang#159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
Rollup merge of #159765 - Kobzol:bootstrap-docs-json-rebuild, r=Mark-Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on #159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
…Simulacrum Avoid spurious rebuilds of JSON docs in bootstrap Found this while working on rust-lang/rust#159671. Before, repeated runs of e.g. `x dist rust-docs-json` always rebuilt the docs. It was caused by Cargo not knowing that the output should be JSON, so it was trying to find the HTML files. Instead of passing the output format through `RUSTDOCFLAGS`, which Cargo doesn't inspect, we now pass it to Cargo directly, which fixes the issue.
There was a problem hiding this comment.
Thanks, this seems reasonable, one test nit
@rustbot author
There was a problem hiding this comment.
Remark: I think this will merge conflict with #159638, merge after that PR
There was a problem hiding this comment.
Question: could we add a step resolution snapshot test for ./x test std-semver-check?
|
We should probably also run cargo semver checks in reverse each release too, and compare the output with the release notes, to make sure we don't accidentally stabilize something. That's probably for a future PR though. |
This PR adds a new test to bootstrap (not executed by default at the moment) that checks the API compatibility of the standard library using the https://github.com/obi1kenobi/cargo-semver-checks tool.
The command can be executed using
x test std-semver-check.(Note: I realized that
x dist rust-docs-jsonexecuted twice in a row invalidates Cargo cache for some reason, that is a separate issue though).The test is not yet executed on CI, I would do that in a separate PR (maybe pending a t-libs FCP or something).
The test checks that c-s-c is installed, and then uses git to lookup a parent baseline commit (in a future extension, we should make the baseline commit be configurable through
config.toml). Then it downloads the correspondingrust-docs-jsoncomponent of that commit from CI and extracts it. It generates the same JSON docs component from local sources, and then runs c-s-c on those two JSON files to compare their API.Output when API stability is broken:
CC @obi1kenobi @Amanieu
r? @jieyouxu