-
Notifications
You must be signed in to change notification settings - Fork 20
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
Consolidate all fuzz test info (corpus, dictionaries, etc.) in one rule. #94
Conversation
# Building and runing empty_fuzz_test_with_invalid_dict should be ok, | ||
# but building and running empty_fuzz_test_with_invalid_dict_run are expected to get an error message | ||
# due to the invalid dictionary. | ||
cc_fuzz_test( |
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.
Is this still being used or does it still make sense to have it around (e.g., for testing)? Mostly asking since the PR description sounded like this was mostly going to be a refactoring
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.
That's a great point - this was intended to be a refactoring, but it does indeed slightly change the semantics of the cc_fuzz_test
rule: while the rule output stays the same, there are now more targets in the macro that are built by default. This test was assuming one of these targets (the dictionary) would not be built by default, so someone could manually check that this fuzz test would fail.
But since these manual "compilation failure" tests are rather brittle and less useful, I opted to remove this one for the time being.
I opened #95 to track the addition of a proper regression test.
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.
only nits
}, | ||
) | ||
|
||
def _fuzzing_binary_transition_impl(settings, attr): |
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.
is attr
ever used?
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 is not for this particular transition, but this is part of the standard signature required by the implementation
attribute of the transition()
definition below. (It's a bit like argc
and argv
in a main function.)
The new rule supersedes the instrumented_fuzzing_binary rule and gets to incorporate all the other metadata about the fuzz test, such as corpus and dictionary paths, and the info about the fuzzing engine used. This simplifies the creation of additional rules that depend on fuzz test binaries, which can retrieve this metadata from the new CcFuzzingBinaryInfo provider.
c34d0de
to
a86b11d
Compare
This is an internal refactoring that largely has no effect on the interface of the
cc_fuzz_test
macro.The new
fuzzing_binary
rule supersedes theinstrumented_fuzzing_binary
rule. In addition to providing binary instrumentation, it collects all the other metadata about the fuzz test, such as corpus and dictionary paths, and the info about the fuzzing engine used, and makes it available to consumers via the newCcFuzzingBinaryInfo
provider. This simplifies the creation of additional rules that depend on fuzz test binaries, such as the upcoming OSS-Fuzz packaging rule.There is one major change in behavior for
cc_fuzz_test
: it now always builds the corpus and dictionary dependencies as part of building the main fuzzing binary. This is advantageous, but at the same time it invalidates an existing "compilation failure" test which was run manually. The test is disabled for the time being - I opened #95 to track this issue.