From 4942ba29f295f7e7b6e452c84000bb48aee79262 Mon Sep 17 00:00:00 2001 From: Ekleog-NEAR <96595974+Ekleog-NEAR@users.noreply.github.com> Date: Fri, 22 Dec 2023 15:41:59 +0100 Subject: [PATCH] always set cfg(fuzz) when building for fuzzers (#10367) 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 https://github.com/near/near-one-project-tracking/issues/9 --- .github/workflows/master_fuzzer_binaries.yml | 2 +- .github/workflows/ondemand_fuzzer_binaries.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/master_fuzzer_binaries.yml b/.github/workflows/master_fuzzer_binaries.yml index 14fc96303a3..b6f3c4f5f7a 100644 --- a/.github/workflows/master_fuzzer_binaries.yml +++ b/.github/workflows/master_fuzzer_binaries.yml @@ -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" diff --git a/.github/workflows/ondemand_fuzzer_binaries.yml b/.github/workflows/ondemand_fuzzer_binaries.yml index bdbbd3a0e76..377c0fd2960 100644 --- a/.github/workflows/ondemand_fuzzer_binaries.yml +++ b/.github/workflows/ondemand_fuzzer_binaries.yml @@ -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) @@ -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"