diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 000000000..59508d7e9 --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,3 @@ +[profile.default-miri] +slow-timeout = { period = "30s", terminate-after = 1 } +fail-fast = false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 115296d26..57e036861 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: os: [macos-latest, windows-latest, ubuntu-latest] toolchain: [stable, beta, nightly, 1.65.0] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 # install the toolchain we are going to compile and test with - name: install ${{ matrix.toolchain }} toolchain @@ -77,3 +77,18 @@ jobs: # - run: mdbook test -L ./target/debug/deps docs/book # if: matrix.toolchain == 'stable' && matrix.os == 'ubuntu-latest' + + miri: + name: "Miri" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Miri + run: | + rustup toolchain install nightly --component miri + rustup override set nightly + cargo miri setup + - name: Install latest nextest release + uses: taiki-e/install-action@nextest + - name: Test with Miri + run: ./miri.sh diff --git a/Cargo.toml b/Cargo.toml index 38e4c708d..8afd7831e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,11 +24,11 @@ ahash = "0.7.6" crossbeam-queue = "0.3" # waiting on PR and new version to be published # hibitset = { version = "0.6.3", default-features = false } -hibitset = { path = "../hibitset", default-features = false } +hibitset = { git = "https://github.com/amethyst/hibitset", default-features = false } log = "0.4.8" # waiting on PR and new version to be published # shred = { version = "0.14.1", default-features = false } -shred = { path = "../shred", default-features = false } +shred = { git = "https://github.com/Imberflur/shred", branch = "metatable-fix", default-features = false } shrev = "1.1.1" tuple_utils = "0.4.0" nougat = "0.2.3" @@ -58,7 +58,7 @@ ron = "0.7.1" rand = "0.8" serde_json = "1.0.48" # shred = { version = "0.14.1", default-features = false, features = ["shred-derive"] } -shred = { path = "../shred", default-features = false, features = ["shred-derive"] } +shred = { git = "https://github.com/Imberflur/shred", branch = "metatable-fix", default-features = false, features = ["shred-derive"]} specs-derive = { path = "specs-derive", version = "0.4.1" } [[example]] diff --git a/miri.sh b/miri.sh new file mode 100755 index 000000000..e36b58311 --- /dev/null +++ b/miri.sh @@ -0,0 +1,21 @@ +#!/bin/bash +# +# Convenience script for running Miri, also the same one that the CI runs! + +# use half the available threads since miri can be a bit memory hungry +test_threads=$((($(nproc) - 1) / 2 + 1)) +echo using $test_threads threads + +# filters out long running tests +filter='not (test(100k) | test(map_test::wrap) | test(map_test::insert_same_key) | test(=mixed_create_merge)| test(=par_join_many_entities_and_systems) | test(=stillborn_entities))' +echo "using filter: \"$filter\"" + +# Miri currently reports leaks in some tests so we disable that check +# here (might be due to ptr-int-ptr in crossbeam-epoch so might be +# resolved in future versions of that crate). +MIRIFLAGS="-Zmiri-disable-isolation -Zmiri-ignore-leaks" \ + cargo +nightly miri nextest run \ + -E "$filter" \ + --test-threads="$test_threads" \ + # use nocapture or run miri directly to see warnings from miri + #--nocapture