-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
bevy_gizmos doc tests hang compute when run locally #12207
Comments
This issue is related to 'Microsoft® Incremental Linker' - the linker used by the rust compiler on some (most?) windows machines. The one thing that sets No single doc-test in particular seems to be responsible for the increased memory usage, as removing any given set of doc-tests results in a decrease in memory usage more or less proportional to the amount of tests removed. Instead, running doc-tests for (very) large projects on windows machines seems to be the issue. I was unable to find an "in code" fix for this, but there is a discussion on the rust forums that appears to suggest building for a different but compatible target or using However, this problem does not seem to be limited to Windows only, as #11034 details a very similar (the same?) issue on a Linux machine. |
Further discussion on Discord.
General conclusions seem to be the same as above, although it looks like rust-lang/rust#123974 should resolve this. |
In addition to the previous observation, [target.x86_64-pc-windows-msvc]
rustdocflags = ["-Clinker=rust-lld.exe"] This helps reduce the memory usage to 1/2 or 1/3, which is a huge improvement if it leads to avoiding swapping (depends on how much RAM your system has). |
# Objective - Rustdoc doesn't seem to follow cargo's `linker` setting - Improves the situation in #12207 ## Solution - Explicitly set the linker in rustdoc flags ## Testing - I tested this change on Windows and it significantly improves testing performances (can't give an exact estimate since they got stuck before this change) --- Note: I avoided changing the settings on Linux and MacOS because I can't test on those platforms. It would be nice if someone could test similar changes there and report so they can be done on all major platforms.
rust-lang/rust#126245 has been merged, though unfortunately it will be enabled only with the 2024 edition. |
Same issue on Fedora 40. Running Rust version info
config.toml
|
# Objective Running `cargo ci` on Fedora 40 causes a system crash due to many `ld` processes consuming all available memory when performing doc tests. ## Solution This PR extends #13553. - Add reference to #12207 in the CI sections of `CONTRIBUTING.md` and `config_fast_builds.toml`. - Add sample `rustdocflags` configurations for `lld` and `mold` to `config_fast_builds.toml` for Linux. ## Testing Crashing configuration - config.toml ``` [target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-Clink-arg=-fuse-ld=lld"] [alias] ci = "run --package ci --" ``` - Test command `cargo ci` Working configuration - config.toml ``` [target.x86_64-unknown-linux-gnu] linker = "clang" rustflags = ["-Clink-arg=-fuse-ld=lld"] rustdocflags = ["-Clink-arg=-fuse-ld=lld"] [alias] ci = "run --package ci --" ``` - Test command `cargo ci`
12th Gen Intel(R) Core(TM) i7-12700H cargo test --doc
With
It uses all 32 GB of RAM and causes the system to freeze up/soft crash after about 5-10 minutes. |
Bevy version
b24ab2e
[Optional] Relevant system information
Windows
What you did
Run
cargo run -p ci --doc
.What went wrong
Doc tests for initial crates pass, and then a dozen or so doc tests within
bevy_gizmos
get stuck, producing a warning that they've been running for more than 60 seconds.My computer then runs out of RAM (over 12 GB!), freezes, and I have to hard reboot.
Additional information
Running with fewer threads via e.g.
-j 4
improves responsiveness and slows down time-to-hang, but does not resolve the problem.This works fine in CI, so it may be OS specific.
The text was updated successfully, but these errors were encountered: