bazelbuild / rules_fuzzing

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

Consider adding support for the bzlmod module system #189

Closed stefanbucur closed 4 months ago

stefanbucur commented 2 years ago

We should figure out to to expose dependencies like Honggfuzz, and the OSSFuzz repository rules.

See more at https://docs.bazel.build/versions/main/bzlmod.html

fmeum commented 2 years ago

Packaging up rules_fuzzing that provides a functional cc_fuzz_test wouldn't be much work. I would be happy to provide guidance if somebody wants to try it.

Getting java_fuzz_test to work requires more work. I am of course working on packaging Jazzer up for bzlmod, but that is blocked on rules_kotlin being available as a module. There is also a Bazel bug that I haven't been able to fix in time for Bazel 5.0.0 and that would definitely complicate making java_fuzz_test work with modules.

melver commented 5 months ago

Bazel has started warning:

WARNING: --enable_bzlmod is set, but no MODULE.bazel file was found at the workspace root. Bazel will create an empty
MODULE.bazel file. Please consider migrating your external dependencies from WORKSPACE to MODULE.bazel. For more
details, please refer to https://github.com/bazelbuild/bazel/issues/18958.

While it's technically possible to mix WORKSPACE and MODULE.bazel until WORKSPACE is support is completely removed from Bazel in a few releases, the fact that rules_fuzzing requires calling rules_fuzzing_dependencies() in WORKSPACE causes conflicts during linking if MODULE.bazel specifies the same dependency (which prompted me to write something here because a project I'm working on ran into this issue).

fmeum commented 5 months ago

https://github.com/bazelbuild/rules_fuzzing/pull/242 is going to add support.