bazelbuild / rules_fuzzing

Bazel Starlark extensions for defining fuzz tests in Bazel projects
Apache License 2.0
81 stars 19 forks source link

Fix `main_class` error in `java_fuzz_test` #236

Closed fmeum closed 9 months ago

fmeum commented 9 months ago

In certain situations, java_fuzz_tests failed with

ERROR: Projects/fuzz-sample/BUILD:3:15: in java_binary rule //:JavaFuzzTest_metadata_: need at least one of 'main_class' or Java source files
ERROR: Projects/fuzz-sample/BUILD:3:15: in java_binary rule //:JavaFuzzTest_metadata_: main_class was not provided and cannot be inferred: source path doesn't include a known root (java, javatests, src, testsrc)
ERROR: Projects/fuzz-sample/BUILD:3:15: Analysis of target '//:JavaFuzzTest_metadata_' failed

This is fixed by marking the metadata jar as non-executable.

Fixes #235

fmeum commented 9 months ago

@stefanbucur I just noticed that https://github.com/bazelbuild/rules_fuzzing/actions/workflows/bazel_test.yml has a warning saying "This scheduled workflow is disabled because there hasn't been activity in this repository for at least 60 days. Enable this workflow to resume scheduled runs." You should be able to just reeanble it there.

stefanbucur commented 9 months ago

Thanks for the quick fix!

stefanbucur commented 9 months ago

@stefanbucur I just noticed that https://github.com/bazelbuild/rules_fuzzing/actions/workflows/bazel_test.yml has a warning saying "This scheduled workflow is disabled because there hasn't been activity in this repository for at least 60 days. Enable this workflow to resume scheduled runs." You should be able to just reeanble it there.

Oh wow, nice catch! I've just reenabled the workflow plus another one that was disabled. Not sure what exactly happened there, I don't recall disabling any workflow...

fmeum commented 9 months ago

@stefanbucur Glad that it works now, this should make our lives much easier.

Could you perhaps create a patch release with this change, ideally with a release archive?

stefanbucur commented 9 months ago

@stefanbucur Glad that it works now, this should make our lives much easier.

Great!

Could you perhaps create a patch release with this change, ideally with a release archive?

Ack! Caught up with lots of work, but will get to it later this week.

fmeum commented 8 months ago

@stefanbucur Friendly ping :-)

stefanbucur commented 8 months ago

Should be done now! Let me know if you have trouble with the release archive - hopefully I got the setup right.