-
-
Notifications
You must be signed in to change notification settings - Fork 78
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
"Cached" registry rustdoc JSON version mismatch #415
Comments
Is there a workaround for this? |
Yes, deleting the cache fixes the problem. |
Apologies for the delay, I was travelling and only just got home. I've started working on a fix in #416. The recommended workaround in the meantime is clearing the
Rustdoc JSON is quite complex and ships bugfixes fairly frequently, so it's better from a correctness and maintenance perspective if the versions match up — it significantly narrows the state space for incoming bug reports on cargo-semver-checks, which not-infrequently produce bug reports upstream. From a purely technical standpoint, though, the versions don't have to match up.
This is the approach I'm going for. There's no use case I can see where someone would want to semver-check on more than one Rust version — it's always best to check on the latest stable Rust version due to the likelihood of relevant rustdoc JSON bugfixes, so I don't think keeping multiple cached rustdoc JSON versions simultaneously is useful. Let me know if you feel I've missed something here. |
* CI repro for #415. * Wipe the cached baseline file on rustdoc version mismatch. * Delint. * Add defensive check to ensure the test actually tests the new behavior. * Fix paths. * Invert condition.
The issue with CI caches here is going to be that a modified cache directory won't get saved so we will re-generate the new JSON over and over again until we manually clear it. We would have to incorporate the version into the cache key for it to automatically invalidate but that is rather tricky to do I think. |
Fixed in #416, will be released shortly.
Would a trick similar to the one used in this repo's CI work? Essentially, version the cache based on the Rust version. Even if the format version didn't change, it's good to regenerate the rustdocs for new Rust versions in case there are bugfixes in rustdoc that didn't cause a format change — and that cache miss would only happen once every ~6 weeks. |
Yep that should work! |
I ended up incorporating the tool-version too: libp2p/rust-libp2p#3664 |
Released in v0.19.0: https://github.com/obi1kenobi/cargo-semver-checks/releases/tag/v0.19.0 |
With an upgrade to the Rust toolchain, the version of the rustdoc JSON may change. We incorporate the rustc version into the cache key to automatically invalidate the cache in that case. Additionally, we also incorporate the version of the `cargo semver-checks` tool. Related: obi1kenobi/cargo-semver-checks#415. Pull-Request: #3664.
Steps to reproduce the bug with the above code
target/semver-checks/cache
directory in CIActual Behaviour
cargo semver-checks
fails to read the old JSON.Expected Behaviour
I can think of multiple approaches:
Generated System Information
Error appeared in CI so unavailable unfortunately. Version
0.18.3
,ubuntu-latest
GitHub runner.Build Configuration
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: