Skip to content

Commit

Permalink
always set cfg(fuzz) when building for fuzzers (#10367)
Browse files Browse the repository at this point in the history
Due to cargo-bolero first compiling in test mode and then in fuzz mode,
#10364 was not actually enough to fix the issues.

With this change, cargo-bolero will always set `--cfg fuzz`, even when
compiling in test mode, so that all builds performed with nightly do see
the assertion skipped.

Part of near/near-one-project-tracking#9
  • Loading branch information
Ekleog-NEAR authored Dec 22, 2023
1 parent 1382c7c commit 4942ba2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master_fuzzer_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: "Compile fuzzers and upload to GCS"
run: |
NAME="nearcore-${{ github.ref_name }}-$(env TZ=Etc/UTC date +"%Y%m%d%H%M%S")"
RUSTFLAGS="-A warnings" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
RUSTFLAGS="-A warnings --cfg fuzz" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://fuzzer_targets/${{ github.ref_name }}/$NAME.tar.gz"
4 changes: 3 additions & 1 deletion .github/workflows/ondemand_fuzzer_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ jobs:

- name: "Set up GCP SDK"
uses: "google-github-actions/setup-gcloud@v1"
with:
version: ">= 416.0.0"

- name: Checkout Release/RC branch
if: contains(fromJSON('["released", "prereleased"]'), github.event.action)
Expand All @@ -79,5 +81,5 @@ jobs:
- name: "Compile fuzzers and upload to GCS"
run: |
NAME="nearcore-$branch_type-$(env TZ=Etc/UTC date +"%Y%m%d%H%M%S")"
cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
RUSTFLAGS="-A warnings --cfg fuzz" cargo +nightly bolero build-clusterfuzz --all-features --profile fuzz
gsutil cp -Z target/fuzz/clusterfuzz.tar "gs://fuzzer_targets/$branch_type/$NAME.tar.gz"

0 comments on commit 4942ba2

Please sign in to comment.