-
Notifications
You must be signed in to change notification settings - Fork 698
Update cargo-fuzz setup; split fuzz_value_sanitize
so it runs
#6372
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,12 @@ name: Cargo Hack Check | |
|
||
on: | ||
workflow_call: | ||
inputs: | ||
rust-nightly-version: | ||
description: Nightly toolchain to use. | ||
required: false | ||
type: string | ||
default: nightly | ||
|
||
env: | ||
RUST_BACKTRACE: full | ||
|
@@ -116,3 +122,30 @@ jobs: | |
|
||
- name: Run cargo hack check | ||
run: ${{ matrix.command }} | ||
|
||
fuzz-targets: | ||
name: Fuzz targets (nightly) | ||
runs-on: ubuntu-latest | ||
needs: setup | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this doesn’t use any outputs from |
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
with: | ||
persist-credentials: false | ||
|
||
# Install nightly matching org pattern, pinned to v1.13.0 of the action. | ||
- name: Install Rust nightly toolchain | ||
id: install_rust | ||
uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1.13.0 | ||
with: | ||
toolchain: ${{ inputs.rust-nightly-version }} | ||
cache: true | ||
cache-key: > | ||
fuzz-${{ hashFiles('clarity/fuzz/Cargo.lock') }} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe cache key is too narrow. If nightly version changes, we could get stale caches that fail to build because dependencies or the compiler version mismatch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps
or something like
We'll have to try. |
||
|
||
- name: Build fuzz targets (compile-only) | ||
run: | | ||
cargo +${{ inputs.rust-nightly-version }} build \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we use check here instead of build? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch. I always do |
||
--manifest-path clarity/fuzz/Cargo.toml \ | ||
--bins \ | ||
--locked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s not entirely clear why this workflow requires this input. Could you elaborate?
We might consider simplifying by hardcoding the version in the
fuzz-targets
job or by using an environment variable instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes,
cargo fuzz
needs nightly. However we could follow the rule of three and inline it for now directly in the job.