Skip to content

Commit f591d25

Browse files
committed
Rebase and fix bugs by using a second dispatch
2 parents cdd1155 + 55d394f commit f591d25

File tree

385 files changed

+15790
-3488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

385 files changed

+15790
-3488
lines changed

.cargo/config_fast_builds.toml

Lines changed: 126 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,146 @@
1-
# Add the contents of this file to `config.toml` to enable "fast build" configuration. Please read the notes below.
2-
3-
# NOTE: For maximum performance, build using a nightly compiler
4-
# If you are using rust stable, remove the "-Zshare-generics=y" below.
1+
# Copy this file to `config.toml` to speed up your builds.
2+
#
3+
# # Faster linker
4+
#
5+
# One of the slowest aspects of compiling large Rust programs is the linking time. This file configures an
6+
# alternate linker that may improve build times. When choosing a new linker, you have two options:
7+
#
8+
# ## LLD
9+
#
10+
# LLD is a linker from the LLVM project that supports Linux, Windows, MacOS, and WASM. It has the greatest
11+
# platform support and the easiest installation process. It is enabled by default in this file for Linux
12+
# and Windows. On MacOS, the default linker yields higher performance than LLD and is used instead.
13+
#
14+
# To install, please scroll to the corresponding table for your target (eg. `[target.x86_64-pc-windows-msvc]`
15+
# for Windows) and follow the steps under `LLD linker`.
16+
#
17+
# For more information, please see LLD's website at <https://lld.llvm.org>.
18+
#
19+
# ## Mold
20+
#
21+
# Mold is a newer linker written by one of the authors of LLD. It boasts even greater performance, specifically
22+
# through its high parallelism, though it only supports Linux.
23+
#
24+
# Mold is disabled by default in this file. If you wish to enable it, follow the installation instructions for
25+
# your corresponding target, disable LLD by commenting out its `-Clink-arg=...` line, and enable Mold by
26+
# *uncommenting* its `-Clink-arg=...` line.
27+
#
28+
# There is a fork of Mold named Sold that supports MacOS, but it is unmaintained and is about the same speed as
29+
# the default ld64 linker. For this reason, it is not included in this file.
30+
#
31+
# For more information, please see Mold's repository at <https://github.com/rui314/mold>.
32+
#
33+
# # Nightly configuration
34+
#
35+
# Be warned that the following features require nightly Rust, which is expiremental and may contain bugs. If you
36+
# are having issues, skip this section and use stable Rust instead.
37+
#
38+
# There are a few unstable features that can improve performance. To use them, first install nightly Rust
39+
# through Rustup:
40+
#
41+
# ```
42+
# rustup toolchain install nightly
43+
# ```
44+
#
45+
# Finally, uncomment the lines under the `Nightly` heading for your corresponding target table (eg.
46+
# `[target.x86_64-unknown-linux-gnu]` for Linux) to enable the following features:
47+
#
48+
# ## `share-generics`
49+
#
50+
# Usually rustc builds each crate separately, then combines them all together at the end. `share-generics` forces
51+
# crates to share monomorphized generic code, so they do not duplicate work.
52+
#
53+
# In other words, instead of crate 1 generating `Foo<String>` and crate 2 generating `Foo<String>` separately,
54+
# only one crate generates `Foo<String>` and the other adds on to the pre-exiting work.
55+
#
56+
# Note that you may have some issues with this flag on Windows. If compiling fails due to the 65k symbol limit,
57+
# you may have to disable this setting. For more information and possible solutions to this error, see
58+
# <https://github.com/bevyengine/bevy/issues/1110>.
59+
#
60+
# ## `threads`
61+
#
62+
# This option enables rustc's parallel frontend, which improves performance when parsing, type checking, borrow
63+
# checking, and more. We currently set `threads=0`, which defaults to the amount of cores in your CPU.
64+
#
65+
# For more information, see the blog post at <https://blog.rust-lang.org/2023/11/09/parallel-rustc.html>.
566

667
[target.x86_64-unknown-linux-gnu]
768
linker = "clang"
869
rustflags = [
9-
"-Clink-arg=-fuse-ld=lld", # Use LLD Linker
10-
"-Zshare-generics=y", # (Nightly) Make the current crate share its generic instantiations
11-
"-Zthreads=0", # (Nightly) Use improved multithreading with the recommended amount of threads.
70+
# LLD linker
71+
#
72+
# You may need to install it:
73+
#
74+
# - Ubuntu: `sudo apt-get install lld clang`
75+
# - Fedora: `sudo dnf install lld clang`
76+
# - Arch: `sudo pacman -S lld clang`
77+
"-Clink-arg=-fuse-ld=lld",
78+
79+
# Mold linker
80+
#
81+
# You may need to install it:
82+
#
83+
# - Ubuntu: `sudo apt-get install mold clang`
84+
# - Fedora: `sudo dnf install mold clang`
85+
# - Arch: `sudo pacman -S mold clang`
86+
# "-Clink-arg=-fuse-ld=/usr/bin/mold",
87+
88+
# Nightly
89+
# "-Zshare-generics=y",
90+
# "-Zthreads=0",
1291
]
1392

14-
# NOTE: you must install [Mach-O LLD Port](https://lld.llvm.org/MachO/index.html) on mac. you can easily do this by installing llvm which includes lld with the "brew" package manager:
15-
# `brew install llvm`
1693
[target.x86_64-apple-darwin]
1794
rustflags = [
18-
"-Clink-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld", # Use LLD Linker
19-
"-Zshare-generics=y", # (Nightly) Make the current crate share its generic instantiations
20-
"-Zthreads=0", # (Nightly) Use improved multithreading with the recommended amount of threads.
95+
# LLD linker
96+
#
97+
# The default ld64 linker is faster, you should continue using it instead.
98+
#
99+
# You may need to install it:
100+
#
101+
# Brew: `brew install llvm`
102+
# Manually: <https://lld.llvm.org/MachO/index.html>
103+
# "-Clink-arg=-fuse-ld=/usr/local/opt/llvm/bin/ld64.lld",
104+
105+
# Nightly
106+
# "-Zshare-generics=y",
107+
# "-Zthreads=0",
21108
]
22109

23110
[target.aarch64-apple-darwin]
24111
rustflags = [
25-
"-Clink-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld", # Use LLD Linker
26-
"-Zshare-generics=y", # (Nightly) Make the current crate share its generic instantiations
27-
"-Zthreads=0", # (Nightly) Use improved multithreading with the recommended amount of threads.
112+
# LLD linker
113+
#
114+
# The default ld64 linker is faster, you should continue using it instead.
115+
#
116+
# You may need to install it:
117+
#
118+
# Brew: `brew install llvm`
119+
# Manually: <https://lld.llvm.org/MachO/index.html>
120+
# "-Clink-arg=-fuse-ld=/opt/homebrew/opt/llvm/bin/ld64.lld",
121+
122+
# Nightly
123+
# "-Zshare-generics=y",
124+
# "-Zthreads=0",
28125
]
29126

30127
[target.x86_64-pc-windows-msvc]
31-
linker = "rust-lld.exe" # Use LLD Linker
128+
# LLD linker
129+
#
130+
# You may need to install it:
131+
#
132+
# ```
133+
# cargo install -f cargo-binutils
134+
# rustup component add llvm-tools
135+
# ```
136+
linker = "rust-lld.exe"
32137
rustflags = [
33-
"-Zshare-generics=n", # (Nightly)
34-
"-Zthreads=0", # (Nightly) Use improved multithreading with the recommended amount of threads.
138+
# Nightly
139+
# "-Zshare-generics=y",
140+
# "-Zthreads=0",
35141
]
36142

37143
# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
38144
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
39-
#[profile.dev]
40-
#debug = 1
145+
# [profile.dev]
146+
# debug = 1
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
(
2-
exit_after: Some(300)
2+
events: [
3+
(300, AppExit),
4+
]
35
)

.github/example-run/breakout.ron

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
(
2-
exit_after: Some(900),
3-
frame_time: Some(0.03),
4-
screenshot_frames: [200],
2+
setup: (
3+
fixed_frame_time: Some(0.03),
4+
),
5+
events: [
6+
(200, Screenshot),
7+
(900, AppExit),
8+
]
59
)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
(
2-
exit_after: Some(900)
2+
events: [
3+
(900, AppExit),
4+
]
35
)

.github/example-run/load_gltf.ron

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
(
2-
exit_after: Some(300),
3-
frame_time: Some(0.03),
4-
screenshot_frames: [100],
2+
setup: (
3+
frame_time: Some(0.03),
4+
),
5+
events: [
6+
(100, Screenshot),
7+
(300, AppExit),
8+
]
59
)
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
(
2-
exit_after: Some(100)
2+
events: [
3+
(100, AppExit),
4+
]
35
)

.github/example-run/scene.ron

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
(
2-
exit_after: Some(100)
2+
events: [
3+
(100, AppExit),
4+
]
35
)

.github/pull_request_template.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
- Describe the solution used to achieve the objective above.
99

10+
## Testing
11+
12+
- Did you test these changes? If so, how?
13+
- Are there any parts that need more testing?
14+
- How can other people (reviewers) test your changes? Is there anything specific they need to know?
15+
- If relevant, what platforms did you test these changes on, and are there any important ones you can't test?
16+
1017
---
1118

1219
## Changelog

.github/workflows/ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
env:
1111
CARGO_TERM_COLOR: always
12+
# If nightly is breaking CI, modify this variable to target a specific nightly version.
1213
NIGHTLY_TOOLCHAIN: nightly
1314

1415
concurrency:
@@ -70,6 +71,7 @@ jobs:
7071
run: cargo run -p ci -- lints
7172

7273
miri:
74+
# Explicity use MacOS 14 to take advantage of M1 chip.
7375
runs-on: macos-14
7476
timeout-minutes: 60
7577
steps:
@@ -216,7 +218,7 @@ jobs:
216218
steps:
217219
- uses: actions/checkout@v4
218220
- name: Check for typos
219-
uses: crate-ci/typos@v1.20.8
221+
uses: crate-ci/typos@v1.20.10
220222
- name: Typos info
221223
if: failure()
222224
run: |
@@ -228,6 +230,7 @@ jobs:
228230
229231
230232
run-examples-macos-metal:
233+
# Explicity use MacOS 14 to take advantage of M1 chip.
231234
runs-on: macos-14
232235
timeout-minutes: 30
233236
steps:
@@ -388,12 +391,13 @@ jobs:
388391
target/
389392
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
390393
- name: get MSRV
394+
id: msrv
391395
run: |
392396
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
393-
echo "MSRV=$msrv" >> $GITHUB_ENV
397+
echo "msrv=$msrv" >> $GITHUB_OUTPUT
394398
- uses: dtolnay/rust-toolchain@master
395399
with:
396-
toolchain: ${{ env.MSRV }}
400+
toolchain: ${{ steps.msrv.outputs.msrv }}
397401
- name: Install Linux dependencies
398402
uses: ./.github/actions/install-linux-deps
399403
- name: Run cargo check

.github/workflows/daily.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
env:
99
CARGO_TERM_COLOR: always
10-
NIGHTLY_TOOLCHAIN: nightly
1110

1211
jobs:
1312
build-for-iOS:

0 commit comments

Comments
 (0)