Skip to content
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

Fix footgun for Windows users in fast_config.toml #14103

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

janhohenheim
Copy link
Member

@janhohenheim janhohenheim commented Jul 2, 2024

Objective

As a result, a new Windows user following all recommendations for better compilation times 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 happening on the current nightly (1.80)

Additional Info

Maybe the website should mention this as well? The relevant snippet there looks like this:

# /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

@janhohenheim janhohenheim added C-Bug An unexpected or incorrect behavior C-Docs An addition or correction to our documentation D-Trivial Nice and easy! A great choice to get started with Bevy A-Build-System Related to build systems or continuous integration O-Windows Specific to the Windows desktop operating system labels Jul 2, 2024
@BD103 BD103 added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jul 2, 2024
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 2, 2024
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jul 2, 2024
Merged via the queue into bevyengine:main with commit a58c4f7 Jul 2, 2024
35 checks passed
@janhohenheim janhohenheim deleted the patch-1 branch July 2, 2024 13:52
zmbush pushed a commit to zmbush/bevy that referenced this pull request Jul 3, 2024
# Objective

- bevyengine#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`
- bevyengine#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 bevyengine#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
MrGVSV pushed a commit to MrGVSV/bevy that referenced this pull request Jul 5, 2024
# Objective

- bevyengine#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`
- bevyengine#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 bevyengine#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Bug An unexpected or incorrect behavior C-Docs An addition or correction to our documentation D-Trivial Nice and easy! A great choice to get started with Bevy O-Windows Specific to the Windows desktop operating system S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants