Skip to content

Commit

Permalink
Dependabot cleanup and fixup CI (#6)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jmchacon authored Jun 5, 2023
1 parent a12be97 commit 5b86d80
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 102 deletions.
18 changes: 0 additions & 18 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-Clink-arg=-fuse-ld=lld"]

# NOTE: you must manually install https://github.com/michaeleisel/zld on mac. you can easily do this with the "brew" package manager:
# `brew install michaeleisel/zld/zld`
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/usr/local/bin/zld"]

[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-fuse-ld=/opt/homebrew/bin/zld"]

[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"

[target.wasm32-unknown-unknown]
runner = "wasm-server-runner"

[target.'cfg(all())']
rustflags = [
"-Wclippy::pedantic",
Expand Down
10 changes: 5 additions & 5 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ updates:
directory: /
schedule:
interval: daily
ignore:
- dependency-name: "*"
#ignore:
# - dependency-name: "*"
# patch and minor updates don't matter for libraries
# remove this ignore rule if your package has binaries
update-types:
- "version-update:semver-patch"
- "version-update:semver-minor"
# update-types:
# - "version-update:semver-patch"
# - "version-update:semver-minor"
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
strategy:
matrix:
msrv: [1.56.1] # 2021 edition requires 1.56
msrv: [1.65] # let/else support
name: ubuntu / ${{ matrix.msrv }}
steps:
- uses: actions/checkout@v3
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/ci.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/nostd.yml

This file was deleted.

45 changes: 29 additions & 16 deletions .github/workflows/safety.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
if: always()
run: cargo test --all-features --target x86_64-unknown-linux-gnu
env:
LSAN_OPTIONS: "suppressions=lsan-suppressions.txt"
LSAN_OPTIONS: "suppressions=${{ github.workspace }}/lsan-suppressions.txt"
RUSTFLAGS: "-Z sanitizer=leak"
miri:
runs-on: ubuntu-latest
Expand All @@ -59,20 +59,33 @@ jobs:
with:
toolchain: ${{ env.NIGHTLY }}
components: miri
- name: cargo miri test
run: cargo miri test
- name: cargo miri test c64basic
run: cargo miri test -p c64basic
env:
MIRIFLAGS: ""
loom:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo test --test loom
run: cargo test --release --test loom
# Disable isolation as we load external input files/images.
MIRIFLAGS: "-Zmiri-disable-isolation"
- name: cargo miri test cpu
run: |
# Only test a subset and do them in separate runs or miri OOMs
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
echo Testing $i
cargo miri test -p cpu $i
done
env:
LOOM_MAX_PREEMPTIONS: 2
RUSTFLAGS: "--cfg loom"
# Ignore leaks - cpu test does this on purpose.
# Disable isolation as we load external input files/images.
# Stacked borrows because eyre doesn't work.
MIRIFLAGS: "-Zmiri-ignore-leaks -Zmiri-disable-isolation -Zmiri-disable-stacked-borrows"
#loom:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: true
# - name: Install stable
# uses: dtolnay/rust-toolchain@stable
# - name: cargo test --test loom
# run: cargo test --release --test loom
# env:
# LOOM_MAX_PREEMPTIONS: 2
# RUSTFLAGS: "--cfg loom"
10 changes: 2 additions & 8 deletions cpu/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ macro_rules! init_test {
let mut cpu = setup($type, 0x1212, 0xEA, None, None, None, None);

// This should fail
{
let ret = cpu.reset();
assert!(ret.is_err(), "reset worked before power_on");
}
assert!(cpu.reset().is_err(), "reset worked before power_on");

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

// This should fail now.
{
let ret = cpu.power_on();
assert!(ret.is_err(), "power_on passes twice");
}
assert!(cpu.power_on().is_err(), "power_on passes twice");
}
if $rand {
assert!(track.len() == 2, "didn't get both decimal states");
Expand Down
2 changes: 2 additions & 0 deletions lsan-suppressions.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# These tests are intended to leak some top level objects
leak:cpu::tests::

0 comments on commit 5b86d80

Please sign in to comment.