Skip to content

Commit 3c16ac3

Browse files
committed
Merge branch 'main' into reflect-default-attribute
2 parents d4d0369 + aced6af commit 3c16ac3

File tree

423 files changed

+23299
-6625
lines changed

Some content is hidden

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

423 files changed

+23299
-6625
lines changed

.github/bors.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ status = [
1313
"check-missing-examples-in-docs",
1414
"check-unused-dependencies",
1515
"ci",
16-
"check-benches",
16+
"miri",
17+
"check-compiles",
1718
]
1819

1920
use_squash_merge = true

.github/contributing/engine_style_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For more advice on contributing to the engine, see the [relevant section](../../
66

77
## General guidelines
88

9-
1. Prefer granular imports over glob imports of `bevy::prelude::*` and `bevy::sub_crate::*`.
9+
1. Prefer granular imports over glob imports like `bevy_ecs::prelude::*`.
1010
2. Use a consistent comment style:
1111
1. `///` doc comments belong above `#[derive(Trait)]` invocations.
1212
2. `//` comments should generally go above the line in question, rather than in-line.

.github/contributing/example_style_guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ For more advice on writing examples, see the [relevant section](../../CONTRIBUTI
3636
2. Prefer `for` loops over `.for_each`. The latter is faster (for now), but it is less clear for beginners, less idiomatic, and less flexible.
3737
3. Use `.single` and `.single_mut` where appropriate.
3838
4. In Queries, prefer `With<T>` filters over actually fetching unused data with `&T`.
39-
5. Prefer disjoint queries using `With` and `Without` over query sets when you need more than one query in a single system.
39+
5. Prefer disjoint queries using `With` and `Without` over param sets when you need more than one query in a single system.
4040
6. Prefer structs with named fields over tuple structs except in the case of single-field wrapper types.
4141
7. Use enum-labels over string-labels for system / stage / etc. labels.
4242

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(
2+
exit_after: Some(100)
3+
)

.github/example-run/minimising.ron

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(
2+
exit_after: Some(90)
3+
)

.github/example-run/resizing.ron

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(
2+
// Ensures that the full cycle will run
3+
exit_after: Some(410)
4+
)

.github/label-config.yml

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/linters/markdown-link-check.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
{
44
"pattern": "^https?://github\\.com/"
55
},
6+
{
7+
"pattern": "^https?://docs\\.github\\.com/"
8+
},
69
{
710
"pattern": "^https?://reddit\\.com/"
811
}

.github/pull_request_template.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,22 @@
66
## Solution
77

88
- Describe the solution used to achieve the objective above.
9+
10+
---
11+
12+
## Changelog
13+
14+
> This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section.
15+
16+
- What changed as a result of this PR?
17+
- If applicable, organize changes under "Added", "Changed", or "Fixed" sub-headings
18+
- Stick to one or two sentences. If more detail is needed for a particular change, consider adding it to the "Solution" section
19+
- If you can't summarize the work, your change may be unreasonably large / unrelated. Consider splitting your PR to make it easier to review and merge!
20+
21+
## Migration Guide
22+
23+
> This section is optional. If there are no breaking changes, you can delete this section.
24+
25+
- If this PR is a breaking change (relative to the last release of Bevy), describe how a user might need to migrate their code to support these changes
26+
- Simply adding new functionality is not a breaking change.
27+
- Fixing behavior that was definitely a bug, rather than a questionable design choice is not a breaking change.

.github/workflows/ci.yml

Lines changed: 83 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ jobs:
2323
toolchain: nightly
2424
runs-on: ${{ matrix.os }}
2525
steps:
26-
- uses: actions/checkout@v2
27-
- uses: actions/cache@v2
26+
- uses: actions/checkout@v3
27+
- uses: actions/cache@v3
2828
with:
2929
path: |
3030
~/.cargo/bin/
@@ -41,16 +41,17 @@ jobs:
4141
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
4242
if: runner.os == 'linux'
4343
- name: Build & run tests
44-
run: cargo test --workspace
44+
# See tools/ci/src/main.rs for the commands this runs
45+
run: cargo run -p ci -- test
4546
env:
4647
CARGO_INCREMENTAL: 0
4748
RUSTFLAGS: "-C debuginfo=0 -D warnings"
4849

4950
ci:
5051
runs-on: ubuntu-latest
5152
steps:
52-
- uses: actions/checkout@v2
53-
- uses: actions/cache@v2
53+
- uses: actions/checkout@v3
54+
- uses: actions/cache@v3
5455
with:
5556
path: |
5657
~/.cargo/bin/
@@ -68,30 +69,64 @@ jobs:
6869
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
6970
- name: CI job
7071
# See tools/ci/src/main.rs for the commands this runs
71-
run: cargo run -p ci -- nonlocal
72+
run: cargo run -p ci -- lints
73+
74+
miri:
75+
runs-on: ubuntu-latest
76+
steps:
77+
- uses: actions/checkout@v3
78+
- uses: actions/cache@v3
79+
with:
80+
path: |
81+
~/.cargo/bin/
82+
~/.cargo/registry/index/
83+
~/.cargo/registry/cache/
84+
~/.cargo/git/db/
85+
target/
86+
key: ${{ runner.os }}-cargo-ci-${{ hashFiles('**/Cargo.toml') }}
87+
- uses: actions-rs/toolchain@v1
88+
with:
89+
toolchain: nightly
90+
components: miri
91+
override: true
92+
- name: Install alsa and udev
93+
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
94+
- name: CI job
95+
run: cargo miri test -p bevy_ecs
96+
env:
97+
# -Zrandomize-layout makes sure we dont rely on the layout of anything that might change
98+
RUSTFLAGS: -Zrandomize-layout
99+
# -Zmiri-disable-isolation is needed because our executor uses `fastrand` which accesses system time.
100+
# -Zmiri-ignore-leaks is needed because running bevy_ecs tests finds a memory leak but its impossible
101+
# to track down because allocids are nondeterministic.
102+
# -Zmiri-tag-raw-pointers is not strictly "necessary" but enables a lot of extra UB checks relating
103+
# to raw pointer aliasing rules that we should be trying to uphold.
104+
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-tag-raw-pointers
72105

73-
check-benches:
106+
check-compiles:
74107
runs-on: ubuntu-latest
75108
needs: ci
76109
steps:
77-
- uses: actions/checkout@v2
78-
- uses: actions/cache@v2
110+
- uses: actions/checkout@v3
111+
- uses: actions/cache@v3
79112
with:
80113
path: |
81114
~/.cargo/bin/
82115
~/.cargo/registry/index/
83116
~/.cargo/registry/cache/
84117
~/.cargo/git/db/
85118
target/
86-
key: ${{ runner.os }}-cargo-check-benches-${{ hashFiles('**/Cargo.toml') }}
119+
crates/bevy_ecs_compile_fail_tests/target/
120+
key: ${{ runner.os }}-cargo-check-compiles-${{ hashFiles('**/Cargo.toml') }}
87121
- uses: actions-rs/toolchain@v1
88122
with:
89123
toolchain: stable
90124
override: true
91125
- name: Install alsa and udev
92126
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
93-
- name: Check Benches
94-
run: cd benches && cargo check --benches
127+
- name: Check Compile
128+
# See tools/ci/src/main.rs for the commands this runs
129+
run: cargo run -p ci -- compile
95130

96131
build-wasm:
97132
strategy:
@@ -100,8 +135,8 @@ jobs:
100135
os: [ubuntu-latest]
101136
runs-on: ${{ matrix.os }}
102137
steps:
103-
- uses: actions/checkout@v2
104-
- uses: actions/cache@v2
138+
- uses: actions/checkout@v3
139+
- uses: actions/cache@v3
105140
with:
106141
path: |
107142
~/.cargo/bin/
@@ -124,11 +159,11 @@ jobs:
124159
build-android:
125160
runs-on: ubuntu-latest
126161
steps:
127-
- uses: actions/checkout@v2
162+
- uses: actions/checkout@v3
128163
- uses: actions-rs/toolchain@v1
129164
with:
130165
toolchain: stable
131-
- uses: actions/cache@v2
166+
- uses: actions/cache@v3
132167
with:
133168
path: |
134169
~/.cargo/bin/
@@ -151,7 +186,7 @@ jobs:
151186
needs: check-missing-examples-in-docs
152187
if: always()
153188
steps:
154-
- uses: actions/checkout@v2
189+
- uses: actions/checkout@v3
155190
with:
156191
# Full git history is needed to get a proper list of changed files within `super-linter`
157192
fetch-depth: 0
@@ -169,7 +204,7 @@ jobs:
169204
needs: markdownlint
170205
if: always()
171206
steps:
172-
- uses: actions/checkout@v2
207+
- uses: actions/checkout@v3
173208
- name: check dead links
174209
continue-on-error: true
175210
id: run1
@@ -227,8 +262,8 @@ jobs:
227262
sudo add-apt-repository ppa:oibaf/graphics-drivers -y
228263
sudo apt-get update
229264
sudo apt install -y xvfb libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers
230-
- uses: actions/checkout@v2
231-
- uses: actions/cache@v2
265+
- uses: actions/checkout@v3
266+
- uses: actions/cache@v3
232267
with:
233268
path: |
234269
~/.cargo/bin/
@@ -242,46 +277,59 @@ jobs:
242277
toolchain: stable
243278
- name: Build bevy
244279
run: |
245-
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome"
280+
cargo build --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome,bevy_audio,vorbis"
246281
- name: Run examples
247282
run: |
248283
for example in .github/example-run/*.ron; do
249284
example_name=`basename $example .ron`
250285
echo "running $example_name - "`date`
251-
time CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome"
286+
time TRACE_CHROME=trace-$example_name.json CI_TESTING_CONFIG=$example xvfb-run cargo run --example $example_name --no-default-features --features "bevy_dynamic_plugin,bevy_gilrs,bevy_gltf,bevy_winit,render,png,hdr,x11,bevy_ci_testing,trace,trace_chrome,bevy_audio,vorbis"
252287
sleep 10
253288
done
254289
zip traces.zip trace*.json
255290
- name: save traces
256-
uses: actions/upload-artifact@v1
291+
uses: actions/upload-artifact@v3
257292
with:
258293
name: example-traces.zip
259294
path: traces.zip
260295

261296
check-doc:
262297
runs-on: ubuntu-latest
263-
needs: check-markdown-links
264-
if: always()
265298
steps:
266-
- uses: actions/checkout@v2
299+
- uses: actions/checkout@v3
300+
- uses: actions/cache@v2
301+
with:
302+
path: |
303+
~/.cargo/bin/
304+
~/.cargo/registry/index/
305+
~/.cargo/registry/cache/
306+
~/.cargo/git/db/
307+
target/
308+
key: ${{ runner.os }}-check-doc-${{ hashFiles('**/Cargo.toml') }}
267309
- uses: actions-rs/toolchain@v1
268310
with:
269311
toolchain: stable
270312
- name: Install alsa and udev
271313
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev
272314
if: runner.os == 'linux'
273-
- name: Installs cargo-deadlinks
274-
run: cargo install --force cargo-deadlinks
275315
- name: Build and check doc
276-
run: RUSTDOCFLAGS='-D warnings' cargo doc --workspace --all-features --no-deps --document-private-items
277-
- name: Checks dead links
278-
run: cargo deadlinks --dir target/doc/bevy
279-
continue-on-error: true
316+
# See tools/ci/src/main.rs for the commands this runs
317+
run: cargo run -p ci -- doc
318+
env:
319+
CARGO_INCREMENTAL: 0
320+
RUSTFLAGS: "-C debuginfo=0"
321+
# This currently report a lot of false positives
322+
# Enable it again once it's fixed - https://github.com/bevyengine/bevy/issues/1983
323+
# - name: Installs cargo-deadlinks
324+
# run: cargo install --force cargo-deadlinks
325+
# - name: Checks dead links
326+
# run: cargo deadlinks --dir target/doc/bevy
327+
# continue-on-error: true
280328

281329
check-missing-examples-in-docs:
282330
runs-on: ubuntu-latest
283331
steps:
284-
- uses: actions/checkout@v2
332+
- uses: actions/checkout@v3
285333
- name: Check that examples are present in both README and Cargo
286334
uses: Weibye/[email protected]
287335
with:
@@ -294,8 +342,8 @@ jobs:
294342
check-unused-dependencies:
295343
runs-on: ubuntu-latest
296344
steps:
297-
- uses: actions/checkout@v2
298-
- uses: actions/cache@v2
345+
- uses: actions/checkout@v3
346+
- uses: actions/cache@v3
299347
with:
300348
path: |
301349
~/.cargo/bin/

.github/workflows/dependencies.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
check-advisories:
2323
runs-on: ubuntu-latest
2424
steps:
25-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
2626
- uses: actions-rs/toolchain@v1
2727
with:
2828
toolchain: stable
@@ -35,7 +35,7 @@ jobs:
3535
check-bans:
3636
runs-on: ubuntu-latest
3737
steps:
38-
- uses: actions/checkout@v2
38+
- uses: actions/checkout@v3
3939
- uses: actions-rs/toolchain@v1
4040
with:
4141
toolchain: stable
@@ -48,7 +48,7 @@ jobs:
4848
check-licenses:
4949
runs-on: ubuntu-latest
5050
steps:
51-
- uses: actions/checkout@v2
51+
- uses: actions/checkout@v3
5252
- uses: actions-rs/toolchain@v1
5353
with:
5454
toolchain: stable
@@ -61,7 +61,7 @@ jobs:
6161
check-sources:
6262
runs-on: ubuntu-latest
6363
steps:
64-
- uses: actions/checkout@v2
64+
- uses: actions/checkout@v3
6565
- uses: actions-rs/toolchain@v1
6666
with:
6767
toolchain: stable

0 commit comments

Comments
 (0)