|
| 1 | +# TODO: migrate all dependencies from WORKSPACE to MODULE.bazel |
| 2 | +# https://github.com/protocolbuffers/protobuf/issues/14313 |
| 3 | + |
| 4 | +module( |
| 5 | + name = "protobuf", |
| 6 | + version = "28.3.arenastring", # Automatically updated on release |
| 7 | + compatibility_level = 1, |
| 8 | + repo_name = "com_google_protobuf", |
| 9 | +) |
| 10 | + |
| 11 | +# LOWER BOUND dependency versions. |
| 12 | +# Bzlmod follows MVS: |
| 13 | +# https://bazel.build/versions/6.0.0/build/bzlmod#version-resolution |
| 14 | +# Thus the highest version in their module graph is resolved. |
| 15 | +bazel_dep(name = "abseil-cpp", version = "20230802.0.bcr.1", repo_name = "com_google_absl") |
| 16 | +bazel_dep(name = "bazel_skylib", version = "1.4.1") |
| 17 | +bazel_dep(name = "jsoncpp", version = "1.9.5") |
| 18 | +bazel_dep(name = "rules_cc", version = "0.0.9") |
| 19 | +bazel_dep(name = "rules_fuzzing", version = "0.5.2") |
| 20 | +bazel_dep(name = "rules_java", version = "5.3.5") |
| 21 | +bazel_dep(name = "rules_jvm_external", version = "5.1") |
| 22 | +bazel_dep(name = "rules_pkg", version = "0.7.0") |
| 23 | +bazel_dep(name = "rules_python", version = "0.28.0") |
| 24 | +bazel_dep(name = "rules_rust", version = "0.45.1") |
| 25 | +bazel_dep(name = "platforms", version = "0.0.8") |
| 26 | +bazel_dep(name = "zlib", version = "1.3.1") |
| 27 | + |
| 28 | +# TODO: remove after toolchain types are moved to protobuf |
| 29 | +bazel_dep(name = "rules_proto", version = "4.0.0") |
| 30 | + |
| 31 | +SUPPORTED_PYTHON_VERSIONS = [ |
| 32 | + "3.8", |
| 33 | + "3.9", |
| 34 | + "3.10", |
| 35 | + "3.11", |
| 36 | + "3.12", |
| 37 | +] |
| 38 | +python = use_extension("@rules_python//python/extensions:python.bzl", "python") |
| 39 | +[ |
| 40 | + python.toolchain( |
| 41 | + is_default = python_version == SUPPORTED_PYTHON_VERSIONS[-1], |
| 42 | + python_version = python_version, |
| 43 | + ) |
| 44 | + for python_version in SUPPORTED_PYTHON_VERSIONS |
| 45 | +] |
| 46 | +use_repo(python, system_python = "python_{}".format(SUPPORTED_PYTHON_VERSIONS[-1].replace(".", "_"))) |
| 47 | +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| 48 | +[ |
| 49 | + pip.parse( |
| 50 | + hub_name = "pip_deps", |
| 51 | + python_version = python_version, |
| 52 | + requirements_lock = "//python:requirements.txt", |
| 53 | + ) |
| 54 | + for python_version in SUPPORTED_PYTHON_VERSIONS |
| 55 | +] |
| 56 | +use_repo(pip, "pip_deps") |
| 57 | + |
| 58 | +rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") |
| 59 | +rust.toolchain(edition = "2021") |
| 60 | +use_repo(rust, "rust_toolchains") |
| 61 | +register_toolchains("@rust_toolchains//:all") |
| 62 | +crate = use_extension("@rules_rust//crate_universe:extension.bzl", "crate") |
| 63 | +crate.spec( |
| 64 | + package = "googletest", |
| 65 | + version = ">0.0.0", |
| 66 | +) |
| 67 | +crate.spec( |
| 68 | + package = "paste", |
| 69 | + version = ">=1", |
| 70 | +) |
| 71 | +crate.from_specs() |
| 72 | +use_repo(crate, crate_index = "crates") |
| 73 | + |
| 74 | +bazel_dep(name = "googletest", version = "1.15.2", repo_name = "com_google_googletest", dev_dependency = True) |
| 75 | +bazel_dep(name = "rules_ruby", dev_dependency = True) |
| 76 | +archive_override( |
| 77 | + module_name = "rules_ruby", |
| 78 | + urls = ["https://github.com/protocolbuffers/rules_ruby/archive/b7f3e9756f3c45527be27bc38840d5a1ba690436.tar.gz"], |
| 79 | + strip_prefix = "rules_ruby-b7f3e9756f3c45527be27bc38840d5a1ba690436", |
| 80 | + integrity = "sha256-RNo21X/p9slOdF912FLprLnxvZHMXBTxaUDGFmm2bx8=", |
| 81 | + patches = ["third_party/rules_ruby.patch"], |
| 82 | + patch_strip = 1, |
| 83 | +) |
0 commit comments