Skip to content

Commit ecf063a

Browse files
committed
Revert "Merge remote-tracking branch 'upstream/main' into fallible_system_params"
This reverts commit 6c016af.
1 parent 6c016af commit ecf063a

File tree

117 files changed

+2268
-3620
lines changed

Some content is hidden

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

117 files changed

+2268
-3620
lines changed

.github/bors.toml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ status = [
1717
"build-without-default-features (bevy)",
1818
"build-without-default-features (bevy_ecs)",
1919
"build-without-default-features (bevy_reflect)",
20-
"msrv",
2120
]
2221

2322
use_squash_merge = true

.github/workflows/ci.yml

-26
Original file line numberDiff line numberDiff line change
@@ -275,29 +275,3 @@ jobs:
275275
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
276276
- name: Run cargo udeps
277277
run: cargo udeps
278-
279-
msrv:
280-
runs-on: ubuntu-latest
281-
needs: build
282-
steps:
283-
- uses: actions/checkout@v3
284-
- uses: actions/cache@v3
285-
with:
286-
path: |
287-
~/.cargo/bin/
288-
~/.cargo/registry/index/
289-
~/.cargo/registry/cache/
290-
~/.cargo/git/db/
291-
target/
292-
key: ${{ runner.os }}-cargo-msrv-${{ hashFiles('**/Cargo.toml') }}
293-
- name: get MSRV
294-
run: |
295-
msrv=`cargo metadata --no-deps --format-version 1 | jq --raw-output '.packages[] | select(.name=="bevy") | .rust_version'`
296-
echo "MSRV=$msrv" >> $GITHUB_ENV
297-
- uses: dtolnay/rust-toolchain@master
298-
with:
299-
toolchain: ${{ env.MSRV }}
300-
- name: Install alsa and udev
301-
run: sudo apt-get update; sudo apt-get install --no-install-recommends libasound2-dev libudev-dev
302-
- name: Run cargo check
303-
run: cargo check

CONTRIBUTING.md

+47-19
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Bevy is a completely free and open source game engine built in Rust. It currentl
5050
Bevy also currently has the following "development process" goals:
5151

5252
* **Rapid experimentation over API stability**: We need the freedom to experiment and iterate in order to build the best engine we can. This will change over time as APIs prove their staying power.
53-
* **Consistent vision**: The engine needs to feel consistent and cohesive. This takes precedent over democratic and/or decentralized processes. See our [*Bevy Organization doc*](/docs/the_bevy_organization.md) for more details.
53+
* **Consistent vision**: The engine needs to feel consistent and cohesive. This takes precedent over democratic and/or decentralized processes. See [*How we're organized*](#how-were-organized) for more details.
5454
* **Flexibility over bureaucracy**: Developers should feel productive and unencumbered by development processes.
5555
* **Focus**: The Bevy Org should focus on building a small number of features excellently over merging every new community-contributed feature quickly. Sometimes this means pull requests will sit unmerged for a long time. This is the price of focus and we are willing to pay it. Fortunately Bevy is modular to its core. 3rd party plugins are a great way to work around this policy.
5656
* **User-facing API ergonomics come first**: Solid user experience should receive significant focus and investment. It should rarely be compromised in the interest of internal implementation details.
@@ -66,19 +66,41 @@ Bevy also currently has the following "development process" goals:
6666
* Most new features should have at least one minimal [example](https://github.com/bevyengine/bevy/tree/main/examples). These also serve as simple integration tests, as they are run as part of our CI process.
6767
* The more complex or "core" a feature is, the more strict we are about unit tests. Use your best judgement here. We will let you know if your pull request needs more tests. We use [Rust's built in testing framework](https://doc.rust-lang.org/book/ch11-01-writing-tests.html).
6868

69-
## The Bevy Organization
69+
## How we're organized
7070

71-
The Bevy Organization is the group of people responsible for stewarding the Bevy project. It handles things like merging pull requests, choosing project direction, managing bugs / issues / feature requests, running the Bevy website, controlling access to secrets, defining and enforcing best practices, etc.
71+
@cart is, for now, our singular Benevolent Dictator and project lead.
72+
He makes the final decision on both design and code changes within Bevy in order to ensure a coherent vision and consistent quality of code.
7273

73-
Note that you *do not* need to be a member of the Bevy Organization to contribute to Bevy. Community contributors (this means you) can freely open issues, submit pull requests, and review pull requests.
74+
In practice, @cart serves as a shockingly accountable dictator: open to new ideas and to changing his mind in the face of compelling arguments or community consensus.
75+
Check out the next section for details on how this plays out.
7476

75-
Check out our dedicated [Bevy Organization document](/docs/the_bevy_organization.md) to learn more about how we're organized.
77+
[Bevy Org members](https://github.com/orgs/bevyengine/people) are contributors who:
78+
79+
1. Have actively engaged with Bevy development.
80+
2. Have demonstrated themselves to be polite and welcoming representatives of the project with an understanding of our goals and direction.
81+
3. Have asked to join the Bevy Org. Reach out to @cart on [Discord] or email us at [email protected] if you are interested. Everyone is welcome to do this. We generally accept membership requests, so don't hesitate if you are interested!
82+
83+
All Bevy Org members are also Triage Team members. These people can label and close issues and PRs but do not have merge rights or any special authority within the community.
84+
85+
Merge rights within the org are relatively centralized: this requires a large amount of trust when it comes to ethics, technical ability, and ability to enforce consistent project direction.
86+
87+
The current structure is as follows:
88+
89+
* @cart is our project lead, and has final say on controversial decisions
90+
* There is a small group of other maintainers (@alice-i-cecile, @mockersf and @superdump), who have merge rights but abide by the following rules:
91+
* Trivial PRs can be merged without approvals.
92+
* Relatively uncontroversial PRs can be merged following approval from at least two other community members with appropriate expertise.
93+
* Controversial PRs are added to a backlog for @cart to address once two maintainers agree that they are ready.
94+
* If 45 days elapse without action on a controversial PR (approval, feedback or an explicit request to defer), they can be merged without project lead approval.
95+
* The Bevy org is made up of trusted community contributors: this is a relatively low bar, and org members help triage and maintain the project.
96+
* Community contributors (this means you!) can freely open issues, submit PRs and review PRs to improve Bevy.
97+
* As discussed above, community reviews on PRs are incredibly helpful to enable maintainers to merge in uncontroversial PRs in a timely fashion.
7698

7799
### Classifying PRs
78100

79-
Our merge strategy relies on the classification of PRs into three categories: **trivial**, **uncontroversial** and **controversial**.
101+
This strategy relies on a classification of PRs into three categories: **trivial**, **uncontroversial** and **controversial**.
80102
When making PRs, try to split out more controversial changes from less controversial ones, in order to make your work easier to review and merge.
81-
PRs that are deemed controversial will receive the [`S-Controversial`](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Controversial) label, and will have to go through the more thorough review process.
103+
PRs that are deemed controversial will receive the `S-Controversial` label, and will have to go through the more thorough review process.
82104

83105
PRs are trivial if there is no reasonable argument against them. This might include:
84106

@@ -103,27 +125,24 @@ PRs are controversial if there is serious design discussion required, or a large
103125
Finally, changes are "relatively uncontroversial" if they are neither trivial or controversial.
104126
Most PRs should fall into this category.
105127

106-
Here are some useful pull request queries:
107-
108-
* [Uncontroversial pull requests which have been reviewed and are ready for maintainers to merge](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+-label%3AS-Controversial+-label%3AS-Blocked+-label%3AS-Adopt-Me+)
109-
* [Controversial pull requests which have been reviewed and are ready for final input from a Project Lead or SME](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+label%3AS-Controversial+)
110-
111-
### Preparing Releases
128+
## How we work together
112129

130+
Making a game engine is a huge project and facilitating collaboration is a lot of work.
131+
At the moment @cart is our only paid contributor, so [go sponsor him!](https://github.com/sponsors/cart)
113132
We track issues and pull requests that must be included in releases using [Milestones](https://github.com/bevyengine/bevy/milestones).
114133

115-
## Making changes to Bevy
134+
### Making changes to Bevy
116135

117136
Most changes don't require much "process". If your change is relatively straightforward, just do the following:
118137

119138
1. A community member (that's you!) creates one of the following:
120139
* [GitHub Discussions]: An informal discussion with the community. This is the place to start if you want to propose a feature or specific implementation.
121140
* [Issue](https://github.com/bevyengine/bevy/issues): A formal way for us to track a bug or feature. Please look for duplicates before opening a new issue and consider starting with a Discussion.
122141
* [Pull Request](https://github.com/bevyengine/bevy/pulls) (or PR for short): A request to merge code changes. This starts our "review process". You are welcome to start with a pull request, but consider starting with an Issue or Discussion for larger changes (or if you aren't certain about a design). We don't want anyone to waste their time on code that didn't have a chance to be merged! But conversely, sometimes PRs are the most efficient way to propose a change. Just use your own judgement here.
123-
2. Other community members review and comment in an ad-hoc fashion. Active subject matter experts may be pulled into a thread using `@mentions`. If your PR has been quiet for a while and is ready for review, feel free to leave a message to "bump" the thread, or bring it up on [Discord](https://discord.gg/bevy) in an appropriate engine development channel.
142+
2. Other community members review and comment in an ad-hoc fashion. Active subject matter experts may be pulled into a thread using `@mentions`. If your PR has been quiet for a while and is ready for review, feel free to leave a message to "bump" the thread, or bring it up on [Discord] in an appropriate engine development channel.
124143
3. Once they're content with the pull request (design, code quality, documentation, tests), individual reviewers leave "Approved" reviews.
125144
4. After consensus has been reached (typically two approvals from the community or one for extremely simple changes) and CI passes, the [S-Ready-For-Final-Review](https://github.com/bevyengine/bevy/issues?q=is%3Aopen+is%3Aissue+label%3AS-Ready-For-Final-Review) label is added.
126-
5. When they find time, someone with merge rights performs a final code review and merges the PR using [Bors](https://bors.tech/) by typing `bors r+`.
145+
5. When they find time, [someone with merge rights](#how-were-organized) performs a final code review and merges the PR using [Bors](https://bors.tech/) by typing `bors r+`.
127146

128147
### Complex changes
129148

@@ -161,7 +180,7 @@ If you release a game on [itch.io](https://itch.io/games/tag-bevy) we'd be thril
161180

162181
### Teaching others
163182

164-
Bevy is still very young, and light on documentation, tutorials, and accumulated expertise.
183+
Bevy is still very young, and light on documentation, tutorials and accumulated expertise.
165184
By helping others with their issues, and teaching them about Bevy, you will naturally learn the engine and codebase in greater depth while also making our community better!
166185

167186
Some of the best ways to do this are:
@@ -254,7 +273,7 @@ Not even our project lead is exempt from reviews and RFCs!
254273
By giving feedback on this work (and related supporting work), you can help us make sure our releases are both high-quality and timely.
255274

256275
Finally, if nothing brings you more satisfaction than seeing every last issue labeled and all resolved issues closed, feel free to message @cart for a Bevy org role to help us keep things tidy.
257-
As discussed in our [*Bevy Organization doc*](/docs/the_bevy_organization.md), this role only requires good faith and a basic understanding of our development process.
276+
As discussed in [*How we're organized*](#how-were-organized), this role only requires good faith and a basic understanding of our development process.
258277

259278
### How to adopt pull requests
260279

@@ -276,6 +295,15 @@ Then notify org members to close the original.
276295

277296
`Adopted #number-original-pull-request`
278297

298+
### Maintaining code
299+
300+
Maintainers can merge uncontroversial pull requests that have at least two approvals (or at least one for trivial changes).
301+
302+
These search filters show the requests that can be merged by maintainers, and those which need a final approval from @cart.
303+
304+
1. Pulls requests which are ready for maintainers to merge without consultation: [requests to pull](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+-label%3AS-Controversial+-label%3AS-Blocked+-label%3AS-Adopt-Me+)
305+
2. Pull requests which need final input from @cart: [requests to verify](https://github.com/bevyengine/bevy/pulls?q=is%3Aopen+is%3Apr+label%3AS-Ready-For-Final-Review+label%3AS-Controversial+)
306+
279307
### Contributing code
280308

281309
Bevy is actively open to code contributions from community members.
@@ -308,7 +336,7 @@ If you end up adding a new official Bevy crate to the `bevy` repo:
308336

309337
When contributing, please:
310338

311-
* Try to loosely follow the workflow in [*Making changes to Bevy*](#making-changes-to-bevy).
339+
* Try to loosely follow the workflow in [*How we work together*](#how-we-work-together).
312340
* Consult the [style guide](.github/contributing/engine_style_guide.md) to help keep our code base tidy.
313341
* Explain what you're doing and why.
314342
* Document new code with doc comments.

Cargo.toml

+11-8
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ keywords = ["game", "engine", "gamedev", "graphics", "bevy"]
1010
license = "MIT OR Apache-2.0"
1111
readme = "README.md"
1212
repository = "https://github.com/bevyengine/bevy"
13-
rust-version = "1.66.0"
1413

1514
[workspace]
1615
exclude = ["benches", "crates/bevy_ecs_compile_fail_tests", "crates/bevy_reflect_compile_fail_tests"]
@@ -90,13 +89,6 @@ flac = ["bevy_internal/flac"]
9089
mp3 = ["bevy_internal/mp3"]
9190
vorbis = ["bevy_internal/vorbis"]
9291
wav = ["bevy_internal/wav"]
93-
symphonia-aac = ["bevy_internal/symphonia-aac"]
94-
symphonia-all = ["bevy_internal/symphonia-all"]
95-
symphonia-flac = ["bevy_internal/symphonia-flac"]
96-
symphonia-isomp4 = ["bevy_internal/symphonia-isomp4"]
97-
symphonia-mp3 = ["bevy_internal/symphonia-mp3"]
98-
symphonia-vorbis = ["bevy_internal/symphonia-vorbis"]
99-
symphonia-wav = ["bevy_internal/symphonia-wav"]
10092

10193
# Enable watching file system for asset hot reload
10294
filesystem_watcher = ["bevy_internal/filesystem_watcher"]
@@ -1384,6 +1376,17 @@ description = "Shows a visualization of gamepad buttons, sticks, and triggers"
13841376
category = "Tools"
13851377
wasm = false
13861378

1379+
# Transforms
1380+
[[example]]
1381+
name = "global_vs_local_translation"
1382+
path = "examples/transforms/global_vs_local_translation.rs"
1383+
1384+
[package.metadata.example.global_vs_local_translation]
1385+
name = "Global / Local Translation"
1386+
description = "Illustrates the difference between direction of a translation in respect to local object or global object Transform"
1387+
category = "Transforms"
1388+
wasm = true
1389+
13871390
[[example]]
13881391
name = "3d_rotation"
13891392
path = "examples/transforms/3d_rotation.rs"

benches/benches/bevy_ecs/components/archetype_updates.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn added_archetypes(criterion: &mut Criterion) {
109109
stage.run(&mut world);
110110
},
111111
criterion::BatchSize::LargeInput,
112-
);
112+
)
113113
},
114114
);
115115
}

benches/benches/bevy_ecs/scheduling/schedule.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ pub fn build_schedule(criterion: &mut Criterion) {
110110
// Not particularly realistic but this can be refined later.
111111
for i in 0..graph_size {
112112
let mut sys = empty_system.label(labels[i]).before(DummyLabel);
113-
for label in labels.iter().take(i) {
114-
sys = sys.after(*label);
113+
for a in 0..i {
114+
sys = sys.after(labels[a]);
115115
}
116-
for label in &labels[i + 1..graph_size] {
117-
sys = sys.before(*label);
116+
for b in i + 1..graph_size {
117+
sys = sys.before(labels[b]);
118118
}
119119
app.add_system(sys);
120120
}

benches/benches/bevy_ecs/scheduling/stages.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub fn empty_systems(criterion: &mut Criterion) {
5858
});
5959
});
6060
}
61-
group.finish();
61+
group.finish()
6262
}
6363

6464
pub fn busy_systems(criterion: &mut Criterion) {
@@ -107,7 +107,7 @@ pub fn busy_systems(criterion: &mut Criterion) {
107107
);
108108
}
109109
}
110-
group.finish();
110+
group.finish()
111111
}
112112

113113
pub fn contrived(criterion: &mut Criterion) {
@@ -158,5 +158,5 @@ pub fn contrived(criterion: &mut Criterion) {
158158
);
159159
}
160160
}
161-
group.finish();
161+
group.finish()
162162
}

benches/benches/bevy_ecs/world/commands.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ pub fn spawn_commands(criterion: &mut Criterion) {
6161
entity.despawn();
6262
}
6363
}
64+
drop(commands);
6465
command_queue.apply(&mut world);
6566
});
6667
});
@@ -81,7 +82,7 @@ pub fn insert_commands(criterion: &mut Criterion) {
8182
group.measurement_time(std::time::Duration::from_secs(4));
8283

8384
let entity_count = 10_000;
84-
group.bench_function("insert", |bencher| {
85+
group.bench_function(format!("insert"), |bencher| {
8586
let mut world = World::default();
8687
let mut command_queue = CommandQueue::default();
8788
let mut entities = Vec::new();
@@ -96,10 +97,11 @@ pub fn insert_commands(criterion: &mut Criterion) {
9697
.entity(*entity)
9798
.insert((Matrix::default(), Vec3::default()));
9899
}
100+
drop(commands);
99101
command_queue.apply(&mut world);
100102
});
101103
});
102-
group.bench_function("insert_batch", |bencher| {
104+
group.bench_function(format!("insert_batch"), |bencher| {
103105
let mut world = World::default();
104106
let mut command_queue = CommandQueue::default();
105107
let mut entities = Vec::new();
@@ -114,6 +116,7 @@ pub fn insert_commands(criterion: &mut Criterion) {
114116
values.push((*entity, (Matrix::default(), Vec3::default())));
115117
}
116118
commands.insert_or_spawn_batch(values);
119+
drop(commands);
117120
command_queue.apply(&mut world);
118121
});
119122
});
@@ -157,6 +160,7 @@ pub fn fake_commands(criterion: &mut Criterion) {
157160
commands.add(FakeCommandB(0));
158161
}
159162
}
163+
drop(commands);
160164
command_queue.apply(&mut world);
161165
});
162166
});
@@ -199,6 +203,7 @@ pub fn sized_commands_impl<T: Default + Command>(criterion: &mut Criterion) {
199203
for _ in 0..command_count {
200204
commands.add(T::default());
201205
}
206+
drop(commands);
202207
command_queue.apply(&mut world);
203208
});
204209
});

benches/benches/bevy_ecs/world/world_get.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ pub fn query_get_component_simple(criterion: &mut Criterion) {
273273

274274
bencher.iter(|| {
275275
for _x in 0..100000 {
276-
let mut a = unsafe { query.get_unchecked(&world, entity).unwrap() };
276+
let mut a = unsafe { query.get_unchecked(&mut world, entity).unwrap() };
277277
a.0 += 1.0;
278278
}
279279
});

benches/benches/bevy_reflect/list.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn list_apply<M, LBase, LPatch, F1, F2, F3>(
4444
let f_base = f_base(size);
4545
let patch = f_patch(size);
4646
bencher.iter_batched(
47-
f_base,
47+
|| f_base(),
4848
|mut base| base.apply(black_box(&patch)),
4949
BatchSize::SmallInput,
5050
);
@@ -58,7 +58,7 @@ fn concrete_list_apply(criterion: &mut Criterion) {
5858
group.warm_up_time(WARM_UP_TIME);
5959
group.measurement_time(MEASUREMENT_TIME);
6060

61-
let empty_base = |_: usize| Vec::<u64>::new;
61+
let empty_base = |_: usize| || Vec::<u64>::new();
6262
let full_base = |size: usize| move || iter::repeat(0).take(size).collect::<Vec<u64>>();
6363
let patch = |size: usize| iter::repeat(1).take(size).collect::<Vec<u64>>();
6464

0 commit comments

Comments
 (0)