Skip to content

Commit 5b86d80

Browse files
authored
Dependabot cleanup and fixup CI (#6)
* We hae binaries. So dependabot everything. Also remote nostd * Remove our old CI * Add miri flag, disable loom * Update config.toml to take linking options out. Those should remain local, not checked in. * Disable isolation in miri as we need to read in test input files * Bump msrv to 1.65 * suppress leak suppressions file for now * Bump msrv comment explaining why * Change test to see if miri gets happier * Fixup tests trying to get miri to work. Turns out it won't due to: rust-lang/unsafe-code-guidelines#134 so disable that check * take 2 for multiple miri flags * Try adding a leak suppresions file * try putting lsan at top level * Rework a few things: sanitizer - specify path relative in github actions miri - use sampling of tests from cpu. Otheriwse it OOMs * Specify tests better * Break miri up for c64basic vs cpu For CPU only do a subset and run in separate runs to avoid OOMs. Try again to get leak detector happy * Change to a test miri can run. Try a different way to pass lsan suppressions file
1 parent a12be97 commit 5b86d80

File tree

8 files changed

+39
-102
lines changed

8 files changed

+39
-102
lines changed

.cargo/config.toml

-18
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,3 @@
1-
[target.x86_64-unknown-linux-gnu]
2-
linker = "clang"
3-
rustflags = ["-Clink-arg=-fuse-ld=lld"]
4-
5-
# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
6-
# `brew install michaeleisel/zld/zld`
7-
[target.x86_64-apple-darwin]
8-
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld"]
9-
10-
[target.aarch64-apple-darwin]
11-
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/zld"]
12-
13-
[target.x86_64-pc-windows-msvc]
14-
linker = "rust-lld.exe"
15-
16-
[target.wasm32-unknown-unknown]
17-
runner = "wasm-server-runner"
18-
191
[target.'cfg(all())']
202
rustflags = [
213
"-Wclippy::pedantic",

.github/dependabot.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ updates:
88
directory: /
99
schedule:
1010
interval: daily
11-
ignore:
12-
- dependency-name: "*"
11+
#ignore:
12+
# - dependency-name: "*"
1313
# patch and minor updates don't matter for libraries
1414
# remove this ignore rule if your package has binaries
15-
update-types:
16-
- "version-update:semver-patch"
17-
- "version-update:semver-minor"
15+
# update-types:
16+
# - "version-update:semver-patch"
17+
# - "version-update:semver-minor"

.github/workflows/check.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ jobs:
7979
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
8080
strategy:
8181
matrix:
82-
msrv: [1.56.1] # 2021 edition requires 1.56
82+
msrv: [1.65] # let/else support
8383
name: ubuntu / ${{ matrix.msrv }}
8484
steps:
8585
- uses: actions/checkout@v3

.github/workflows/ci.yml

-26
This file was deleted.

.github/workflows/nostd.yml

-28
This file was deleted.

.github/workflows/safety.yml

+29-16
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
if: always()
4545
run: cargo test --all-features --target x86_64-unknown-linux-gnu
4646
env:
47-
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
47+
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan-suppressions.txt"
4848
RUSTFLAGS: "-Z sanitizer=leak"
4949
miri:
5050
runs-on: ubuntu-latest
@@ -59,20 +59,33 @@ jobs:
5959
with:
6060
toolchain: ${{ env.NIGHTLY }}
6161
components: miri
62-
- name: cargo miri test
63-
run: cargo miri test
62+
- name: cargo miri test c64basic
63+
run: cargo miri test -p c64basic
6464
env:
65-
MIRIFLAGS: ""
66-
loom:
67-
runs-on: ubuntu-latest
68-
steps:
69-
- uses: actions/checkout@v3
70-
with:
71-
submodules: true
72-
- name: Install stable
73-
uses: dtolnay/rust-toolchain@stable
74-
- name: cargo test --test loom
75-
run: cargo test --release --test loom
65+
# Disable isolation as we load external input files/images.
66+
MIRIFLAGS: "-Zmiri-disable-isolation"
67+
- name: cargo miri test cpu
68+
run: |
69+
# Only test a subset and do them in separate runs or miri OOMs
70+
for i in init_tests irq_and_nmi load_tests store_tests nop_hlt_tests::classic_nop_0x02_hlt rom_tests::undocumented_opcodes_test; do
71+
echo Testing $i
72+
cargo miri test -p cpu $i
73+
done
7674
env:
77-
LOOM_MAX_PREEMPTIONS: 2
78-
RUSTFLAGS: "--cfg loom"
75+
# Ignore leaks - cpu test does this on purpose.
76+
# Disable isolation as we load external input files/images.
77+
# Stacked borrows because eyre doesn't work.
78+
MIRIFLAGS: "-Zmiri-ignore-leaks -Zmiri-disable-isolation -Zmiri-disable-stacked-borrows"
79+
#loom:
80+
# runs-on: ubuntu-latest
81+
# steps:
82+
# - uses: actions/checkout@v3
83+
# with:
84+
# submodules: true
85+
# - name: Install stable
86+
# uses: dtolnay/rust-toolchain@stable
87+
# - name: cargo test --test loom
88+
# run: cargo test --release --test loom
89+
# env:
90+
# LOOM_MAX_PREEMPTIONS: 2
91+
# RUSTFLAGS: "--cfg loom"

cpu/src/tests.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ macro_rules! init_test {
183183
let mut cpu = setup($type, 0x1212, 0xEA, None, None, None, None);
184184

185185
// This should fail
186-
{
187-
let ret = cpu.reset();
188-
assert!(ret.is_err(), "reset worked before power_on");
189-
}
186+
assert!(cpu.reset().is_err(), "reset worked before power_on");
190187

191188
// Now it should work.
192189
cpu.power_on()?;
@@ -197,10 +194,7 @@ macro_rules! init_test {
197194
}
198195

199196
// This should fail now.
200-
{
201-
let ret = cpu.power_on();
202-
assert!(ret.is_err(), "power_on passes twice");
203-
}
197+
assert!(cpu.power_on().is_err(), "power_on passes twice");
204198
}
205199
if $rand {
206200
assert!(track.len() == 2, "didn't get both decimal states");

lsan-suppressions.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# These tests are intended to leak some top level objects
2+
leak:cpu::tests::

0 commit comments

Comments
 (0)