Skip to content
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ updates:
interval: weekly
labels:
- "C-Dependencies"
- package-ecosystem: rust-toolchain
directory: /
schedule:
interval: daily
labels:
- "C-Build-System"
18 changes: 18 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
~/.cargo/git/db/
target/
- uses: dtolnay/rust-toolchain@stable
- name: override
run: rustup override set stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Build & run tests
Expand Down Expand Up @@ -78,6 +80,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: override
run: rustup override set stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
with:
Expand Down Expand Up @@ -110,6 +114,8 @@ jobs:
with:
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
components: miri
- name: override
run: rustup override set ${{ env.NIGHTLY_TOOLCHAIN }}
- 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-disable-weak-memory-emulation" xargs -n1 cargo miri test -p bevy_ecs --lib -- --exact
Expand Down Expand Up @@ -145,6 +151,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: override
run: rustup override set stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand Down Expand Up @@ -174,6 +182,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-none
- name: override
run: rustup override set stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand Down Expand Up @@ -202,6 +212,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: thumbv6m-none-eabi
- name: override
run: rustup override set stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand Down Expand Up @@ -230,6 +242,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-unknown-none
- name: override
run: rustup override set stable
- name: Install Linux dependencies
uses: ./.github/actions/install-linux-deps
- name: Check Compile
Expand Down Expand Up @@ -258,6 +272,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
target: wasm32-unknown-unknown
- name: override
run: rustup override set stable
- name: Check wasm
env:
RUSTFLAGS: --cfg getrandom_backend="wasm_js"
Expand Down Expand Up @@ -288,6 +304,8 @@ jobs:
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }}
targets: wasm32-unknown-unknown
components: rust-src
- name: override
run: rustup override set ${{ env.NIGHTLY_TOOLCHAIN }}
- name: Check wasm
run: cargo check --target wasm32-unknown-unknown -Z build-std=std,panic_abort
env:
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.91.1"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the value in being exact, but before adding semi-redundant "things", can you verify that the minimum Rust version in Cargo.toml does not meet your needs?

[package]
rust-version = "1.88.0"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't realize we even had a rust version specified.

Are you saying I should set the toolchain value to match that 1.88 or are you saying that the toolchain file is redundant?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm saying it is partially redundant. It is a piece of metadata that we already bump periodically, that is an attestation that Bevy requires features from that version.

The big tradeoff is that we aren't actually running our CI for that version (we use latest stable).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question is ... is that enough of a solve for your usecase, given that the proposal adds more complexity to our process.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit that being aware of the rust version does change things a little bit, but in my case the reason I want it is for the ability to git bisect and having cargo automatically detect the toolchain it should be using makes it simpler. With that said, yeah, I guess the rust-version field solves the "guessing the compatible rust version" part. Either it didn't exist until recently or that field is essentially ignored by cargo though, because me and many people I've talked to on discord have had issues with invalid rust versions when running git bisect.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The big tradeoff is that we aren't actually running our CI for that version (we use latest stable).

We don't run all the CI on it, but Bevy is built in CI with the rust version from rust-version in this job: https://github.com/bevyengine/bevy/blob/main/.github/workflows/ci.yml#L456

it didn't exist until recently

It was (only) added 3 years ago

I think the issue is maybe with lints (builtin or clippy), with every rust version having new lints that Bevy fails. Or it did happen a few times that new versions of Rust don't compile Bevy, this is fixed usually well enough in advance by the Rust team with PR to Bevy, but if you go back in history with a modern version of rust it will fail to compile.