Skip to content
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

Fix main_class error in java_fuzz_test #236

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

fmeum
Copy link
Member

@fmeum fmeum commented Sep 21, 2023

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

In certain situations, `java_fuzz_test`s 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.
@fmeum
Copy link
Member Author

fmeum commented Sep 21, 2023

@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 stefanbucur merged commit ef5d034 into bazel-contrib:master Sep 22, 2023
@stefanbucur
Copy link
Collaborator

Thanks for the quick fix!

@stefanbucur
Copy link
Collaborator

@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 fmeum deleted the fix-main-class branch September 22, 2023 06:23
@fmeum
Copy link
Member Author

fmeum commented Sep 22, 2023

@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
Copy link
Collaborator

@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
Copy link
Member Author

fmeum commented Oct 17, 2023

@stefanbucur Friendly ping :-)

@stefanbucur
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default Java Fuzzer Example Fails
2 participants