Skip to content

Commit

Permalink
Merge branch 'main' into cb/fix-observe-panic
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile authored Oct 8, 2024
2 parents d1c3b03 + 3d8e56f commit 599476c
Show file tree
Hide file tree
Showing 1,197 changed files with 81,923 additions and 39,722 deletions.
19 changes: 14 additions & 5 deletions .cargo/config_fast_builds.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#
# ## LLD
#
# LLD is a linker from the LLVM project that supports Linux, Windows, MacOS, and WASM. It has the greatest
# LLD is a linker from the LLVM project that supports Linux, Windows, macOS, and Wasm. It has the greatest
# platform support and the easiest installation process. It is enabled by default in this file for Linux
# and Windows. On MacOS, the default linker yields higher performance than LLD and is used instead.
# and Windows. On macOS, the default linker yields higher performance than LLD and is used instead.
#
# To install, please scroll to the corresponding table for your target (eg. `[target.x86_64-pc-windows-msvc]`
# for Windows) and follow the steps under `LLD linker`.
Expand All @@ -25,7 +25,7 @@
# your corresponding target, disable LLD by commenting out its `-Clink-arg=...` line, and enable Mold by
# *uncommenting* its `-Clink-arg=...` line.
#
# There is a fork of Mold named Sold that supports MacOS, but it is unmaintained and is about the same speed as
# There is a fork of Mold named Sold that supports macOS, but it is unmaintained and is about the same speed as
# the default ld64 linker. For this reason, it is not included in this file.
#
# For more information, please see Mold's repository at <https://github.com/rui314/mold>.
Expand Down Expand Up @@ -83,12 +83,21 @@ rustflags = [
# - Ubuntu: `sudo apt-get install mold clang`
# - Fedora: `sudo dnf install mold clang`
# - Arch: `sudo pacman -S mold clang`
# "-Clink-arg=-fuse-ld=/usr/bin/mold",
# "-Clink-arg=-fuse-ld=mold",

# Nightly
# "-Zshare-generics=y",
# "-Zthreads=0",
]
# Some systems may experience linker performance issues when running doc tests.
# See https://github.com/bevyengine/bevy/issues/12207 for details.
rustdocflags = [
# LLD linker
"-Clink-arg=-fuse-ld=lld",

# Mold linker
# "-Clink-arg=-fuse-ld=mold",
]

[target.x86_64-apple-darwin]
rustflags = [
Expand Down Expand Up @@ -142,7 +151,7 @@ rustflags = [
]

# Optional: Uncommenting the following improves compile times, but reduces the amount of debug info to 'line number tables only'
# In most cases the gains are negligible, but if you are on macos and have slow compile times you should see significant gains.
# In most cases the gains are negligible, but if you are on macOS and have slow compile times you should see significant gains.
# [profile.dev]
# debug = 1

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/docs_improvement.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ assignees: ''

Provide a link to the documentation and describe how it could be improved. In what ways is it incomplete, incorrect, or misleading?

If you have suggestions on exactly what the new docs should say, feel free to include them here. Or alternatively, make the changes yourself and [create a pull request](https://bevyengine.org/learn/book/contributing/code/) instead.
If you have suggestions on exactly what the new docs should say, feel free to include them here. Alternatively, make the changes yourself and [create a pull request](https://bevyengine.org/learn/book/contributing/code/) instead.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Feature Request
about: Propose a new feature!
title: ''
labels: C-Enhancement, S-Needs-Triage
labels: C-Feature, S-Needs-Triage
assignees: ''
---

Expand Down
10 changes: 5 additions & 5 deletions .github/actions/install-linux-deps/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@
# repository before you can use this action.
#
# This action will only install dependencies when the current operating system is Linux. It will do
# nothing on any other OS (MacOS, Windows).
# nothing on any other OS (macOS, Windows).

name: Install Linux dependencies
description: Installs the dependencies necessary to build Bevy on Linux.
inputs:
alsa:
description: Install alsa (libasound2-dev)
required: false
default: true
default: "true"
udev:
description: Install udev (libudev-dev)
required: false
default: true
default: "true"
wayland:
description: Install Wayland (libwayland-dev)
required: false
default: false
default: "false"
xkb:
description: Install xkb (libxkbcommon-dev)
required: false
default: false
default: "false"
runs:
using: composite
steps:
Expand Down
39 changes: 0 additions & 39 deletions .github/contributing/engine_style_guide.md

This file was deleted.

64 changes: 0 additions & 64 deletions .github/contributing/example_style_guide.md

This file was deleted.

2 changes: 1 addition & 1 deletion .github/start-wasm-example/tests/wasm_example.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test.beforeEach(async ({ page }) => {

const MAX_TIMEOUT_FOR_TEST = 300_000;

test.describe('WASM example', () => {
test.describe('Wasm example', () => {
test('Wait for success', async ({ page }, testInfo) => {
let start = new Date().getTime();

Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
run: cargo run -p ci -- lints

miri:
# Explicity use MacOS 14 to take advantage of M1 chip.
# Explicity use macOS 14 to take advantage of M1 chip.
runs-on: macos-14
timeout-minutes: 60
steps:
Expand All @@ -92,16 +92,15 @@ jobs:
components: miri
- name: CI job
# To run the tests one item at a time for troubleshooting, use
# 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
# cargo --quiet test --lib -- --list | sed 's/: test$//' | MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact
run: cargo miri test -p bevy_ecs
env:
# -Zrandomize-layout makes sure we dont rely on the layout of anything that might change
RUSTFLAGS: -Zrandomize-layout
# https://github.com/rust-lang/miri#miri--z-flags-and-environment-variables
# -Zmiri-disable-isolation is needed because our executor uses `fastrand` which accesses system time.
# -Zmiri-permissive-provenance disables warnings against int2ptr casts (since those are used by once_cell)
# -Zmiri-ignore-leaks is necessary because a bunch of tests don't join all threads before finishing.
MIRIFLAGS: -Zmiri-ignore-leaks -Zmiri-disable-isolation -Zmiri-permissive-provenance
MIRIFLAGS: -Zmiri-ignore-leaks -Zmiri-disable-isolation

check-compiles:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -219,7 +218,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Check for typos
uses: crate-ci/typos@v1.23.5
uses: crate-ci/typos@v1.25.0
- name: Typos info
if: failure()
run: |
Expand All @@ -231,7 +230,7 @@ jobs:
run-examples-macos-metal:
# Explicity use MacOS 14 to take advantage of M1 chip.
# Explicity use macOS 14 to take advantage of M1 chip.
runs-on: macos-14
timeout-minutes: 30
steps:
Expand Down Expand Up @@ -420,19 +419,19 @@ jobs:
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Check for bevy_internal imports
- name: Check for internal Bevy imports
shell: bash
run: |
errors=""
for file in $(find examples tests -name '*.rs'); do
if grep -q "use bevy_internal" "$file"; then
errors+="ERROR: Detected 'use bevy_internal' in $file\n"
if grep -q "use bevy_" "$file"; then
errors+="ERROR: Detected internal Bevy import in $file\n"
fi
done
if [ -n "$errors" ]; then
echo -e "$errors"
echo " Avoid importing bevy_internal, it should not be used directly"
echo " Fix the issue by replacing 'bevy_internal' with 'bevy'"
echo " Example: 'use bevy::sprite::MaterialMesh2dBundle;' instead of 'bevy_internal::sprite::MaterialMesh2dBundle;'"
echo " Avoid importing internal Bevy crates, they should not be used directly"
echo " Fix the issue by replacing 'bevy_*' with 'bevy'"
echo " Example: 'use bevy::sprite::Mesh2d;' instead of 'bevy_internal::sprite::Mesh2d;'"
exit 1
fi
21 changes: 15 additions & 6 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,23 +46,32 @@ jobs:

- uses: dtolnay/rust-toolchain@stable

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Add Android targets
run: rustup target add aarch64-linux-android armv7-linux-androideabi
run: rustup target add aarch64-linux-android

- name: Install Cargo APK
run: cargo install --force cargo-apk
- name: Install Cargo NDK
run: cargo install --force cargo-ndk

- name: Build app for Android
run: ANDROID_NDK_ROOT=$ANDROID_NDK_LATEST_HOME cargo apk build --package bevy_mobile_example
- name: Build .so file
run: cargo ndk -t arm64-v8a -o android_example/app/src/main/jniLibs build --package bevy_mobile_example
env:
# This will reduce the APK size from 1GB to ~200MB
CARGO_PROFILE_DEV_DEBUG: false

- name: Build app for Android
run: cd examples/mobile/android_example && chmod +x gradlew && ./gradlew build

- name: Upload to Browser Stack
run: |
curl -u "${{ secrets.BROWSERSTACK_USERNAME }}:${{ secrets.BROWSERSTACK_ACCESS_KEY }}" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload" \
-F "file=@target/debug/apk/bevyexample.apk" \
-F "file=@app/build/outputs/apk/debug/app-debug.apk" \
-F "custom_id=$GITHUB_RUN_ID"
nonce:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
- name: Build docs
env:
# needs to be in sync with [package.metadata.docs.rs]
RUSTFLAGS: --cfg docsrs_dep
RUSTDOCFLAGS: -Zunstable-options --cfg=docsrs --generate-link-to-definition
run: |
cargo doc \
Expand All @@ -66,6 +67,7 @@ jobs:
--all-features \
--workspace \
--no-deps \
--document-private-items \
--exclude ci \
--exclude errors \
--exclude bevy_mobile_example \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/post-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
--exclude build-wasm-example
- name: Create PR
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
delete-branch: true
base: "main"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
--exclude build-wasm-example
- name: Create PR
uses: peter-evans/create-pull-request@v6
uses: peter-evans/create-pull-request@v7
with:
delete-branch: true
base: "main"
Expand Down
Loading

0 comments on commit 599476c

Please sign in to comment.