Skip to content

Commit 4c85db6

Browse files
mockersfItsDoot
authored andcommitted
unpin nightly and disable weak memory emulation (bevyengine#4988)
# Objective - Follow suggestion from bevyengine#4984 (comment) ## Solution - Unpin nightly, disable weak memory emulation --- This failed the miri job in my branch with the following error: ``` error: Undefined Behavior: attempting a read access using <untagged> at alloc198028[0x0], but that tag does not exist in the borrow stack for this location --> /home/runner/.cargo/registry/src/gb.xjqchip.workers.dev-1ecc6299db9ec823/once_cell-1.12.0/src/imp_std.rs:177:28 | 177 | let next = (*waiter).next; | ^^^^^^^^^^^^^^ | | | attempting a read access using <untagged> at alloc198028[0x0], but that tag does not exist in the borrow stack for this location | this error occurs as part of an access at alloc198028[0x0..0x8] | = help: this indicates a potential bug in the program: it performed an invalid operation, but the rules it violated are still experimental = help: see https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md for further information ``` @BoxyUwU could you take a look? I guess it's related to the issue mentioned in rust-lang/miri#2223
1 parent 6723bad commit 4c85db6

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

.github/workflows/ci.yml

+14-15
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,18 @@ jobs:
7676
timeout-minutes: 60
7777
steps:
7878
- uses: actions/checkout@v3
79-
# TODO: re-enable cache once nightly is unpinned
80-
# - uses: actions/cache@v3
81-
# with:
82-
# path: |
83-
# ~/.cargo/bin/
84-
# ~/.cargo/registry/index/
85-
# ~/.cargo/registry/cache/
86-
# ~/.cargo/git/db/
87-
# target/
88-
# key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.toml') }}
79+
- uses: actions/cache@v3
80+
with:
81+
path: |
82+
~/.cargo/bin/
83+
~/.cargo/registry/index/
84+
~/.cargo/registry/cache/
85+
~/.cargo/git/db/
86+
target/
87+
key: ${{ runner.os }}-cargo-miri-${{ hashFiles('**/Cargo.toml') }}
8988
- uses: actions-rs/toolchain@v1
9089
with:
91-
# TODO: check again with nightly once https://github.com/rust-lang/miri/issues/2223 is fixed
92-
toolchain: nightly-2022-06-08
90+
toolchain: nightly
9391
components: miri
9492
override: true
9593
- name: Install alsa and udev
@@ -99,12 +97,13 @@ jobs:
9997
env:
10098
# -Zrandomize-layout makes sure we dont rely on the layout of anything that might change
10199
RUSTFLAGS: -Zrandomize-layout
100+
# https://github.com/rust-lang/miri#miri--z-flags-and-environment-variables
102101
# -Zmiri-disable-isolation is needed because our executor uses `fastrand` which accesses system time.
103102
# -Zmiri-ignore-leaks is needed because running bevy_ecs tests finds a memory leak but its impossible
104103
# to track down because allocids are nondeterministic.
105-
# -Zmiri-tag-raw-pointers is not strictly "necessary" but enables a lot of extra UB checks relating
106-
# to raw pointer aliasing rules that we should be trying to uphold.
107-
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-tag-raw-pointers
104+
# -Zmiri-permissive-provenance disables warnings against int2ptr casts (since those are used by once_cell)
105+
# -Zmiri-disable-weak-memory-emulation works around https://github.com/bevyengine/bevy/issues/5164.
106+
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-ignore-leaks -Zmiri-permissive-provenance -Zmiri-disable-weak-memory-emulation
108107

109108
check-compiles:
110109
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)