Skip to content

Commit a58c4f7

Browse files
authored
Fix footgun for Windows users in fast_config.toml (#14103)
# Objective - #13136 changed the default value of `-Zshare-generics=n` to `-Zshare-generics=y` on Windows - New users are encouraged to use dynamic builds and LLD when setting up Bevy - New users are also encouraged to check out `fast_config.toml` - #1126 means that running dynamic builds, using LLD and sharing generics on Windows results in a cryptic error message As a result, a new Windows user following all recommendations for better compiles is actually not able to compile Bevy at all. ## Solution - Set `-Zshare-generics=n` on Windows with a comment saying this is for dynamic linking ## Testing I verified that #1126 is still in place on the current nightly (1.80) ## Additional Info Maybe the website should mention this as well? The relevant snippet there looks like this: ```toml # /path/to/project/.cargo/config.toml [target.x86_64-unknown-linux-gnu] rustflags = [ # (Nightly) Make the current crate share its generic instantiations "-Zshare-generics=y", ] ``` so it kinda implies it's only for Linux? Which is not quite true, this setting works on macOS as well AFAIK
1 parent ce5254e commit a58c4f7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.cargo/config_fast_builds.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ rustflags = [
136136
linker = "rust-lld.exe"
137137
rustflags = [
138138
# Nightly
139-
# "-Zshare-generics=y",
139+
# "-Zshare-generics=n", # This needs to be off if you use dynamic linking on Windows.
140140
# "-Zthreads=0",
141141
]
142142

0 commit comments

Comments
 (0)