-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Requires fixing a case of a non-hermetic Python import in `dict_validation_test` that breaks with Python 3.11, with which Bazel uses `PYTHONSAFEPATH` by default. A follow-up PR will provide the publishing setup for releases to the Bazel Central Registry (BCR).
- Loading branch information
Showing
15 changed files
with
194 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
7.0.0 | ||
7.0.1rc2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module( | ||
name = "rules_fuzzing", | ||
# Automatically updated during releases by the Publish to BCR app. | ||
version = "0.0.0", | ||
) | ||
|
||
bazel_dep(name = "abseil-cpp", version = "20230802.1", repo_name = "com_google_absl") | ||
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 = "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") | ||
bazel_dep(name = "re2", version = "2023-11-01", dev_dependency = True) | ||
|
||
non_module_dependencies = use_extension("//fuzzing/private:extensions.bzl", "non_module_dependencies") | ||
use_repo( | ||
non_module_dependencies, | ||
"honggfuzz", | ||
"rules_fuzzing_jazzer", | ||
"rules_fuzzing_jazzer_api", | ||
"rules_fuzzing_oss_fuzz", | ||
) | ||
|
||
SUPPORTED_PYTHON_VERSIONS = [ | ||
"3.8", | ||
"3.9", | ||
"3.10", | ||
"3.11", | ||
"3.12", | ||
] | ||
|
||
python = use_extension("@rules_python//python/extensions:python.bzl", "python") | ||
|
||
[ | ||
python.toolchain( | ||
# Required to avoid an error when running as root in OSS-Fuzz. | ||
ignore_root_user_error = True, | ||
is_default = python_version == SUPPORTED_PYTHON_VERSIONS[-1], | ||
python_version = python_version, | ||
) | ||
for python_version in SUPPORTED_PYTHON_VERSIONS | ||
] | ||
|
||
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") | ||
|
||
[ | ||
pip.parse( | ||
extra_pip_args = ["--require-hashes"], | ||
hub_name = "rules_fuzzing_py_deps", | ||
python_version = python_version, | ||
requirements_lock = "//fuzzing:requirements.txt", | ||
) | ||
for python_version in SUPPORTED_PYTHON_VERSIONS | ||
] | ||
|
||
use_repo(pip, fuzzing_py_deps = "rules_fuzzing_py_deps") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Intentionally left blank as all deps are defined in MODULE.bazel. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
common --repo_env=CC=clang | ||
common --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer | ||
common --@rules_fuzzing//fuzzing:cc_engine_sanitizer=asan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test") | ||
load("@rules_fuzzing//fuzzing:java_defs.bzl", "java_fuzz_test") | ||
|
||
cc_fuzz_test( | ||
name = "cc_fuzz_test", | ||
srcs = ["cc_fuzz_test.cc"], | ||
) | ||
|
||
java_fuzz_test( | ||
name = "java_fuzz_test", | ||
srcs = ["JavaFuzzTest.java"], | ||
target_class = "com.example.JavaFuzzTest", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// A plain fuzz target that does nothing. | ||
|
||
package com.example; | ||
|
||
import com.code_intelligence.jazzer.api.FuzzedDataProvider; | ||
|
||
public class JavaFuzzTest { | ||
public static void fuzzerTestOneInput(FuzzedDataProvider data) {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
bazel_dep(name = "rules_fuzzing") | ||
local_path_override( | ||
module_name = "rules_fuzzing", | ||
path = "../..", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Copyright 2024 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
// A plain fuzz target that does nothing (just returns). | ||
|
||
#include <cstddef> | ||
#include <cstdint> | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
"""Internal dependencies that are not Bazel modules.""" | ||
|
||
load("//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") | ||
|
||
def _non_module_dependencies(_): | ||
rules_fuzzing_dependencies() | ||
|
||
non_module_dependencies = module_extension(_non_module_dependencies) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters