Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP][ci] Update hongfuzz in cargo-hfuzz #5806

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/test-hfuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: tests misc

on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
merge_group:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

# Jobs in this workflow depend on each other, only for limiting peak amount of spawned workers

jobs:
preflight:
uses: ./.github/workflows/reusable-preflight.yml

cargo-hfuzz:
timeout-minutes: 20
needs: [preflight]
runs-on: ${{ needs.preflight.outputs.RUNNER }}
container:
image: ${{ needs.preflight.outputs.IMAGE }}
env:
# max 10s per iteration, 60s per file
HFUZZ_RUN_ARGS: |
--exit_upon_crash
--exit_code_upon_crash 1
--timeout 10
--run_time 60

# # use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes:
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling absolute CARGO_TARGET_DIR
# HFUZZ_BUILD_ARGS: |
# --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs"
# --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run honggfuzz
run: |
cargo uninstall honggfuzz
cargo install honggfuzz --version 0.5.56
cd substrate/primitives/arithmetic/fuzzer
forklift cargo hfuzz build
for target in $(cargo read-manifest | jq -r '.targets | .[] | .name');
do
forklift cargo hfuzz run "$target" || { printf "fuzzing failure for %s\n" "$target"; exit 1; };
done

- name: Upload artifacts
uses: actions/upload-artifact@v4.3.6
with:
path: substrate/primitives/arithmetic/fuzzer/hfuzz_workspace/
name: hfuzz-${{ github.sha }}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -265,19 +265,20 @@ jobs:
--timeout 10
--run_time 60

# use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes:
# https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian
# https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr
# https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling absolute CARGO_TARGET_DIR
HFUZZ_BUILD_ARGS: |
--config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs"
--config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981"
# # use git version of honggfuzz-rs until v0.5.56 is out, we need a few recent changes:
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/75 to avoid breakage on debian
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/81 fix to the above pr
# # https://github.com/rust-fuzz/honggfuzz-rs/pull/82 fix for handling absolute CARGO_TARGET_DIR
# HFUZZ_BUILD_ARGS: |
# --config=patch.crates-io.honggfuzz.git="https://github.com/altaua/honggfuzz-rs"
# --config=patch.crates-io.honggfuzz.rev="205f7c8c059a0d98fe1cb912cdac84f324cb6981"
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run honggfuzz
run: |
cargo install honggfuzz@0.5.56
cd substrate/primitives/arithmetic/fuzzer
forklift cargo hfuzz build
for target in $(cargo read-manifest | jq -r '.targets | .[] | .name');
Expand Down
File renamed without changes.
Loading