-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Assertion in on-disk cache code in the compiler fails #122544
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
Comments
Correction: It first works and makes the problem disappear. However, after making a code change (renaming
|
@Nilstrieb The failing assertion is not the one I recently added. The assertion that's firing here is very old:
|
It happened to me again today, same project, different file, after renaming (through the rust-analyzer language server) a variable. |
As far as I can tell, the ICE reported in this issue is caused by another process damaging rustc's build artifacts or by a buggy filesystem. That other process could be anything from an IDE running the compiler at the same time as a manual build to a find-and-replace that accidentally edits files in the target directory. #124686 contains a mitigation for this situation; the compiler now has a crude way to detect and ignore damaged incremental compilation files. You will still get a warning about the damaged file, but the build should proceed normally. That change shipped in Rust 1.80 which released today, so I am closing this issue and a few others which as far as I can tell all have the same root cause. You shouldn't see this ICE anymore, but please file a new issue if you see something like it on 1.80 or later. |
Thank you, I have updated to 1.80 and will report back if the issue happens again. |
Epilogue: this issue did not show up again, except once. If this is a scenario that’s common and folks want to prevent it from happening, I could suggest adding a checksum to the on disk cache to detect silent external modifications? |
Code
Since this is a caching issue (apparently, since the old code and the new code both build fine on their own) it's hard for me to give code to reproduce it. Basically I had code in a library like this:
which compiled fine with
cargo b --target=x86_64-unknown-linux-gnu
.Then I changed the code to:
And then re-running
cargo b --target=x86_64-unknown-linux-gnu
it fails.Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: