Jakob Buchgraber | 699c0eb | 2017-09-05 17:15:10 +0200 | [diff] [blame] | 1 | workspace(name = "com_google_protobuf") |
Cody Schroeder | 802d543 | 2018-12-11 11:58:26 -0800 | [diff] [blame] | 2 | |
Protobuf Team Bot | da7245c | 2023-11-02 13:53:44 -0700 | [diff] [blame] | 3 | # An explicit self-reference to work around changes in Bazel 7.0 |
| 4 | # See https://github.com/bazelbuild/bazel/issues/19973#issuecomment-1787814450 |
| 5 | # buildifier: disable=duplicated-name |
| 6 | local_repository(name = "com_google_protobuf", path = ".") |
| 7 | |
Yannic | 2e51ad6 | 2020-03-03 00:15:22 +0100 | [diff] [blame] | 8 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 9 | |
Yannic Bonenberger | bf0c69e | 2019-07-26 13:14:19 +0200 | [diff] [blame] | 10 | local_repository( |
| 11 | name = "com_google_protobuf_examples", |
| 12 | path = "examples", |
| 13 | ) |
| 14 | |
Deanna Garcia | 99529a2 | 2023-05-02 11:18:25 -0700 | [diff] [blame] | 15 | # Load common dependencies first to ensure we use the correct version |
| 16 | load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 17 | |
Deanna Garcia | 99529a2 | 2023-05-02 11:18:25 -0700 | [diff] [blame] | 18 | protobuf_deps() |
| 19 | |
Mike Kruskal | 2eea38e | 2022-08-22 14:39:03 -0700 | [diff] [blame] | 20 | # Bazel platform rules. |
| 21 | http_archive( |
| 22 | name = "platforms", |
Keith Smiley | 6f98007 | 2023-08-30 08:23:00 -0700 | [diff] [blame] | 23 | urls = [ |
| 24 | "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", |
| 25 | "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz", |
| 26 | ], |
| 27 | sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51", |
Mike Kruskal | 2eea38e | 2022-08-22 14:39:03 -0700 | [diff] [blame] | 28 | ) |
| 29 | |
Deanna Garcia | 244b245 | 2023-03-16 13:50:11 -0700 | [diff] [blame] | 30 | http_archive( |
| 31 | name = "com_google_googletest", |
| 32 | sha256 = "730215d76eace9dd49bf74ce044e8daa065d175f1ac891cc1d6bb184ef94e565", |
| 33 | strip_prefix = "googletest-f53219cdcb7b084ef57414efea92ee5b71989558", |
| 34 | urls = [ |
| 35 | "https://github.com/google/googletest/archive/f53219cdcb7b084ef57414efea92ee5b71989558.tar.gz" # 2023-03-16 |
| 36 | ], |
| 37 | ) |
| 38 | |
| 39 | load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps") |
| 40 | |
| 41 | googletest_deps() |
| 42 | |
deannagarcia | 5b27b4f | 2023-01-19 15:10:20 -0800 | [diff] [blame] | 43 | load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") |
| 44 | |
| 45 | rules_jvm_external_deps() |
| 46 | |
| 47 | load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") |
| 48 | |
| 49 | rules_jvm_external_setup() |
| 50 | |
Derek Perez | bc45f92 | 2021-04-20 11:36:32 -0700 | [diff] [blame] | 51 | load("@rules_jvm_external//:defs.bzl", "maven_install") |
Adam Cozzette | 454f0cc | 2021-10-12 15:37:40 -0700 | [diff] [blame] | 52 | |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 53 | maven_install( |
| 54 | artifacts = PROTOBUF_MAVEN_ARTIFACTS, |
| 55 | # For updating instructions, see: |
| 56 | # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson |
| 57 | maven_install_json = "//:maven_install.json", |
Derek Perez | bc45f92 | 2021-04-20 11:36:32 -0700 | [diff] [blame] | 58 | repositories = [ |
Jingwen Chen | 51d9876 | 2019-12-02 12:35:00 -0500 | [diff] [blame] | 59 | "https://repo1.maven.org/maven2", |
Derek Perez | 87d140f | 2021-04-22 12:12:41 -0700 | [diff] [blame] | 60 | "https://repo.maven.apache.org/maven2", |
Jingwen Chen | 51d9876 | 2019-12-02 12:35:00 -0500 | [diff] [blame] | 61 | ], |
Steven Parkes | a9244ca | 2016-03-10 17:50:25 -0800 | [diff] [blame] | 62 | ) |
| 63 | |
Derek Perez | db8f725 | 2021-04-21 16:26:05 -0700 | [diff] [blame] | 64 | load("@maven//:defs.bzl", "pinned_maven_install") |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 65 | |
Derek Perez | db8f725 | 2021-04-21 16:26:05 -0700 | [diff] [blame] | 66 | pinned_maven_install() |
| 67 | |
Derek Perez | 6168922 | 2021-04-21 18:05:18 -0700 | [diff] [blame] | 68 | # For `cc_proto_blacklist_test` and `build_test`. |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 69 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
Adam Cozzette | c7dfd0d | 2021-10-28 10:34:54 -0700 | [diff] [blame] | 70 | |
Yannic | 948740b | 2020-01-15 19:27:35 +0100 | [diff] [blame] | 71 | bazel_skylib_workspace() |
Derek Perez | 3a4d931 | 2021-11-04 22:57:29 +0000 | [diff] [blame] | 72 | |
| 73 | load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 74 | |
Derek Perez | 3a4d931 | 2021-11-04 22:57:29 +0000 | [diff] [blame] | 75 | rules_pkg_dependencies() |
Deanna Garcia | dfd99e7 | 2022-01-12 21:54:30 +0000 | [diff] [blame] | 76 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 77 | load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 78 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 79 | apple_rules_dependencies() |
| 80 | |
Deanna Garcia | dfd99e7 | 2022-01-12 21:54:30 +0000 | [diff] [blame] | 81 | # For `kt_jvm_library` |
Deanna Garcia | dfd99e7 | 2022-01-12 21:54:30 +0000 | [diff] [blame] | 82 | load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 83 | |
Deanna Garcia | dfd99e7 | 2022-01-12 21:54:30 +0000 | [diff] [blame] | 84 | kotlin_repositories() |
| 85 | |
| 86 | load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 87 | |
Deanna Garcia | dfd99e7 | 2022-01-12 21:54:30 +0000 | [diff] [blame] | 88 | kt_register_toolchains() |
Joshua Haberman | a6901f0 | 2022-04-25 22:00:57 +0000 | [diff] [blame] | 89 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 90 | load("@rules_ruby//ruby:defs.bzl", "ruby_runtime") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 91 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 92 | ruby_runtime("system_ruby") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 93 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 94 | register_toolchains("@system_ruby//:toolchain") |
| 95 | |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 96 | # Uncomment pairs of ruby_runtime() + register_toolchain() calls below to enable |
| 97 | # local JRuby testing. Do not submit the changes (due to impact on test duration |
| 98 | # for non JRuby builds due to downloading JRuby SDKs). |
| 99 | #ruby_runtime("jruby-9.2") |
| 100 | # |
| 101 | #register_toolchains("@jruby-9.2//:toolchain") |
| 102 | # |
| 103 | #ruby_runtime("jruby-9.3") |
| 104 | # |
| 105 | #register_toolchains("@jruby-9.3//:toolchain") |
| 106 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 107 | load("@system_ruby//:bundle.bzl", "ruby_bundle") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 108 | |
Mike Kruskal | 633e8f7 | 2023-01-03 12:11:31 -0800 | [diff] [blame] | 109 | ruby_bundle( |
| 110 | name = "protobuf_bundle", |
| 111 | srcs = ["//ruby:google-protobuf.gemspec"], |
| 112 | gemfile = "//ruby:Gemfile", |
| 113 | ) |
| 114 | |
Adam Cozzette | 6841d11 | 2023-08-11 11:45:54 -0700 | [diff] [blame] | 115 | http_archive( |
| 116 | name = "lua", |
Adam Cozzette | 501ecec | 2023-09-26 14:36:20 -0700 | [diff] [blame] | 117 | build_file = "//bazel:lua.BUILD", |
Adam Cozzette | 6841d11 | 2023-08-11 11:45:54 -0700 | [diff] [blame] | 118 | sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b", |
| 119 | strip_prefix = "lua-5.2.4", |
| 120 | urls = [ |
| 121 | "https://mirror.bazel.build/www.lua.org/ftp/lua-5.2.4.tar.gz", |
| 122 | "https://www.lua.org/ftp/lua-5.2.4.tar.gz", |
| 123 | ], |
| 124 | ) |
| 125 | |
| 126 | http_archive( |
| 127 | name = "com_github_google_benchmark", |
| 128 | urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"], |
| 129 | strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47", |
| 130 | sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0", |
| 131 | ) |
| 132 | |
| 133 | http_archive( |
| 134 | name = "com_google_googleapis", |
| 135 | urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"], |
| 136 | strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83", |
| 137 | sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46", |
Adam Cozzette | 501ecec | 2023-09-26 14:36:20 -0700 | [diff] [blame] | 138 | build_file = "//benchmarks:BUILD.googleapis", |
Adam Cozzette | 6841d11 | 2023-08-11 11:45:54 -0700 | [diff] [blame] | 139 | patch_cmds = ["find google -type f -name BUILD.bazel -delete"], |
| 140 | ) |
| 141 | |
Adam Cozzette | 501ecec | 2023-09-26 14:36:20 -0700 | [diff] [blame] | 142 | load("//bazel:system_python.bzl", "system_python") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 143 | |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 144 | system_python( |
| 145 | name = "system_python", |
| 146 | minimum_python_version = "3.7", |
| 147 | ) |
| 148 | |
| 149 | load("@system_python//:pip.bzl", "pip_parse") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 150 | |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 151 | pip_parse( |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 152 | name = "pip_deps", |
Adam Cozzette | 501ecec | 2023-09-26 14:36:20 -0700 | [diff] [blame] | 153 | requirements = "//python:requirements.txt", |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 154 | ) |
| 155 | |
| 156 | load("@pip_deps//:requirements.bzl", "install_deps") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 157 | |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 158 | install_deps() |
Mike Kruskal | ed5c57a | 2022-08-10 22:51:29 -0700 | [diff] [blame] | 159 | |
Mike Kruskal | 0efb02e | 2022-10-10 14:46:14 -0700 | [diff] [blame] | 160 | load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 161 | |
Mike Kruskal | 0efb02e | 2022-10-10 14:46:14 -0700 | [diff] [blame] | 162 | utf8_range_deps() |
| 163 | |
Mike Kruskal | 8dc14f6 | 2023-02-03 16:36:30 -0800 | [diff] [blame] | 164 | http_archive( |
| 165 | name = "rules_fuzzing", |
| 166 | sha256 = "d9002dd3cd6437017f08593124fdd1b13b3473c7b929ceb0e60d317cb9346118", |
| 167 | strip_prefix = "rules_fuzzing-0.3.2", |
| 168 | urls = ["https://github.com/bazelbuild/rules_fuzzing/archive/v0.3.2.zip"], |
| 169 | ) |
| 170 | |
| 171 | load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 172 | |
Mike Kruskal | 8dc14f6 | 2023-02-03 16:36:30 -0800 | [diff] [blame] | 173 | rules_fuzzing_dependencies() |
| 174 | |
Mike Kruskal | ed5c57a | 2022-08-10 22:51:29 -0700 | [diff] [blame] | 175 | bind( |
| 176 | name = "python_headers", |
Mike Kruskal | 3bc5049 | 2022-12-01 13:34:12 -0800 | [diff] [blame] | 177 | actual = "@system_python//:python_headers", |
Mike Kruskal | ed5c57a | 2022-08-10 22:51:29 -0700 | [diff] [blame] | 178 | ) |
Protobuf Team Bot | 89d6b74 | 2023-02-08 09:05:07 -0800 | [diff] [blame] | 179 | |
| 180 | http_archive( |
| 181 | name = "rules_rust", |
Krasimir Georgiev | 5eecee2 | 2023-10-20 09:35:03 -0700 | [diff] [blame] | 182 | sha256 = "9ecd0f2144f0a24e6bc71ebcc50a1ee5128cedeceb32187004532c9710cb2334", |
| 183 | urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.29.1/rules_rust-v0.29.1.tar.gz"], |
Protobuf Team Bot | 89d6b74 | 2023-02-08 09:05:07 -0800 | [diff] [blame] | 184 | ) |
| 185 | |
| 186 | load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains") |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 187 | |
Protobuf Team Bot | 89d6b74 | 2023-02-08 09:05:07 -0800 | [diff] [blame] | 188 | rules_rust_dependencies() |
Jason Lunn | 456dec4 | 2023-07-12 15:16:41 -0700 | [diff] [blame] | 189 | |
Marcel Hlopko | 3dc546d | 2023-03-06 14:09:46 -0800 | [diff] [blame] | 190 | rust_register_toolchains(edition = "2021") |
Hong Shin | 5e2f4fa | 2023-10-16 10:53:16 -0700 | [diff] [blame] | 191 | load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository") |
| 192 | # to repin, invoke `CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index` |
| 193 | crates_repository( |
| 194 | name = "crate_index", |
| 195 | cargo_lockfile = "//:Cargo.lock", |
| 196 | lockfile = "//:Cargo.bazel.lock", |
| 197 | packages = { |
| 198 | "googletest": crate.spec( |
| 199 | version = ">0.0.0", |
| 200 | ), |
Protobuf Team Bot | e1bb7d6 | 2023-10-17 14:15:37 -0700 | [diff] [blame] | 201 | "paste": crate.spec( |
| 202 | version = ">=1", |
| 203 | ), |
Hong Shin | 5e2f4fa | 2023-10-16 10:53:16 -0700 | [diff] [blame] | 204 | }, |
| 205 | ) |
| 206 | |
| 207 | load("@crate_index//:defs.bzl", "crate_repositories") |
| 208 | crate_repositories() |