-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
build --release takes forever on latest rust release #119822
Comments
Thanks for the report!
We have a tool called |
I finally run bisect tool, thanks for pointing on it. Report:
searched nightlies: from nightly-2023-09-01 to nightly-2024-01-01 bisected with cargo-bisect-rustc v0.6.8Host triple: x86_64-unknown-linux-gnu Also, A bit of feedback on this tool: I guess that "No" means "No failure" and "Yes" means "Failure" but I only understood it after the run. |
Tried to build manually with Also tried the latest nightly and beta and it is still broken. Pretty sure the latest stable is also still broken but I did not check it. |
Thanks for investigating. cc @nikic @InnovativeInventor, this seems to be caused by #102099. Is this kind of regression expected? Are there additional tasks for investigating why it appears to be getting stuck? One possibility that comes to mind in this situation is that maybe it is doing significantly more inlining, and possibly running out of memory and hitting swap. |
Yes, this is "expected", in the sense that it can result in pathological compile-times for pathological inputs -- most likely, you have a proc macro somewhere creating a huge function (say, hundreds of thousands instructions), and this change perturbs things enough for it to trigger some super-linear optimization behavior. Beyond that, there's not much I can say here without a reproducer or even a profile. |
I don't think it's OOM, I had 256GB of RAM on some machines I tried this. In terms of macro I can think of only async_trait, everything else doesn't look heavy. And in general I don't have an idea what can be pathological in my project, there is nothing unusual to my eye. I will try to remove async_trait and see if it helps, also I will try to run compilation overnight, maybe it will finish. Do you have any advice on what I can do to figure out what's going on? |
I'd start by adding Then run it under The other thing I'd try is adding |
I think this issue was fixed, at least my project (with library updates) compiles at latest stable with |
thanks @Qumeric for the feedback. I don't see other comments (or comment from other issues) so feel free to close this issue if everything's fine on your end |
I have a project of around 10k lines and 1000 dependency crates. I cannot share it because it's closed source.
I was working on it for a few months and previously compiled it with stable, beta and nightly rust.
I decided to update rust to latest version. I run
cargo build --release
and it stuck atI tried to build my-crate-name solely (full project is workspace) but it stuck in a same way.
I tried to do it with macOS + lld, linux + mold, linux + ld. Linux were 3 different machines with 5x00X Ryzen cpus.
It always stuck (I waited at least 10 and up to 60 minutes). Both in latest (installed with rustup) stable, beta and nightly.
I tried different standard things like
cargo clean
but nothing helped.The project builds without
--release
just fine and builds with--release
in rust 1.74.1 (and some previous versions of nightly and beta). It takes ~4 minutes for clean --release build and ~1.5 minutes for clean debug build.I may try
git bisect
on compiler versions later if I will have time for that. Although I am not completely sure if it's compiler issue, could be cargo issue as well?The text was updated successfully, but these errors were encountered: