Update Jazzer and Bazel (#260)
* Update Jazzer and Bazel
* Update deps and fix stardoc
diff --git a/.bazelversion b/.bazelversion
index a8907c0..cd1d2e9 100644
--- a/.bazelversion
+++ b/.bazelversion
@@ -1 +1 @@
-7.0.2
+8.0.1
diff --git a/.bcr/presubmit.yml b/.bcr/presubmit.yml
index ac4b872..b5e78d7 100644
--- a/.bcr/presubmit.yml
+++ b/.bcr/presubmit.yml
@@ -12,9 +12,11 @@
module_path: "examples/bzlmod"
matrix:
platform: ["macos", "ubuntu2204"]
+ bazel: ["6.x", "7.x", "8.x"]
tasks:
run_tests:
name: "Run test module"
platform: ${{ platform }}
+ bazel: ${{ bazel }}
test_targets:
- "//..."
diff --git a/MODULE.bazel b/MODULE.bazel
index 7b9f2a4..a05ca22 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -22,7 +22,9 @@
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_python", version = "0.28.0")
+bazel_dep(name = "rules_cc", version = "0.0.17")
bazel_dep(name = "rules_java", version = "6.5.2")
+bazel_dep(name = "rules_shell", version = "0.3.0")
bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc")
bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True, repo_name = "com_google_googletest")
diff --git a/docs/BUILD b/docs/BUILD
index 905e229..355adf3 100644
--- a/docs/BUILD
+++ b/docs/BUILD
@@ -45,7 +45,9 @@
"//fuzzing/private:regression.bzl",
"//fuzzing/private:util.bzl",
"//fuzzing/private/oss_fuzz:package.bzl",
+ "@rules_cc//cc:bzl_srcs",
"@rules_fuzzing_oss_fuzz//:instrum.bzl",
+ "@rules_java//java:rules",
],
deps = [
":bazel_skylib",
diff --git a/docs/cc-fuzzing-rules.md b/docs/cc-fuzzing-rules.md
index 0371998..df57de4 100755
--- a/docs/cc-fuzzing-rules.md
+++ b/docs/cc-fuzzing-rules.md
@@ -1,44 +1,48 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
-<a id="#cc_fuzzing_engine"></a>
+Public definitions for fuzzing rules.
+
+Definitions outside this file are private unless otherwise noted, and may
+change without notice.
+
+<a id="cc_fuzzing_engine"></a>
## cc_fuzzing_engine
<pre>
+load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzzing_engine")
+
cc_fuzzing_engine(<a href="#cc_fuzzing_engine-name">name</a>, <a href="#cc_fuzzing_engine-display_name">display_name</a>, <a href="#cc_fuzzing_engine-launcher">launcher</a>, <a href="#cc_fuzzing_engine-launcher_data">launcher_data</a>, <a href="#cc_fuzzing_engine-library">library</a>)
</pre>
-
Specifies a fuzzing engine that can be used to run C++ fuzz targets.
-
**ATTRIBUTES**
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
-| <a id="cc_fuzzing_engine-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
+| <a id="cc_fuzzing_engine-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="cc_fuzzing_engine-display_name"></a>display_name | The name of the fuzzing engine, as it should be rendered in human-readable output. | String | required | |
-| <a id="cc_fuzzing_engine-launcher"></a>launcher | A shell script that knows how to launch the fuzzing executable based on configuration specified in the environment. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
-| <a id="cc_fuzzing_engine-launcher_data"></a>launcher_data | A dict mapping additional runtime dependencies needed by the fuzzing engine to environment variables that will be available inside the launcher, holding the runtime path to the dependency. | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: Label -> String</a> | optional | {} |
-| <a id="cc_fuzzing_engine-library"></a>library | A cc_library target that implements the fuzzing engine entry point. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
+| <a id="cc_fuzzing_engine-launcher"></a>launcher | A shell script that knows how to launch the fuzzing executable based on configuration specified in the environment. | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
+| <a id="cc_fuzzing_engine-launcher_data"></a>launcher_data | A dict mapping additional runtime dependencies needed by the fuzzing engine to environment variables that will be available inside the launcher, holding the runtime path to the dependency. | <a href="https://bazel.build/rules/lib/dict">Dictionary: Label -> String</a> | optional | `{}` |
+| <a id="cc_fuzzing_engine-library"></a>library | A cc_library target that implements the fuzzing engine entry point. | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
-<a id="#FuzzingEngineInfo"></a>
+<a id="FuzzingEngineInfo"></a>
## FuzzingEngineInfo
<pre>
+load("@rules_fuzzing//fuzzing:cc_defs.bzl", "FuzzingEngineInfo")
+
FuzzingEngineInfo(<a href="#FuzzingEngineInfo-display_name">display_name</a>, <a href="#FuzzingEngineInfo-launcher">launcher</a>, <a href="#FuzzingEngineInfo-launcher_runfiles">launcher_runfiles</a>, <a href="#FuzzingEngineInfo-launcher_environment">launcher_environment</a>)
</pre>
-
Provider for storing the language-independent part of the specification of a fuzzing engine.
-
**FIELDS**
-
| Name | Description |
| :------------- | :------------- |
| <a id="FuzzingEngineInfo-display_name"></a>display_name | A string representing the human-readable name of the fuzzing engine. |
@@ -47,12 +51,14 @@
| <a id="FuzzingEngineInfo-launcher_environment"></a>launcher_environment | A dictionary from environment variables to files used by the launcher script. |
-<a id="#cc_fuzz_test"></a>
+<a id="cc_fuzz_test"></a>
## cc_fuzz_test
<pre>
-cc_fuzz_test(<a href="#cc_fuzz_test-name">name</a>, <a href="#cc_fuzz_test-corpus">corpus</a>, <a href="#cc_fuzz_test-dicts">dicts</a>, <a href="#cc_fuzz_test-engine">engine</a>, <a href="#cc_fuzz_test-tags">tags</a>, <a href="#cc_fuzz_test-binary_kwargs">binary_kwargs</a>)
+load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
+
+cc_fuzz_test(<a href="#cc_fuzz_test-name">name</a>, <a href="#cc_fuzz_test-corpus">corpus</a>, <a href="#cc_fuzz_test-dicts">dicts</a>, <a href="#cc_fuzz_test-engine">engine</a>, <a href="#cc_fuzz_test-size">size</a>, <a href="#cc_fuzz_test-tags">tags</a>, <a href="#cc_fuzz_test-timeout">timeout</a>, <a href="#cc_fuzz_test-binary_kwargs">**binary_kwargs</a>)
</pre>
Defines a C++ fuzz test and a few associated tools and metadata.
@@ -81,20 +87,24 @@
| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="cc_fuzz_test-name"></a>name | A unique name for this target. Required. | none |
-| <a id="cc_fuzz_test-corpus"></a>corpus | A list containing corpus files. | <code>None</code> |
-| <a id="cc_fuzz_test-dicts"></a>dicts | A list containing dictionaries. | <code>None</code> |
-| <a id="cc_fuzz_test-engine"></a>engine | A label pointing to the fuzzing engine to use. | <code>"@rules_fuzzing//fuzzing:cc_engine"</code> |
-| <a id="cc_fuzz_test-tags"></a>tags | Tags set on the fuzzing regression test. | <code>None</code> |
-| <a id="cc_fuzz_test-binary_kwargs"></a>binary_kwargs | Keyword arguments directly forwarded to the fuzz test binary rule. | none |
+| <a id="cc_fuzz_test-corpus"></a>corpus | A list containing corpus files. | `None` |
+| <a id="cc_fuzz_test-dicts"></a>dicts | A list containing dictionaries. | `None` |
+| <a id="cc_fuzz_test-engine"></a>engine | A label pointing to the fuzzing engine to use. | `Label("@rules_fuzzing//fuzzing:cc_engine")` |
+| <a id="cc_fuzz_test-size"></a>size | The size of the regression test. This does *not* affect fuzzing itself. Takes the [common size values](https://bazel.build/reference/be/common-definitions#test.size). | `None` |
+| <a id="cc_fuzz_test-tags"></a>tags | Tags set on the regression test. | `None` |
+| <a id="cc_fuzz_test-timeout"></a>timeout | The timeout for the regression test. This does *not* affect fuzzing itself. Takes the [common timeout values](https://docs.bazel.build/versions/main/be/common-definitions.html#test.timeout). | `None` |
+| <a id="cc_fuzz_test-binary_kwargs"></a>binary_kwargs | Keyword arguments directly forwarded to the fuzz test binary rule. | none |
-<a id="#fuzzing_decoration"></a>
+<a id="fuzzing_decoration"></a>
## fuzzing_decoration
<pre>
+load("@rules_fuzzing//fuzzing:cc_defs.bzl", "fuzzing_decoration")
+
fuzzing_decoration(<a href="#fuzzing_decoration-name">name</a>, <a href="#fuzzing_decoration-raw_binary">raw_binary</a>, <a href="#fuzzing_decoration-engine">engine</a>, <a href="#fuzzing_decoration-corpus">corpus</a>, <a href="#fuzzing_decoration-dicts">dicts</a>, <a href="#fuzzing_decoration-instrument_binary">instrument_binary</a>,
- <a href="#fuzzing_decoration-define_regression_test">define_regression_test</a>, <a href="#fuzzing_decoration-test_tags">test_tags</a>)
+ <a href="#fuzzing_decoration-define_regression_test">define_regression_test</a>, <a href="#fuzzing_decoration-test_size">test_size</a>, <a href="#fuzzing_decoration-test_tags">test_tags</a>, <a href="#fuzzing_decoration-test_timeout">test_timeout</a>)
</pre>
Generates the standard targets associated to a fuzz test.
@@ -109,13 +119,15 @@
| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
-| <a id="fuzzing_decoration-name"></a>name | The name prefix of the generated targets. It is normally the fuzz test name in the BUILD file. | none |
-| <a id="fuzzing_decoration-raw_binary"></a>raw_binary | The label of the cc_binary or cc_test of fuzz test executable. | none |
+| <a id="fuzzing_decoration-name"></a>name | The name prefix of the generated targets. It is normally the fuzz test name in the BUILD file. | none |
+| <a id="fuzzing_decoration-raw_binary"></a>raw_binary | The label of the cc_binary or cc_test of fuzz test executable. | none |
| <a id="fuzzing_decoration-engine"></a>engine | The label of the fuzzing engine used to build the binary. | none |
-| <a id="fuzzing_decoration-corpus"></a>corpus | A list of corpus files. | <code>None</code> |
-| <a id="fuzzing_decoration-dicts"></a>dicts | A list of fuzzing dictionary files. | <code>None</code> |
-| <a id="fuzzing_decoration-instrument_binary"></a>instrument_binary | **(Experimental, may be removed in the future.)**<br><br> By default, the generated targets depend on <code>raw_binary</code> through a Bazel configuration using flags from the <code>@rules_fuzzing//fuzzing</code> package to determine the fuzzing build mode, engine, and sanitizer instrumentation.<br><br> When this argument is false, the targets assume that <code>raw_binary</code> is already built in the proper configuration and will not apply the transition.<br><br> Most users should not need to change this argument. If you think the default instrumentation mode does not work for your use case, please file a Github issue to discuss. | <code>True</code> |
-| <a id="fuzzing_decoration-define_regression_test"></a>define_regression_test | If true, generate a regression test rule. | <code>True</code> |
-| <a id="fuzzing_decoration-test_tags"></a>test_tags | Tags set on the fuzzing regression test. | <code>None</code> |
+| <a id="fuzzing_decoration-corpus"></a>corpus | A list of corpus files. | `None` |
+| <a id="fuzzing_decoration-dicts"></a>dicts | A list of fuzzing dictionary files. | `None` |
+| <a id="fuzzing_decoration-instrument_binary"></a>instrument_binary | **(Experimental, may be removed in the future.)**<br><br>By default, the generated targets depend on `raw_binary` through a Bazel configuration using flags from the `@rules_fuzzing//fuzzing` package to determine the fuzzing build mode, engine, and sanitizer instrumentation.<br><br>When this argument is false, the targets assume that `raw_binary` is already built in the proper configuration and will not apply the transition.<br><br>Most users should not need to change this argument. If you think the default instrumentation mode does not work for your use case, please file a Github issue to discuss. | `True` |
+| <a id="fuzzing_decoration-define_regression_test"></a>define_regression_test | If true, generate a regression test rule. | `True` |
+| <a id="fuzzing_decoration-test_size"></a>test_size | The size of the fuzzing regression test. | `None` |
+| <a id="fuzzing_decoration-test_tags"></a>test_tags | Tags set on the fuzzing regression test. | `None` |
+| <a id="fuzzing_decoration-test_timeout"></a>test_timeout | The timeout for the fuzzing regression test. | `None` |
diff --git a/docs/java-fuzzing-rules.md b/docs/java-fuzzing-rules.md
index ecec0ec..bb55136 100755
--- a/docs/java-fuzzing-rules.md
+++ b/docs/java-fuzzing-rules.md
@@ -1,44 +1,48 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->
-<a id="#java_fuzzing_engine"></a>
+Public definitions for fuzzing rules.
+
+Definitions outside this file are private unless otherwise noted, and may
+change without notice.
+
+<a id="java_fuzzing_engine"></a>
## java_fuzzing_engine
<pre>
+load("@rules_fuzzing//fuzzing:java_defs.bzl", "java_fuzzing_engine")
+
java_fuzzing_engine(<a href="#java_fuzzing_engine-name">name</a>, <a href="#java_fuzzing_engine-display_name">display_name</a>, <a href="#java_fuzzing_engine-launcher">launcher</a>, <a href="#java_fuzzing_engine-launcher_data">launcher_data</a>, <a href="#java_fuzzing_engine-library">library</a>)
</pre>
-
Specifies a fuzzing engine that can be used to run Java fuzz targets.
-
**ATTRIBUTES**
| Name | Description | Type | Mandatory | Default |
| :------------- | :------------- | :------------- | :------------- | :------------- |
-| <a id="java_fuzzing_engine-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
+| <a id="java_fuzzing_engine-name"></a>name | A unique name for this target. | <a href="https://bazel.build/concepts/labels#target-names">Name</a> | required | |
| <a id="java_fuzzing_engine-display_name"></a>display_name | The name of the fuzzing engine, as it should be rendered in human-readable output. | String | required | |
-| <a id="java_fuzzing_engine-launcher"></a>launcher | A shell script that knows how to launch the fuzzing executable based on configuration specified in the environment. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | required | |
-| <a id="java_fuzzing_engine-launcher_data"></a>launcher_data | A dict mapping additional runtime dependencies needed by the fuzzing engine to environment variables that will be available inside the launcher, holding the runtime path to the dependency. | <a href="https://bazel.build/docs/skylark/lib/dict.html">Dictionary: Label -> String</a> | optional | {} |
-| <a id="java_fuzzing_engine-library"></a>library | A java_library target that is made available to all Java fuzz tests. | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | None |
+| <a id="java_fuzzing_engine-launcher"></a>launcher | A shell script that knows how to launch the fuzzing executable based on configuration specified in the environment. | <a href="https://bazel.build/concepts/labels">Label</a> | required | |
+| <a id="java_fuzzing_engine-launcher_data"></a>launcher_data | A dict mapping additional runtime dependencies needed by the fuzzing engine to environment variables that will be available inside the launcher, holding the runtime path to the dependency. | <a href="https://bazel.build/rules/lib/dict">Dictionary: Label -> String</a> | optional | `{}` |
+| <a id="java_fuzzing_engine-library"></a>library | A java_library target that is made available to all Java fuzz tests. | <a href="https://bazel.build/concepts/labels">Label</a> | optional | `None` |
-<a id="#FuzzingEngineInfo"></a>
+<a id="FuzzingEngineInfo"></a>
## FuzzingEngineInfo
<pre>
+load("@rules_fuzzing//fuzzing:java_defs.bzl", "FuzzingEngineInfo")
+
FuzzingEngineInfo(<a href="#FuzzingEngineInfo-display_name">display_name</a>, <a href="#FuzzingEngineInfo-launcher">launcher</a>, <a href="#FuzzingEngineInfo-launcher_runfiles">launcher_runfiles</a>, <a href="#FuzzingEngineInfo-launcher_environment">launcher_environment</a>)
</pre>
-
Provider for storing the language-independent part of the specification of a fuzzing engine.
-
**FIELDS**
-
| Name | Description |
| :------------- | :------------- |
| <a id="FuzzingEngineInfo-display_name"></a>display_name | A string representing the human-readable name of the fuzzing engine. |
@@ -47,13 +51,15 @@
| <a id="FuzzingEngineInfo-launcher_environment"></a>launcher_environment | A dictionary from environment variables to files used by the launcher script. |
-<a id="#fuzzing_decoration"></a>
+<a id="fuzzing_decoration"></a>
## fuzzing_decoration
<pre>
+load("@rules_fuzzing//fuzzing:java_defs.bzl", "fuzzing_decoration")
+
fuzzing_decoration(<a href="#fuzzing_decoration-name">name</a>, <a href="#fuzzing_decoration-raw_binary">raw_binary</a>, <a href="#fuzzing_decoration-engine">engine</a>, <a href="#fuzzing_decoration-corpus">corpus</a>, <a href="#fuzzing_decoration-dicts">dicts</a>, <a href="#fuzzing_decoration-instrument_binary">instrument_binary</a>,
- <a href="#fuzzing_decoration-define_regression_test">define_regression_test</a>, <a href="#fuzzing_decoration-test_tags">test_tags</a>)
+ <a href="#fuzzing_decoration-define_regression_test">define_regression_test</a>, <a href="#fuzzing_decoration-test_size">test_size</a>, <a href="#fuzzing_decoration-test_tags">test_tags</a>, <a href="#fuzzing_decoration-test_timeout">test_timeout</a>)
</pre>
Generates the standard targets associated to a fuzz test.
@@ -68,22 +74,27 @@
| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
-| <a id="fuzzing_decoration-name"></a>name | The name prefix of the generated targets. It is normally the fuzz test name in the BUILD file. | none |
-| <a id="fuzzing_decoration-raw_binary"></a>raw_binary | The label of the cc_binary or cc_test of fuzz test executable. | none |
+| <a id="fuzzing_decoration-name"></a>name | The name prefix of the generated targets. It is normally the fuzz test name in the BUILD file. | none |
+| <a id="fuzzing_decoration-raw_binary"></a>raw_binary | The label of the cc_binary or cc_test of fuzz test executable. | none |
| <a id="fuzzing_decoration-engine"></a>engine | The label of the fuzzing engine used to build the binary. | none |
-| <a id="fuzzing_decoration-corpus"></a>corpus | A list of corpus files. | <code>None</code> |
-| <a id="fuzzing_decoration-dicts"></a>dicts | A list of fuzzing dictionary files. | <code>None</code> |
-| <a id="fuzzing_decoration-instrument_binary"></a>instrument_binary | **(Experimental, may be removed in the future.)**<br><br> By default, the generated targets depend on <code>raw_binary</code> through a Bazel configuration using flags from the <code>@rules_fuzzing//fuzzing</code> package to determine the fuzzing build mode, engine, and sanitizer instrumentation.<br><br> When this argument is false, the targets assume that <code>raw_binary</code> is already built in the proper configuration and will not apply the transition.<br><br> Most users should not need to change this argument. If you think the default instrumentation mode does not work for your use case, please file a Github issue to discuss. | <code>True</code> |
-| <a id="fuzzing_decoration-define_regression_test"></a>define_regression_test | If true, generate a regression test rule. | <code>True</code> |
-| <a id="fuzzing_decoration-test_tags"></a>test_tags | Tags set on the fuzzing regression test. | <code>None</code> |
+| <a id="fuzzing_decoration-corpus"></a>corpus | A list of corpus files. | `None` |
+| <a id="fuzzing_decoration-dicts"></a>dicts | A list of fuzzing dictionary files. | `None` |
+| <a id="fuzzing_decoration-instrument_binary"></a>instrument_binary | **(Experimental, may be removed in the future.)**<br><br>By default, the generated targets depend on `raw_binary` through a Bazel configuration using flags from the `@rules_fuzzing//fuzzing` package to determine the fuzzing build mode, engine, and sanitizer instrumentation.<br><br>When this argument is false, the targets assume that `raw_binary` is already built in the proper configuration and will not apply the transition.<br><br>Most users should not need to change this argument. If you think the default instrumentation mode does not work for your use case, please file a Github issue to discuss. | `True` |
+| <a id="fuzzing_decoration-define_regression_test"></a>define_regression_test | If true, generate a regression test rule. | `True` |
+| <a id="fuzzing_decoration-test_size"></a>test_size | The size of the fuzzing regression test. | `None` |
+| <a id="fuzzing_decoration-test_tags"></a>test_tags | Tags set on the fuzzing regression test. | `None` |
+| <a id="fuzzing_decoration-test_timeout"></a>test_timeout | The timeout for the fuzzing regression test. | `None` |
-<a id="#java_fuzz_test"></a>
+<a id="java_fuzz_test"></a>
## java_fuzz_test
<pre>
-java_fuzz_test(<a href="#java_fuzz_test-name">name</a>, <a href="#java_fuzz_test-srcs">srcs</a>, <a href="#java_fuzz_test-target_class">target_class</a>, <a href="#java_fuzz_test-corpus">corpus</a>, <a href="#java_fuzz_test-dicts">dicts</a>, <a href="#java_fuzz_test-engine">engine</a>, <a href="#java_fuzz_test-tags">tags</a>, <a href="#java_fuzz_test-binary_kwargs">binary_kwargs</a>)
+load("@rules_fuzzing//fuzzing:java_defs.bzl", "java_fuzz_test")
+
+java_fuzz_test(<a href="#java_fuzz_test-name">name</a>, <a href="#java_fuzz_test-srcs">srcs</a>, <a href="#java_fuzz_test-target_class">target_class</a>, <a href="#java_fuzz_test-corpus">corpus</a>, <a href="#java_fuzz_test-dicts">dicts</a>, <a href="#java_fuzz_test-engine">engine</a>, <a href="#java_fuzz_test-size">size</a>, <a href="#java_fuzz_test-tags">tags</a>, <a href="#java_fuzz_test-timeout">timeout</a>,
+ <a href="#java_fuzz_test-binary_kwargs">**binary_kwargs</a>)
</pre>
Defines a Java fuzz test and a few associated tools and metadata.
@@ -112,12 +123,14 @@
| Name | Description | Default Value |
| :------------- | :------------- | :------------- |
| <a id="java_fuzz_test-name"></a>name | A unique name for this target. Required. | none |
-| <a id="java_fuzz_test-srcs"></a>srcs | A list of source files of the target. | <code>None</code> |
-| <a id="java_fuzz_test-target_class"></a>target_class | The class that contains the static fuzzerTestOneInput method. Defaults to the same class main_class would. | <code>None</code> |
-| <a id="java_fuzz_test-corpus"></a>corpus | A list containing corpus files. | <code>None</code> |
-| <a id="java_fuzz_test-dicts"></a>dicts | A list containing dictionaries. | <code>None</code> |
-| <a id="java_fuzz_test-engine"></a>engine | A label pointing to the fuzzing engine to use. | <code>"@rules_fuzzing//fuzzing:java_engine"</code> |
-| <a id="java_fuzz_test-tags"></a>tags | Tags set on the fuzzing regression test. | <code>None</code> |
-| <a id="java_fuzz_test-binary_kwargs"></a>binary_kwargs | Keyword arguments directly forwarded to the fuzz test binary rule. | none |
+| <a id="java_fuzz_test-srcs"></a>srcs | A list of source files of the target. | `None` |
+| <a id="java_fuzz_test-target_class"></a>target_class | The class that contains the static fuzzerTestOneInput method. Defaults to the same class main_class would. | `None` |
+| <a id="java_fuzz_test-corpus"></a>corpus | A list containing corpus files. | `None` |
+| <a id="java_fuzz_test-dicts"></a>dicts | A list containing dictionaries. | `None` |
+| <a id="java_fuzz_test-engine"></a>engine | A label pointing to the fuzzing engine to use. | `Label("@rules_fuzzing//fuzzing:java_engine")` |
+| <a id="java_fuzz_test-size"></a>size | The size of the regression test. This does *not* affect fuzzing itself. Takes the [common size values](https://bazel.build/reference/be/common-definitions#test.size). | `None` |
+| <a id="java_fuzz_test-tags"></a>tags | Tags set on the regression test. | `None` |
+| <a id="java_fuzz_test-timeout"></a>timeout | The timeout for the regression test. This does *not* affect fuzzing itself. Takes the [common timeout values](https://docs.bazel.build/versions/main/be/common-definitions.html#test.timeout). | `None` |
+| <a id="java_fuzz_test-binary_kwargs"></a>binary_kwargs | Keyword arguments directly forwarded to the fuzz test binary rule. | none |
diff --git a/examples/java/BUILD b/examples/java/BUILD
index 9151524..56e8c1e 100644
--- a/examples/java/BUILD
+++ b/examples/java/BUILD
@@ -16,6 +16,8 @@
# serve as regression tests. Targets that are expected to crash or hang are
# disabled in the OSS-Fuzz integration using the "no-oss-fuzz" tag.
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("//fuzzing:java_defs.bzl", "java_fuzz_test")
filegroup(
diff --git a/fuzzing/engines/BUILD b/fuzzing/engines/BUILD
index a8f122d..79e491a 100644
--- a/fuzzing/engines/BUILD
+++ b/fuzzing/engines/BUILD
@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
+load("@rules_java//java:java_library.bzl", "java_library")
load("//fuzzing:cc_defs.bzl", "cc_fuzzing_engine")
load("//fuzzing:java_defs.bzl", "java_fuzzing_engine")
diff --git a/fuzzing/private/engine.bzl b/fuzzing/private/engine.bzl
index 9d8656d..b5e121f 100644
--- a/fuzzing/private/engine.bzl
+++ b/fuzzing/private/engine.bzl
@@ -14,6 +14,9 @@
"""The implementation of the {cc, java}_fuzzing_engine rules."""
+load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
+load("@rules_java//java/common:java_info.bzl", "JavaInfo")
+
FuzzingEngineInfo = provider(
doc = """
Provider for storing the language-independent part of the specification of a fuzzing engine.
diff --git a/fuzzing/private/engine_test.bzl b/fuzzing/private/engine_test.bzl
index 4202c6a..30561a8 100644
--- a/fuzzing/private/engine_test.bzl
+++ b/fuzzing/private/engine_test.bzl
@@ -16,13 +16,15 @@
load("@bazel_skylib//lib:new_sets.bzl", "sets")
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts")
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
+load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
load(":engine.bzl", "FuzzingEngineInfo", "cc_fuzzing_engine")
load(":util.bzl", "generate_file")
# Shared fixtures.
def _setup_common_stubs():
- native.cc_library(
+ cc_library(
name = "library_stub",
srcs = [],
testonly = 1,
diff --git a/fuzzing/private/fuzz_test.bzl b/fuzzing/private/fuzz_test.bzl
index 126a688..a0f6b5d 100644
--- a/fuzzing/private/fuzz_test.bzl
+++ b/fuzzing/private/fuzz_test.bzl
@@ -14,7 +14,9 @@
"""The implementation of the {cc, java}_fuzz_test rules."""
+load("@rules_cc//cc:cc_binary.bzl", "cc_binary")
load("@rules_fuzzing_oss_fuzz//:instrum.bzl", "native_library_sanitizer")
+load("@rules_java//java:java_binary.bzl", "java_binary")
load("//fuzzing/private:binary.bzl", "fuzzing_binary", "fuzzing_binary_uninstrumented")
load("//fuzzing/private:common.bzl", "fuzzing_corpus", "fuzzing_dictionary", "fuzzing_launcher")
load("//fuzzing/private:java_utils.bzl", "determine_primary_class", "jazzer_fuzz_binary")
@@ -192,7 +194,7 @@
# tags is not configurable and can thus use append.
binary_kwargs.setdefault("tags", []).append("manual")
- native.cc_binary(
+ cc_binary(
name = raw_binary_name,
**binary_kwargs
)
@@ -285,8 +287,7 @@
name = name,
))
target_class_manifest_line = "Jazzer-Fuzz-Target-Class: %s" % target_class
-
- native.java_binary(
+ java_binary(
name = metadata_binary_name,
create_executable = False,
deploy_manifest_lines = [target_class_manifest_line],
@@ -318,7 +319,7 @@
# tags is not configurable and can thus use append.
binary_kwargs.setdefault("tags", []).append("manual")
- native.java_binary(
+ java_binary(
name = raw_target_name,
srcs = srcs,
main_class = "com.code_intelligence.jazzer.Jazzer",
diff --git a/fuzzing/private/java_utils.bzl b/fuzzing/private/java_utils.bzl
index 10b4bb7..1e85648 100644
--- a/fuzzing/private/java_utils.bzl
+++ b/fuzzing/private/java_utils.bzl
@@ -14,6 +14,7 @@
"""Utilities and helper rules for Java fuzz tests."""
+load("@rules_java//java/common:java_info.bzl", "JavaInfo")
load("//fuzzing/private:binary.bzl", "fuzzing_binary_transition")
load("//fuzzing/private:util.bzl", "runfile_path")
diff --git a/fuzzing/replay/BUILD b/fuzzing/replay/BUILD
index eff44a3..b774f1b 100644
--- a/fuzzing/replay/BUILD
+++ b/fuzzing/replay/BUILD
@@ -14,6 +14,9 @@
# Tools for replaying test files.
+load("@rules_cc//cc:cc_library.bzl", "cc_library")
+load("@rules_cc//cc:cc_test.bzl", "cc_test")
+
package(default_visibility = ["//fuzzing:__subpackages__"])
# Libraries.
diff --git a/fuzzing/repositories.bzl b/fuzzing/repositories.bzl
index e290e64..22e2864 100644
--- a/fuzzing/repositories.bzl
+++ b/fuzzing/repositories.bzl
@@ -80,13 +80,13 @@
maybe(
http_jar,
name = "rules_fuzzing_jazzer",
- sha256 = "ee6feb569d88962d59cb59e8a31eb9d007c82683f3ebc64955fd5b96f277eec2",
- url = "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.20.1/jazzer-0.20.1.jar",
+ integrity = "sha256-WwSnW/097dHvODZlYdAYLmz7m/Su0t09yBH6aSLdyLs=",
+ url = "https://repo1.maven.org/maven2/com/code-intelligence/jazzer/0.24.0/jazzer-0.24.0.jar",
)
maybe(
http_jar,
name = "rules_fuzzing_jazzer_api",
- sha256 = "f5a60242bc408f7fa20fccf10d6c5c5ea1fcb3c6f44642fec5af88373ae7aa1b",
- url = "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.20.1/jazzer-api-0.20.1.jar",
+ integrity = "sha256-cfhJJDSmErtNa+JrH81AjShCBGN9+N1VcIBfykiWjaQ=",
+ url = "https://repo1.maven.org/maven2/com/code-intelligence/jazzer-api/0.24.0/jazzer-api-0.24.0.jar",
)
diff --git a/fuzzing/tools/BUILD b/fuzzing/tools/BUILD
index 0f483ff..9fbcc78 100644
--- a/fuzzing/tools/BUILD
+++ b/fuzzing/tools/BUILD
@@ -16,6 +16,7 @@
load("@fuzzing_py_deps//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary", "py_library", "py_test")
+load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
# Tools.
########