mirror of
https://github.com/bevyengine/bevy.git
synced 2026-05-06 06:06:42 -04:00
Add -Zno-embed-metadata Cargo flag to config_fast_builds.toml (#23694)
# Objective Reduce the size of the `target` directory with Bevy builds. ## Solution I found this [blog](https://kobzol.github.io/rust/rustc/2025/06/02/reduce-cargo-target-dir-size-with-z-no-embed-metadata.html) about `-Zno-embed-metadata`, Cargo flag that reduces the size of the `target` directory by avoiding duplicate metadata or something. ## Testing I compiled the `main` branch with and without this branch and the size of the `target` directory went from 11.61G without the flag to 11.15G with the flag. Not a huge difference, but still a 4% decrease.
This commit is contained in:
@@ -64,6 +64,16 @@
|
||||
# checking, and more. We currently set `threads=0`, which defaults to the amount of cores in your CPU.
|
||||
#
|
||||
# For more information, see the blog post at <https://blog.rust-lang.org/2023/11/09/parallel-rustc.html>.
|
||||
#
|
||||
# ## `no-embed-metadata`
|
||||
#
|
||||
# This options avoids unnecessary metadata duplication and can reduce the size of the `target` directory by
|
||||
# around 5% on dev builds, potentially more on release builds.
|
||||
#
|
||||
# Note: Unlike other flags in this file, `no-embed-metadata` is a Cargo flag, not a rustc flag, and is at the
|
||||
# bottom of this file.
|
||||
#
|
||||
# For more information, see the blog post at <https://kobzol.github.io/rust/rustc/2025/06/02/reduce-cargo-target-dir-size-with-z-no-embed-metadata.html>.
|
||||
|
||||
[target.x86_64-unknown-linux-gnu]
|
||||
rustflags = [
|
||||
@@ -142,3 +152,7 @@ rustflags = [
|
||||
# In most cases the gains are negligible, but if you are on macOS and have slow compile times you should see significant gains.
|
||||
# [profile.dev]
|
||||
# debug = 1
|
||||
|
||||
# Nightly
|
||||
# [unstable]
|
||||
# no-embed-metadata = true
|
||||
|
||||
Reference in New Issue
Block a user