Skip to content

Commit 35fb54f

Browse files
authored
Use lld for rustdoc on Linux in config_fast_builds.toml (bevyengine#14839)
# 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 bevyengine#13553. - Add reference to bevyengine#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`
1 parent f9fbd08 commit 35fb54f

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.cargo/config_fast_builds.toml

+10-1
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,21 @@ rustflags = [
8383
# - Ubuntu: `sudo apt-get install mold clang`
8484
# - Fedora: `sudo dnf install mold clang`
8585
# - Arch: `sudo pacman -S mold clang`
86-
# "-Clink-arg=-fuse-ld=/usr/bin/mold",
86+
# "-Clink-arg=-fuse-ld=mold",
8787

8888
# Nightly
8989
# "-Zshare-generics=y",
9090
# "-Zthreads=0",
9191
]
92+
# Some systems may experience linker performance issues when running doc tests.
93+
# See https://github.com/bevyengine/bevy/issues/12207 for details.
94+
rustdocflags = [
95+
# LLD linker
96+
"-Clink-arg=-fuse-ld=lld",
97+
98+
# Mold linker
99+
# "-Clink-arg=-fuse-ld=mold",
100+
]
92101

93102
[target.x86_64-apple-darwin]
94103
rustflags = [

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ If you're new to Bevy, here's the workflow we use:
423423
2. Make your changes in a local clone of your fork, typically in its own new branch.
424424
1. Try to split your work into separate commits, each with a distinct purpose. Be particularly mindful of this when responding to reviews so it's easy to see what's changed.
425425
2. Tip: [You can set up a global `.gitignore` file](https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer) to exclude your operating system/text editor's special/temporary files. (e.g. `.DS_Store`, `thumbs.db`, `*~`, `*.swp` or `*.swo`) This allows us to keep the `.gitignore` file in the repo uncluttered.
426-
3. To test CI validations locally, run the `cargo run -p ci` command. This will run most checks that happen in CI, but can take some time. You can also run sub-commands to iterate faster depending on what you're contributing:
426+
3. To test CI validations locally, run the `cargo run -p ci` command. This will run most checks that happen in CI, but can take some time. Some systems may experience [linker performance issues when running doc tests](https://github.com/bevyengine/bevy/issues/12207). You can also run sub-commands to iterate faster depending on what you're contributing:
427427
* `cargo run -p ci -- lints` - to run formatting and clippy.
428428
* `cargo run -p ci -- test` - to run tests.
429429
* `cargo run -p ci -- doc` - to run doc tests and doc checks.

0 commit comments

Comments
 (0)