The first working draft of the rules_fuzzing integration in Envoy.#14675
The first working draft of the rules_fuzzing integration in Envoy.#14675stefanbucur wants to merge 14 commits intoenvoyproxy:mainfrom
Conversation
|
Hi @stefanbucur, welcome and thank you for your contribution. We will try to review your Pull Request as quickly as possible. In the meantime, please take a look at the contribution guidelines if you have not done so already. |
|
@asraa This is the PR with all my changes so far, PTAL when you get the chance. |
ab8726c to
e5ec2ef
Compare
bazel/envoy_test.bzl
Outdated
There was a problem hiding this comment.
why does the raw binary name get compiled as a cc_test?
There was a problem hiding this comment.
Ah, good question - so I left the original binary as a cc_test since I didn't get the chance to look at coverage support, so I left in place the original cc_test + its data dependency on the corpus so we can still use the old way of collecting code coverage. Maybe we can migrate this part to bazel_rules in a subsequent step, or you think we should do it now?
There was a problem hiding this comment.
Hmmm fuzz coverage actually uses the libfuzzer linked target (and normal test coverage ignores fuzzers).
Let me clone locally and see what happens when running fuzz_coverage. It might work since the fuzz coverage script expects a libfuzzer linked binary but the tag might need to change to filter for .fuzz_target_binary targets
|
Looks good to me otherwise! Thank you so much -- to fix the format CI, you can run |
Ah, great, thanks for the pointer! BTW, I realized there are two failures here. The other one is: Are there other places in the Bazel dependency configuration where we need to add these? |
d33e36b to
92ba190
Compare
|
Checking out coverage, there is a fuzz coverage script here: https://github.com/envoyproxy/envoy/blob/main/bazel/coverage/fuzz_coverage_wrapper.sh that now needs to run This is currently how bazel coverage is co-opted to run the fuzzing binary |
e7ac795 to
c2008eb
Compare
|
@stefanbucur it looks like it passes CI now (including the fuzz coverage script, which runs fuzzing as normal and produces the output!) Should this be moved out of DRAFT now? |
Yes, I think it's time to move this out of draft! This now works, but unfortunately I had to reduce some functionality due to the impact on build output size, as well as the build effort. More specifically:
I would suggest though to do this PR in smaller, incremental sub-PRs, to minimize the risk of any disruption:
@asraa How does the plan sound? |
|
Transition plan sounds great re OSS-Fuzz. My read is that between 1 and 2 there will never be a time where OSS-Fuzz can't build. That's ideal. Tag me on PRs! |
Signed-off-by: Stefan Bucur <sbucur@google.com>
…uration flag. Use instead a select() statement that builds upon the existing FUZZING_ENGINE variable. Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
Remove Honggfuzz support for this initial integration. Also use consistent naming of fuzzing Python dependencies. Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
…dency. Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
… by ~8GiB. Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
Signed-off-by: Stefan Bucur <sbucur@google.com>
ff88099 to
62d81d7
Compare
Introduce the new https://github.com/bazelbuild/rules_fuzzing library for fuzz testing support. The new library provides new functionality (support for testing the fuzz test locally) and simplifies existing fuzzing tasks. This is the first PR in the series. See #14675 for the detailed rollout plan. Risk Level: Low (new dependencies and major change to the existing envoy_cc_fuzz_test macro, but does not affect Envoy binary) Testing: The changes consist of either (a) code that should be a drop-in replacement to the existing functionality, or (b) new targets marked as "manual". For (a), the Envoy regression tests should catch deviations from the original behavior. The new functionality in (b) is either tested manually, or through the OSS-Fuzz integration (changes coming in future PR). Docs Changes: None (this is test-only functionality). Release Notes: N/A Platform Specific Features: The fuzz tests run on Linux platforms only. Signed-off-by: Stefan Bucur <sbucur@google.com>
|
Submitted as #14834, closing here. |
Commit Message: Use the new rules_fuzzing Bazel repository for fuzzing support.
Additional Description: The new fuzzing rules provide an improved fuzzing development experience and simplifies a number of tasks, such as OSS-Fuzz integration.
Risk Level: High
Testing: Used RBE to test the changes on all fuzz tests:
bazel test --config=remote --config=asan-fuzzer -c opt $(bazel query 'let all_fuzz_tests = attr(tags, "fuzz_target", "...") in $all_fuzz_tests - attr(tags, "no_fuzz", $all_fuzz_tests)')Docs Changes: None yet.
Release Notes: N/A
Platform Specific Features: Fuzz tests run on Linux platforms only.