Repository navigation
Commit fuzzer source code. #2
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
base: master
Are you sure you want to change the base?
Changes from 1 commit
ef33bdd
78bc635
9de52c0
aacdef3
a91b38c
d00c6a5
d8881d6
84395e5
03fee10
5750949
888a08b
01c5daf
1f43abf
24b361a
f4c7bd7
dd72220
b9bc503
0f48672
07fca5a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…e of no fuzzing
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -177,8 +177,10 @@ install( | |
| # Process subdirectories | ||
| add_subdirectory(doc) | ||
| add_subdirectory(src) | ||
| add_subdirectory(tests) | ||
| add_subdirectory(samples) | ||
| if (NOT (DEFINED XERCES_BUILD_FUZZERS)) | ||
| add_subdirectory(tests) | ||
| add_subdirectory(samples) | ||
| endif() | ||
|
|
||
| if ((DEFINED XERCES_BUILD_FUZZERS) OR (DEFINED XERCES_BUILD_FOR_OSS_FUZZ)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please always include all subdirectories, and place the above conditionals around the logic inside the file. This ensures the logic is evaluated whatever the cmake options, and helps to prevent regressions.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, rather than use XERCES_BUILD_FUZZERS, why not define an option
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will do that, thanks! |
||
| add_subdirectory(fuzzers) | ||
|
|
||
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.
Why are these specifically excluded? It might be nicer to only use the fuzzer-specific conditions on the fuzzer code itself.
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.
Fuzzing requires some compile-time instrumentation of the xerces-library code and certain libraries that need to be linked against the instrumented code later on. Since this instrumentation is not needed for the other tests, because I thought this way it would be cleaner. Do you still want to me to change?
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.
I am afraid I misunderstand your question though: Do you want just the if condition to change?
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.
I would prefer that the fuzzer keep its conditionals self-contained if possible. That is, rather than disabling other unrelated features, it should only enable or disable the fuzzing functionality. If you want to disable building of the tests and/or samples, I think they should have separate options to allow them to be enabled or disabled independently.
You could then do
-Dtests=OFF -Dsamples-OFF -Dfuzzer=ONto achieve the same effect.Also, the extra compile-time stuff using ExternalProject looks separate from building the fuzzer itself. Maybe always build the fuzzer but have that additional stuff gated on the
fuzzeroption. Or gate all of it. But I would put that conditional stuff inside the fuzzer CMakeLists.txt rather than having any conditionals around include statements.