|
| 1 | +"""Load dependencies needed to compile p4runtime as a 3rd-party consumer.""" |
| 2 | + |
| 3 | +load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") |
| 4 | +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 5 | + |
| 6 | +def p4runtime_deps(): |
| 7 | + """Loads dependencies needed to compile p4runtime.""" |
| 8 | + if not native.existing_rule("com_google_protobuf"): |
| 9 | + http_archive( |
| 10 | + name = "com_google_protobuf", |
| 11 | + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", |
| 12 | + strip_prefix = "protobuf-28.2", |
| 13 | + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", |
| 14 | + ) |
| 15 | + if not native.existing_rule("rules_proto"): |
| 16 | + http_archive( |
| 17 | + name = "rules_proto", |
| 18 | + sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", |
| 19 | + strip_prefix = "rules_proto-6.0.2", |
| 20 | + url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz", |
| 21 | + ) |
| 22 | + # rules_go is provided transitively by grpc_deps/grpc_extra_deps. |
| 23 | + if not native.existing_rule("com_google_googleapis"): |
| 24 | + git_repository( |
| 25 | + name = "com_google_googleapis", |
| 26 | + remote = "https://github.com/googleapis/googleapis", |
| 27 | + commit = "c0fcb35628690e9eb15dcefae41c651c67cd050b", |
| 28 | + ) |
| 29 | + if not native.existing_rule("com_github_grpc_grpc"): |
| 30 | + http_archive( |
| 31 | + name = "com_github_grpc_grpc", |
| 32 | + url = "https://github.com/grpc/grpc/archive/refs/tags/v1.63.0.tar.gz", |
| 33 | + strip_prefix = "grpc-1.63.0", |
| 34 | + sha256 = "493d9905aa09124c2f44268b66205dd013f3925a7e82995f36745974e97af609", |
| 35 | + ) |
| 36 | + if not native.existing_rule("bazel_skylib"): |
| 37 | + http_archive( |
| 38 | + name = "bazel_skylib", |
| 39 | + sha256 = "3b5b49006181f5f8ff626ef8ddceaa95e9bb8ad294f7b5d7b11ea9f7ddaf8c59", |
| 40 | + urls = [ |
| 41 | + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.9.0/bazel-skylib-1.9.0.tar.gz", |
| 42 | + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.9.0/bazel-skylib-1.9.0.tar.gz", |
| 43 | + ], |
| 44 | + ) |
| 45 | + if not native.existing_rule("rules_license"): |
| 46 | + http_archive( |
| 47 | + name = "rules_license", |
| 48 | + urls = [ |
| 49 | + "https://mirror.bazel.build/github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz", |
| 50 | + "https://github.com/bazelbuild/rules_license/releases/download/1.0.0/rules_license-1.0.0.tar.gz", |
| 51 | + ], |
| 52 | + sha256 = "26d4021f6898e23b82ef953078389dd49ac2b5618ac564ade4ef87cced147b38", |
| 53 | + ) |
| 54 | + if not native.existing_rule("com_google_re2"): |
| 55 | + http_archive( |
| 56 | + name = "com_google_re2", |
| 57 | + url = "https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz", |
| 58 | + strip_prefix = "re2-2024-07-02", |
| 59 | + sha256 = "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b", |
| 60 | + ) |
0 commit comments