Skip to content

Commit 207075e

Browse files
committed
Merge branch 'main' into task-pool-consolidation
2 parents 274fe31 + cae07ef commit 207075e

File tree

771 files changed

+43086
-15391
lines changed

Some content is hidden

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

771 files changed

+43086
-15391
lines changed

.cargo/config_fast_builds.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustflags = [
3030
[target.x86_64-pc-windows-msvc]
3131
linker = "rust-lld.exe" # Use LLD Linker
3232
rustflags = [
33-
"-Zshare-generics=n",
33+
"-Zshare-generics=n", # (Nightly)
3434
"-Zthreads=0", # (Nightly) Use improved multithreading with the recommended amount of threads.
3535
]
3636

.github/FUNDING.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
# These are supported funding model platforms
2-
3-
custom: https://bevyengine.org/community/donate/
1+
custom: https://bevyengine.org/donate/
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# This action installs a few dependencies necessary to build Bevy on Linux. By default it installs
2+
# alsa and udev, but can be configured depending on which libraries are needed:
3+
#
4+
# ```
5+
# - uses: ./.github/actions/install-linux-deps
6+
# with:
7+
# alsa: false
8+
# wayland: true
9+
# ```
10+
#
11+
# See the `inputs` section for all options and their defaults. Note that you must checkout the
12+
# repository before you can use this action.
13+
#
14+
# This action will only install dependencies when the current operating system is Linux. It will do
15+
# nothing on any other OS (MacOS, Windows).
16+
17+
name: Install Linux dependencies
18+
description: Installs the dependencies necessary to build Bevy on Linux.
19+
inputs:
20+
alsa:
21+
description: Install alsa (libasound2-dev)
22+
required: false
23+
default: true
24+
udev:
25+
description: Install udev (libudev-dev)
26+
required: false
27+
default: true
28+
wayland:
29+
description: Install Wayland (libwayland-dev)
30+
required: false
31+
default: false
32+
xkb:
33+
description: Install xkb (libxkbcommon-dev)
34+
required: false
35+
default: false
36+
runs:
37+
using: composite
38+
steps:
39+
- name: Install Linux dependencies
40+
shell: bash
41+
if: ${{ runner.os == 'linux' }}
42+
run: >
43+
sudo apt-get update
44+
45+
sudo apt-get install --no-install-recommends
46+
${{ fromJSON(inputs.alsa) && 'libasound2-dev' || '' }}
47+
${{ fromJSON(inputs.udev) && 'libudev-dev' || '' }}
48+
${{ fromJSON(inputs.wayland) && 'libwayland-dev' || '' }}
49+
${{ fromJSON(inputs.xkb) && 'libxkbcommon-dev' || '' }}

.github/contributing/engine_style_guide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ For more advice on contributing to the engine, see the [relevant section](../../
1414
4. Use \`variable_name\` code blocks in comments to signify that you're referring to specific types and variables.
1515
5. Start comments with capital letters. End them with a period if they are sentence-like.
1616
3. Use comments to organize long and complex stretches of code that can't sensibly be refactored into separate functions.
17+
4. When using [Bevy error codes](https://bevyengine.org/learn/errors/) include a link to the relevant error on the Bevy website in the returned error message `... See: https://bevyengine.org/learn/errors/#b0003`.
1718

1819
## Rust API guidelines
1920

.github/workflows/ci.yml

Lines changed: 117 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ env:
1111
CARGO_TERM_COLOR: always
1212
NIGHTLY_TOOLCHAIN: nightly
1313

14+
concurrency:
15+
group: ${{github.workflow}}-${{github.ref}}
16+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
17+
1418
jobs:
1519
build:
1620
strategy:
@@ -30,9 +34,8 @@ jobs:
3034
target/
3135
key: ${{ runner.os }}-cargo-build-stable-${{ hashFiles('**/Cargo.toml') }}
3236
- uses: dtolnay/rust-toolchain@stable
33-
- name: Install alsa and udev
34-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
35-
if: runner.os == 'linux'
37+
- name: Install Linux dependencies
38+
uses: ./.github/actions/install-linux-deps
3639
- name: Build & run tests
3740
# See tools/ci/src/main.rs for the commands this runs
3841
run: cargo run -p ci -- test
@@ -57,14 +60,17 @@ jobs:
5760
- uses: dtolnay/rust-toolchain@stable
5861
with:
5962
components: rustfmt, clippy
60-
- name: Install alsa and udev
61-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
63+
- name: Install Linux dependencies
64+
uses: ./.github/actions/install-linux-deps
65+
with:
66+
wayland: true
67+
xkb: true
6268
- name: CI job
6369
# See tools/ci/src/main.rs for the commands this runs
6470
run: cargo run -p ci -- lints
6571

6672
miri:
67-
runs-on: ubuntu-latest
73+
runs-on: macos-14
6874
timeout-minutes: 60
6975
steps:
7076
- uses: actions/checkout@v4
@@ -81,8 +87,6 @@ jobs:
8187
with:
8288
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
8389
components: miri
84-
- name: Install alsa and udev
85-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
8690
- name: CI job
8791
# To run the tests one item at a time for troubleshooting, use
8892
# cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact
@@ -116,8 +120,8 @@ jobs:
116120
- uses: dtolnay/rust-toolchain@stable
117121
with:
118122
toolchain: stable
119-
- name: Install alsa and udev
120-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
123+
- name: Install Linux dependencies
124+
uses: ./.github/actions/install-linux-deps
121125
- name: Check Compile
122126
# See tools/ci/src/main.rs for the commands this runs
123127
run: cargo run -p ci -- compile
@@ -142,8 +146,31 @@ jobs:
142146
target: wasm32-unknown-unknown
143147
- name: Check wasm
144148
run: cargo check --target wasm32-unknown-unknown
149+
150+
build-wasm-atomics:
151+
runs-on: ubuntu-latest
152+
timeout-minutes: 30
153+
needs: build
154+
steps:
155+
- uses: actions/checkout@v4
156+
- uses: actions/cache@v4
157+
with:
158+
path: |
159+
~/.cargo/bin/
160+
~/.cargo/registry/index/
161+
~/.cargo/registry/cache/
162+
~/.cargo/git/db/
163+
target/
164+
key: ubuntu-assets-cargo-build-wasm-nightly-${{ hashFiles('**/Cargo.toml') }}
165+
- uses: dtolnay/rust-toolchain@master
166+
with:
167+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
168+
targets: wasm32-unknown-unknown
169+
components: rust-src
170+
- name: Check wasm
171+
run: cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
145172
env:
146-
RUSTFLAGS: --cfg=web_sys_unstable_apis
173+
RUSTFLAGS: "-C target-feature=+atomics,+bulk-memory"
147174

148175
markdownlint:
149176
runs-on: ubuntu-latest
@@ -183,40 +210,66 @@ jobs:
183210
echo 'Or if you use VSCode, use the `Even Better Toml` extension with 2 spaces'
184211
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml'
185212
186-
187-
run-examples-on-windows-dx12:
188-
runs-on: windows-latest
189-
timeout-minutes: 60
213+
typos:
214+
runs-on: ubuntu-latest
215+
timeout-minutes: 30
190216
steps:
191217
- uses: actions/checkout@v4
218+
- name: Check for typos
219+
uses: crate-ci/[email protected]
220+
- name: Typos info
221+
if: failure()
222+
run: |
223+
echo 'To fix typos, please run `typos -w`'
224+
echo 'To check for a diff, run `typos`'
225+
echo 'You can find typos here: https://crates.io/crates/typos'
226+
echo 'if you use VSCode, you can also install `Typos Spell Checker'
227+
echo 'You can find the extension here: https://marketplace.visualstudio.com/items?itemName=tekumara.typos-vscode'
192228
193-
- uses: dtolnay/rust-toolchain@stable
194-
195-
- uses: actions/cache@v4
196-
with:
197-
path: |
198-
~/.cargo/bin/
199-
~/.cargo/registry/index/
200-
~/.cargo/registry/cache/
201-
~/.cargo/git/db/
202-
target/
203-
key: ${{ runner.os }}-windows-run-examples-${{ hashFiles('**/Cargo.toml') }}
204229
230+
run-examples-macos-metal:
231+
runs-on: macos-14
232+
timeout-minutes: 30
233+
steps:
234+
- uses: actions/checkout@v4
235+
- uses: dtolnay/rust-toolchain@stable
236+
- name: Disable audio
237+
# Disable audio through a patch. on github m1 runners, audio timeouts after 15 minutes
238+
run: git apply --ignore-whitespace tools/example-showcase/disable-audio.patch
205239
- name: Build bevy
206-
shell: bash
207240
# this uses the same command as when running the example to ensure build is reused
208241
run: |
209-
WGPU_BACKEND=dx12 CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing"
210-
242+
TRACE_CHROME=trace-alien_cake_addict.json CI_TESTING_CONFIG=.github/example-run/alien_cake_addict.ron cargo build --example alien_cake_addict --features "bevy_ci_testing,trace,trace_chrome"
211243
- name: Run examples
212-
shell: bash
213244
run: |
214245
for example in .github/example-run/*.ron; do
215246
example_name=`basename $example .ron`
247+
echo -n $example_name > last_example_run
216248
echo "running $example_name - "`date`
217-
time WGPU_BACKEND=dx12 CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing"
249+
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example cargo run --example $example_name --features "bevy_ci_testing,trace,trace_chrome"
218250
sleep 10
251+
if [ `find ./ -maxdepth 1 -name 'screenshot-*.png' -print -quit` ]; then
252+
mkdir screenshots-$example_name
253+
mv screenshot-*.png screenshots-$example_name/
254+
fi
219255
done
256+
mkdir traces && mv trace*.json traces/
257+
mkdir screenshots && mv screenshots-* screenshots/
258+
- name: save traces
259+
uses: actions/upload-artifact@v4
260+
with:
261+
name: example-traces-macos
262+
path: traces
263+
- name: save screenshots
264+
uses: actions/upload-artifact@v4
265+
with:
266+
name: screenshots-macos
267+
path: screenshots
268+
- uses: actions/upload-artifact@v4
269+
if: ${{ failure() && github.event_name == 'pull_request' }}
270+
with:
271+
name: example-run-macos
272+
path: example-run/
220273

221274
check-doc:
222275
runs-on: ubuntu-latest
@@ -233,9 +286,11 @@ jobs:
233286
target/
234287
key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
235288
- uses: dtolnay/rust-toolchain@stable
236-
- name: Install alsa and udev
237-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
238-
if: runner.os == 'linux'
289+
- name: Install Linux dependencies
290+
uses: ./.github/actions/install-linux-deps
291+
with:
292+
wayland: true
293+
xkb: true
239294
- name: Build and check doc
240295
# See tools/ci/src/main.rs for the commands this runs
241296
run: cargo run -p ci -- doc
@@ -339,8 +394,8 @@ jobs:
339394
- uses: dtolnay/rust-toolchain@master
340395
with:
341396
toolchain: ${{ env.MSRV }}
342-
- name: Install alsa and udev
343-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
397+
- name: Install Linux dependencies
398+
uses: ./.github/actions/install-linux-deps
344399
- name: Run cargo check
345400
id: check
346401
run: cargo check
@@ -375,4 +430,29 @@ jobs:
375430
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'"
376431
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
377432
exit 1
378-
fi
433+
fi
434+
check-cfg:
435+
runs-on: ubuntu-latest
436+
timeout-minutes: 30
437+
steps:
438+
- uses: actions/checkout@v4
439+
- uses: actions/cache@v4
440+
with:
441+
path: |
442+
~/.cargo/bin/
443+
~/.cargo/registry/index/
444+
~/.cargo/registry/cache/
445+
~/.cargo/git/db/
446+
target/
447+
key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
448+
- uses: dtolnay/rust-toolchain@master
449+
with:
450+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
451+
- name: Install Linux dependencies
452+
uses: ./.github/actions/install-linux-deps
453+
with:
454+
wayland: true
455+
xkb: true
456+
- name: Build and check cfg typos
457+
# See tools/ci/src/main.rs for the commands this runs
458+
run: cargo run -p ci -- cfg-check

.github/workflows/dependencies.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
branches:
1313
- main
1414

15+
concurrency:
16+
group: ${{github.workflow}}-${{github.ref}}
17+
cancel-in-progress: ${{github.event_name == 'pull_request'}}
18+
1519
env:
1620
CARGO_TERM_COLOR: always
1721

.github/workflows/docs.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ on:
44
push:
55
branches:
66
- 'main'
7-
87
# Allows running the action manually.
98
workflow_dispatch:
109

1110
env:
1211
CARGO_TERM_COLOR: always
1312
RUSTDOCFLAGS: --html-in-header header.html
13+
NIGHTLY_TOOLCHAIN: nightly
1414

1515
# Sets the permissions to allow deploying to Github pages.
1616
permissions:
@@ -33,11 +33,15 @@ jobs:
3333
- name: Checkout
3434
uses: actions/checkout@v4
3535

36-
- name: Install Rust
37-
uses: dtolnay/rust-toolchain@stable
36+
- uses: dtolnay/rust-toolchain@master
37+
with:
38+
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
3839

39-
- name: Install alsa and udev
40-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
40+
- name: Install Linux dependencies
41+
uses: ./.github/actions/install-linux-deps
42+
with:
43+
wayland: true
44+
xkb: true
4145

4246
# This does the following:
4347
# - Replaces the docs icon with one that clearly denotes it's not the released package on crates.io
@@ -48,7 +52,10 @@ jobs:
4852
echo "<meta name=\"robots\" content=\"noindex\">" > header.html
4953
5054
- name: Build docs
51-
run: cargo doc --all-features --no-deps -p bevy
55+
env:
56+
# needs to be in sync with [package.metadata.docs.rs]
57+
RUSTDOCFLAGS: -Zunstable-options --cfg=docsrs
58+
run: cargo doc --all-features --no-deps -p bevy -Zunstable-options -Zrustdoc-scrape-examples
5259

5360
# This adds the following:
5461
# - A top level redirect to the bevy crate documentation

0 commit comments

Comments
 (0)