-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Incremental occasionally causes link failures (in particular when build process is interrupted) #81280
Comments
Just got this error while linking
|
Again:
|
This is particularly likely to happen when the build process is interrupted, e.g. via Ctrl-C |
I'm running into the Ctrl-C issue fairly regularly. It's quite frustrating when a simple Cc @rust-lang/wg-incr-comp is there anything that can be done to make rustc be "Ctrl-C safe", or least not as blatantly "Ctrl-C unsafe" as it is today? |
We could start to collect some data on what the root cause might be:
|
When does the linker run? I have this occur regularly when I interrupt while half a dozen rustc_ crates are still being built. I think the linker only runs once at the end for the main rustc binary? If that is the case, then the answer to this question is "no". |
Yes, that sounds right. Incr. comp. protects itself against cache corruption by writing everything to a temporary session directory and only when things have reached a valid state, it will "commit" that directory, so it will be used by subsequent compilation sessions. One cause for the problem might be that rustc declares the state to be valid too early, e.g. while LLVM or rustc itself are still in the process of writing files to disk. Or that the interruption is not recognized as a failure and a half-written object file or LLVM bitcode file is cached. I'm wondering if we can narrow down where exactly the interruption needs to happen for this to occur. |
Are people still running into this? I'm trying to reproduce it and no luck yet. |
I'm running into this issue consistently on [target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
"-Clink-arg=-fuse-ld=/usr/bin/mold",
"-Zshare-generics=y",
"-Zthreads=0",
]
[target.x86_64-apple-darwin]
rustflags = ["-Zshare-generics=y", "-Zthreads=0"]
[target.aarch64-apple-darwin]
rustflags = ["-Zshare-generics=y", "-Zthreads=0"]
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
[alias]
ci = "run --package ci --" The note below the error:
|
I have this issue regularly using rustc 1.82.0. I used to think I had to do a Edit: encountered again after an interrupt; had to |
I tried this code: b717882
I expected to see this happen: It compiles successfully.
Instead, this happened:
Meta
rustc --version
:cc @Aaron1011 , I think you were looking into something similar a while back.
The text was updated successfully, but these errors were encountered: