Skip to content

Commit e41ca4c

Browse files
committed
Merge BlockstreamResearch#261: Switch to cargo-fuzz
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
2 parents fb9d8cf + ae12708 commit e41ca4c

20 files changed

+237
-311
lines changed

.github/workflows/fuzz.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ decode_program,
2323
parse_human,
2424
]
2525
steps:
26-
- name: Install test dependencies
27-
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
28-
2926
- name: Checkout Crate
3027
uses: actions/checkout@v4
3128

@@ -38,15 +35,18 @@ parse_human,
3835
fuzz/target
3936
target
4037
key: cache-${{ matrix.target }}-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
38+
4139
- name: Install Toolchain
42-
uses: dtolnay/rust-toolchain@stable
40+
uses: dtolnay/rust-toolchain@master
4341
with:
44-
toolchain: '1.65.0'
42+
toolchain: nightly-2024-07-01
43+
components: "llvm-tools-preview"
44+
45+
- name: Install Dependencies
46+
run: cargo update && cargo update -p cc --precise 1.0.83 && cargo install cargo-fuzz
4547

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

5151
- name: Prepare Artifact
5252
run: echo "${{ matrix.fuzz_target }}" >executed_${{ matrix.fuzz_target }}

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ jobs:
5454
- stable
5555
- beta
5656
- nightly
57-
- 1.63.0
57+
- 1.78.0
5858
steps:
5959
- name: Checkout Crate
6060
uses: actions/checkout@v4

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Cargo.lock
1010
#fuzz
1111
fuzz/hfuzz_target
1212
fuzz/hfuzz_workspace
13+
fuzz/artifacts
14+
fuzz/corpus
1315

1416
#IntelliJ project files
1517
.idea

0 commit comments

Comments
 (0)