|
| 1 | +# Copyright 2024 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +module( |
| 16 | + name = "rules_fuzzing", |
| 17 | + # Automatically updated during releases by the Publish to BCR app. |
| 18 | + version = "0.0.0", |
| 19 | +) |
| 20 | + |
| 21 | +bazel_dep(name = "abseil-cpp", version = "20240116.1", repo_name = "com_google_absl") |
| 22 | +bazel_dep(name = "bazel_skylib", version = "1.5.0") |
| 23 | +bazel_dep(name = "platforms", version = "0.0.8") |
| 24 | +bazel_dep(name = "rules_python", version = "0.28.0") |
| 25 | +bazel_dep(name = "rules_java", version = "6.5.2") |
| 26 | + |
| 27 | +bazel_dep(name = "stardoc", version = "0.6.2", dev_dependency = True, repo_name = "io_bazel_stardoc") |
| 28 | +bazel_dep(name = "googletest", version = "1.14.0.bcr.1", dev_dependency = True, repo_name = "com_google_googletest") |
| 29 | +bazel_dep(name = "re2", version = "2023-11-01", dev_dependency = True) |
| 30 | + |
| 31 | +non_module_dependencies = use_extension("//fuzzing/private:extensions.bzl", "non_module_dependencies") |
| 32 | +use_repo( |
| 33 | + non_module_dependencies, |
| 34 | + "honggfuzz", |
| 35 | + "rules_fuzzing_jazzer", |
| 36 | + "rules_fuzzing_jazzer_api", |
| 37 | + "rules_fuzzing_oss_fuzz", |
| 38 | +) |
| 39 | + |
| 40 | +SUPPORTED_PYTHON_VERSIONS = [ |
| 41 | + "3.8", |
| 42 | + "3.9", |
| 43 | + "3.10", |
| 44 | + "3.11", |
| 45 | + "3.12", |
| 46 | +] |
| 47 | + |
| 48 | +python = use_extension("@rules_python//python/extensions:python.bzl", "python") |
| 49 | + |
| 50 | +[ |
| 51 | + python.toolchain( |
| 52 | + # Required to avoid an error when running as root in OSS-Fuzz. |
| 53 | + ignore_root_user_error = True, |
| 54 | + is_default = python_version == SUPPORTED_PYTHON_VERSIONS[-1], |
| 55 | + python_version = python_version, |
| 56 | + ) |
| 57 | + for python_version in SUPPORTED_PYTHON_VERSIONS |
| 58 | +] |
| 59 | + |
| 60 | +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| 61 | + |
| 62 | +[ |
| 63 | + pip.parse( |
| 64 | + extra_pip_args = ["--require-hashes"], |
| 65 | + hub_name = "rules_fuzzing_py_deps", |
| 66 | + python_version = python_version, |
| 67 | + requirements_lock = "//fuzzing:requirements.txt", |
| 68 | + ) |
| 69 | + for python_version in SUPPORTED_PYTHON_VERSIONS |
| 70 | +] |
| 71 | + |
| 72 | +use_repo(pip, fuzzing_py_deps = "rules_fuzzing_py_deps") |
| 73 | + |
| 74 | +java_toolchains = use_extension("@rules_java//java:extensions.bzl", "toolchains") |
| 75 | +use_repo(java_toolchains, "local_jdk") |
0 commit comments