build: Disallow building fuzz binary without -DBUILD_FOR_FUZZING #31059

pull dollarparity wants to merge 1 commits into bitcoin:master from dollarparity:patch-1 changing 1 files +8 −0
  1. dollarparity commented at 4:31 pm on October 8, 2024: none

    This pull request addresses [issue #31057](https://github.com/bitcoin/bitcoin/issues/31057).

    Build System:

    • Modified CMakeLists.txt to prevent building the fuzz binary unless BUILD_FOR_FUZZING is enabled.
    • Added a fatal error message if an attempt is made to build the fuzz binary without BUILD_FOR_FUZZING.

    Building the fuzz binary without -DBUILD_FOR_FUZZING results in a binary that is less effective for testing because it won’t crash on Assume statements and won’t bypass fuzz blockers with FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION.

    By enforcing -DBUILD_FOR_FUZZING, we ensure that:

    • The fuzz binary is correctly configured for fuzz testing.
    • Compile failures are caught early in the CI on all platforms.
    • Workarounds like #31028 are no longer necessary.
  2. Update CMakeLists.txt
    Build System:
      - Modified `CMakeLists.txt` to prevent building the fuzz binary unless `BUILD_FOR_FUZZING` is enabled.
      - Added a fatal error message if an attempt is made to build the fuzz binary without `BUILD_FOR_FUZZING`.
    be3dfce658
  3. DrahtBot commented at 4:31 pm on October 8, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  4. DrahtBot added the label Build system on Oct 8, 2024
  5. DrahtBot added the label CI failed on Oct 8, 2024
  6. DrahtBot commented at 4:43 pm on October 8, 2024: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/31247558267

    Try to run the tests locally, according to the documentation. However, a CI failure may still happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  7. fanquake closed this on Oct 8, 2024

  8. dollarparity deleted the branch on Oct 8, 2024
  9. bitcoin locked this on Oct 9, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-21 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me