Skip to content

Commit

Permalink
Merge #261: Switch to cargo-fuzz
Browse files Browse the repository at this point in the history
ae12708 chore: Delete fuzz nix shells (Christian Lewe)
98430c2 chore: Add cargo-fuzz files to .gitignore (Christian Lewe)
6362db7 refactor: Update fuzz scripts (Christian Lewe)
9d05999 refactor: Port fuzz crate to cargo-fuzz (Christian Lewe)
2aa015f chore: Bump MSRV 1.63.0 -> 1.78.0 (Christian Lewe)

Pull request description:

  Adapt the fuzzing infrastructure to use cargo-fuzz. I keep the existing shell scripts because they turned out to be useful.

  Everything should work as before, except that the `fuzzing` flag is producing warnings when the tests are run. Let's discuss solutions here.

ACKs for top commit:
  apoelstra:
    ACK ae12708

Tree-SHA512: 0a85e42ff7c08f682e7d4697bb2183a24915d9baa2486d5a7f7bc00d5ab5d20a634fda452efc5209466626c22a3ceff9de2deef736d879e183fb8929c1923917
  • Loading branch information
apoelstra committed Feb 17, 2025
2 parents fb9d8cf + ae12708 commit e41ca4c
Show file tree
Hide file tree
Showing 20 changed files with 237 additions and 311 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ decode_program,
parse_human,
]
steps:
- name: Install test dependencies
run: sudo apt-get update -y && sudo apt-get install -y binutils-dev libunwind8-dev libcurl4-openssl-dev libelf-dev libdw-dev cmake gcc libiberty-dev

- name: Checkout Crate
uses: actions/checkout@v4

Expand All @@ -38,15 +35,18 @@ parse_human,
fuzz/target
target
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}

- name: Install Toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@master
with:
toolchain: '1.65.0'
toolchain: nightly-2024-07-01
components: "llvm-tools-preview"

- name: Install Dependencies
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install cargo-fuzz

- name: Run Fuzz Target
run: |
echo "Using RUSTFLAGS $RUSTFLAGS"
cd fuzz && cargo update && cargo update -p cc --precise 1.0.83 && ./fuzz.sh "${{ matrix.fuzz_target }}"
run: ./fuzz/fuzz.sh "${{ matrix.fuzz_target }}"

- name: Prepare Artifact
run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- stable
- beta
- nightly
- 1.63.0
- 1.78.0
steps:
- name: Checkout Crate
uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Cargo.lock
#fuzz
fuzz/hfuzz_target
fuzz/hfuzz_workspace
fuzz/artifacts
fuzz/corpus

#IntelliJ project files
.idea
Expand Down
Loading

0 comments on commit e41ca4c

Please sign in to comment.