Closed eustas closed 2 years ago
Thank you for flagging this. The Jazzer work was actually just recently wrapped up by @fmeum and I'm planning to cut a new release very soon!
In the mean time, if you'd like to depend on this functionality, it should be okay to depend on the mainline tree at HEAD, and later update to a stable release number.
Switched to head. Still no luck: https://github.com/eustas/nopb-worker/runs/3032022445?check_suite_focus=true#step:5:13
ERROR: Skipping '//fuzzing:java_engine': no such package 'fuzzing': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
- /home/runner/work/nopb-worker/nopb-worker/fuzz/fuzzing
WARNING: Target pattern parsing failed.
INFO: Found applicable config definition build:jazzer in file /home/runner/work/nopb-worker/nopb-worker/fuzz/.bazelrc: --//fuzzing:java_engine=//fuzzing/engines:jazzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=jazzer --@rules_fuzzing//fuzzing:cc_engine_sanitizer=none --//fuzzing:cc_engine_sanitizer=none
ERROR: //fuzzing:java_engine :: Error loading option //fuzzing:java_engine: no such package 'fuzzing': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
Hmm, that's unexpected! Let me look into it.
Is this the fuzz target that I can try out? https://github.com/eustas/nopb-worker/blob/5a5c5e4e83d0a04a59f5ccecb220ce31ace670f7/fuzz/BUILD
Yup, this one.
Good catch! I should have cleanly separated the flags in .bazelrc
that are only meant for internal use within rules_fuzzing
.
@eustas Can you take a look at https://github.com/bazelbuild/rules_fuzzing/pull/165 and remove the lines containing -//fuzzing:cc_engine_sanitizer
(without the leading @rules_fuzzing
) from your .bazelrc
?
Unfortunately, same error report.
@stefanbucur The error results from the .bazelrc
line setting the java_engine
without an @rules_fuzzing
prefix. This does seem to be a problem for all the cc_engine
configs as well though. Maybe the .bazelrc
should be split into a part that can be safely copy-pasted into a project's own .bazelrc
and an internal part?
@eustas Could you try using
build:jazzer --@rules_fuzzing//fuzzing:java_engine=//fuzzing/engines:jazzer
instead of
build:jazzer --//fuzzing:java_engine=//fuzzing/engines:jazzer
?
@stefanbucur The error results from the
.bazelrc
line setting thejava_engine
without an@rules_fuzzing
prefix. This does seem to be a problem for all thecc_engine
configs as well though. Maybe the.bazelrc
should be split into a part that can be safely copy-pasted into a project's own.bazelrc
and an internal part?
I don't see the purpose of the .bazelrc
file in our own project as copy-pasteable. I would prefer this to be covered in the documentation, so the users don't have to resort to finding and copy-pasting code from our own repository.
@eustas Could you try using
build:jazzer --@rules_fuzzing//fuzzing:java_engine=//fuzzing/engines:jazzer
instead of
build:jazzer --//fuzzing:java_engine=//fuzzing/engines:jazzer
?
Note that both labels (//fuzzing:java_engine
and //fuzzing/engines:jazzer
) need to be prefixed. This should be: build:jazzer --@rules_fuzzing//fuzzing:java_engine=@rules_fuzzing//fuzzing/engines:jazzer
I have just sent out #166 which clarifies these aspects in the README file. I have followed the tutorial myself in a new repository and "It Works on My Machine". @eustas can you perhaps try it out?
Woo-hoo, works now (following #166 how-to). Thanks.
Expected Behavior
rules_fuzzing_dependencies(jazzer=True)
should enable jazzer supportActual Behavior
Error is reported: