blob: cc112294a9941f65ec8e4d21bd469ab63dba2afc [file] [log] [blame]
Jakob Buchgraber699c0eb2017-09-05 17:15:10 +02001workspace(name = "com_google_protobuf")
Cody Schroeder802d5432018-12-11 11:58:26 -08002
Protobuf Team Botda7245c2023-11-02 13:53:44 -07003# 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
6local_repository(name = "com_google_protobuf", path = ".")
7
Yannic2e51ad62020-03-03 00:15:22 +01008load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
9
Yannic Bonenbergerbf0c69e2019-07-26 13:14:19 +020010local_repository(
11 name = "com_google_protobuf_examples",
12 path = "examples",
13)
14
Deanna Garcia99529a22023-05-02 11:18:25 -070015# Load common dependencies first to ensure we use the correct version
16load("//:protobuf_deps.bzl", "PROTOBUF_MAVEN_ARTIFACTS", "protobuf_deps")
Jason Lunn456dec42023-07-12 15:16:41 -070017
Deanna Garcia99529a22023-05-02 11:18:25 -070018protobuf_deps()
19
Adam Cozzettef2476302023-11-06 16:10:42 -080020load("@rules_python//python:repositories.bzl", "py_repositories")
21
22py_repositories()
23
Mike Kruskal2eea38e2022-08-22 14:39:03 -070024# Bazel platform rules.
25http_archive(
26 name = "platforms",
Keith Smiley6f980072023-08-30 08:23:00 -070027 urls = [
28 "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
29 "https://github.com/bazelbuild/platforms/releases/download/0.0.7/platforms-0.0.7.tar.gz",
30 ],
31 sha256 = "3a561c99e7bdbe9173aa653fd579fe849f1d8d67395780ab4770b1f381431d51",
Mike Kruskal2eea38e2022-08-22 14:39:03 -070032)
33
Deanna Garcia244b2452023-03-16 13:50:11 -070034http_archive(
35 name = "com_google_googletest",
36 sha256 = "730215d76eace9dd49bf74ce044e8daa065d175f1ac891cc1d6bb184ef94e565",
37 strip_prefix = "googletest-f53219cdcb7b084ef57414efea92ee5b71989558",
38 urls = [
39 "https://github.com/google/googletest/archive/f53219cdcb7b084ef57414efea92ee5b71989558.tar.gz" # 2023-03-16
40 ],
41)
42
43load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps")
44
45googletest_deps()
46
deannagarcia5b27b4f2023-01-19 15:10:20 -080047load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
48
49rules_jvm_external_deps()
50
51load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
52
53rules_jvm_external_setup()
54
Derek Perezbc45f922021-04-20 11:36:32 -070055load("@rules_jvm_external//:defs.bzl", "maven_install")
Adam Cozzette454f0cc2021-10-12 15:37:40 -070056
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070057maven_install(
58 artifacts = PROTOBUF_MAVEN_ARTIFACTS,
59 # For updating instructions, see:
60 # https://github.com/bazelbuild/rules_jvm_external#updating-maven_installjson
61 maven_install_json = "//:maven_install.json",
Derek Perezbc45f922021-04-20 11:36:32 -070062 repositories = [
Jingwen Chen51d98762019-12-02 12:35:00 -050063 "https://repo1.maven.org/maven2",
Derek Perez87d140f2021-04-22 12:12:41 -070064 "https://repo.maven.apache.org/maven2",
Jingwen Chen51d98762019-12-02 12:35:00 -050065 ],
Steven Parkesa9244ca2016-03-10 17:50:25 -080066)
67
Derek Perezdb8f7252021-04-21 16:26:05 -070068load("@maven//:defs.bzl", "pinned_maven_install")
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070069
Derek Perezdb8f7252021-04-21 16:26:05 -070070pinned_maven_install()
71
Derek Perez61689222021-04-21 18:05:18 -070072# For `cc_proto_blacklist_test` and `build_test`.
Yannic948740b2020-01-15 19:27:35 +010073load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070074
Yannic948740b2020-01-15 19:27:35 +010075bazel_skylib_workspace()
Derek Perez3a4d9312021-11-04 22:57:29 +000076
77load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
Jason Lunn456dec42023-07-12 15:16:41 -070078
Derek Perez3a4d9312021-11-04 22:57:29 +000079rules_pkg_dependencies()
Deanna Garciadfd99e72022-01-12 21:54:30 +000080
Mike Kruskal633e8f72023-01-03 12:11:31 -080081load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
Jason Lunn456dec42023-07-12 15:16:41 -070082
Mike Kruskal633e8f72023-01-03 12:11:31 -080083apple_rules_dependencies()
84
Deanna Garciadfd99e72022-01-12 21:54:30 +000085# For `kt_jvm_library`
Deanna Garciadfd99e72022-01-12 21:54:30 +000086load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
Jason Lunn456dec42023-07-12 15:16:41 -070087
Deanna Garciadfd99e72022-01-12 21:54:30 +000088kotlin_repositories()
89
90load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
Jason Lunn456dec42023-07-12 15:16:41 -070091
Deanna Garciadfd99e72022-01-12 21:54:30 +000092kt_register_toolchains()
Joshua Habermana6901f02022-04-25 22:00:57 +000093
Mike Kruskal633e8f72023-01-03 12:11:31 -080094load("@rules_ruby//ruby:defs.bzl", "ruby_runtime")
Jason Lunn456dec42023-07-12 15:16:41 -070095
Mike Kruskal633e8f72023-01-03 12:11:31 -080096ruby_runtime("system_ruby")
Jason Lunn456dec42023-07-12 15:16:41 -070097
Mike Kruskal633e8f72023-01-03 12:11:31 -080098register_toolchains("@system_ruby//:toolchain")
99
Jason Lunn456dec42023-07-12 15:16:41 -0700100# Uncomment pairs of ruby_runtime() + register_toolchain() calls below to enable
101# local JRuby testing. Do not submit the changes (due to impact on test duration
102# for non JRuby builds due to downloading JRuby SDKs).
103#ruby_runtime("jruby-9.2")
104#
105#register_toolchains("@jruby-9.2//:toolchain")
106#
107#ruby_runtime("jruby-9.3")
108#
109#register_toolchains("@jruby-9.3//:toolchain")
110
Mike Kruskal633e8f72023-01-03 12:11:31 -0800111load("@system_ruby//:bundle.bzl", "ruby_bundle")
Jason Lunn456dec42023-07-12 15:16:41 -0700112
Mike Kruskal633e8f72023-01-03 12:11:31 -0800113ruby_bundle(
114 name = "protobuf_bundle",
115 srcs = ["//ruby:google-protobuf.gemspec"],
116 gemfile = "//ruby:Gemfile",
117)
118
Adam Cozzette6841d112023-08-11 11:45:54 -0700119http_archive(
120 name = "lua",
Adam Cozzette501ecec2023-09-26 14:36:20 -0700121 build_file = "//bazel:lua.BUILD",
Adam Cozzette6841d112023-08-11 11:45:54 -0700122 sha256 = "b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b",
123 strip_prefix = "lua-5.2.4",
124 urls = [
125 "https://mirror.bazel.build/www.lua.org/ftp/lua-5.2.4.tar.gz",
126 "https://www.lua.org/ftp/lua-5.2.4.tar.gz",
127 ],
128)
129
130http_archive(
131 name = "com_github_google_benchmark",
132 urls = ["https://github.com/google/benchmark/archive/0baacde3618ca617da95375e0af13ce1baadea47.zip"],
133 strip_prefix = "benchmark-0baacde3618ca617da95375e0af13ce1baadea47",
134 sha256 = "62e2f2e6d8a744d67e4bbc212fcfd06647080de4253c97ad5c6749e09faf2cb0",
135)
136
137http_archive(
138 name = "com_google_googleapis",
139 urls = ["https://github.com/googleapis/googleapis/archive/30ed2662a85403cbdeb9ea38df1e414a2a276b83.zip"],
140 strip_prefix = "googleapis-30ed2662a85403cbdeb9ea38df1e414a2a276b83",
141 sha256 = "4dfc28101127d22abd6f0f6308d915d490c4594c0cfcf7643769c446d6763a46",
Adam Cozzette501ecec2023-09-26 14:36:20 -0700142 build_file = "//benchmarks:BUILD.googleapis",
Adam Cozzette6841d112023-08-11 11:45:54 -0700143 patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
144)
145
Adam Cozzette501ecec2023-09-26 14:36:20 -0700146load("//bazel:system_python.bzl", "system_python")
Jason Lunn456dec42023-07-12 15:16:41 -0700147
Mike Kruskal3bc50492022-12-01 13:34:12 -0800148system_python(
149 name = "system_python",
150 minimum_python_version = "3.7",
151)
152
153load("@system_python//:pip.bzl", "pip_parse")
Jason Lunn456dec42023-07-12 15:16:41 -0700154
Mike Kruskal3bc50492022-12-01 13:34:12 -0800155pip_parse(
Jason Lunn456dec42023-07-12 15:16:41 -0700156 name = "pip_deps",
Adam Cozzette501ecec2023-09-26 14:36:20 -0700157 requirements = "//python:requirements.txt",
Mike Kruskal3bc50492022-12-01 13:34:12 -0800158)
159
160load("@pip_deps//:requirements.bzl", "install_deps")
Jason Lunn456dec42023-07-12 15:16:41 -0700161
Mike Kruskal3bc50492022-12-01 13:34:12 -0800162install_deps()
Mike Kruskaled5c57a2022-08-10 22:51:29 -0700163
Mike Kruskal8dc14f62023-02-03 16:36:30 -0800164http_archive(
165 name = "rules_fuzzing",
Adam Cozzettef2476302023-11-06 16:10:42 -0800166 sha256 = "ff52ef4845ab00e95d29c02a9e32e9eff4e0a4c9c8a6bcf8407a2f19eb3f9190",
167 strip_prefix = "rules_fuzzing-0.4.1",
168 urls = ["https://github.com/bazelbuild/rules_fuzzing/releases/download/v0.4.1/rules_fuzzing-0.4.1.zip"],
169 patches = ["//third_party:rules_fuzzing.patch"],
170 patch_args = ["-p1"],
Mike Kruskal8dc14f62023-02-03 16:36:30 -0800171)
172
173load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
Jason Lunn456dec42023-07-12 15:16:41 -0700174
Mike Kruskal8dc14f62023-02-03 16:36:30 -0800175rules_fuzzing_dependencies()
176
Adam Cozzettef2476302023-11-06 16:10:42 -0800177load("@rules_fuzzing//fuzzing:init.bzl", "rules_fuzzing_init")
178
179rules_fuzzing_init()
180
181load("@fuzzing_py_deps//:requirements.bzl", fuzzing_py_deps_install_deps = "install_deps")
182
183fuzzing_py_deps_install_deps()
184
Mike Kruskaled5c57a2022-08-10 22:51:29 -0700185bind(
186 name = "python_headers",
Mike Kruskal3bc50492022-12-01 13:34:12 -0800187 actual = "@system_python//:python_headers",
Mike Kruskaled5c57a2022-08-10 22:51:29 -0700188)
Protobuf Team Bot89d6b742023-02-08 09:05:07 -0800189
190http_archive(
191 name = "rules_rust",
Krasimir Georgiev5eecee22023-10-20 09:35:03 -0700192 sha256 = "9ecd0f2144f0a24e6bc71ebcc50a1ee5128cedeceb32187004532c9710cb2334",
193 urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.29.1/rules_rust-v0.29.1.tar.gz"],
Protobuf Team Bot89d6b742023-02-08 09:05:07 -0800194)
195
196load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
Jason Lunn456dec42023-07-12 15:16:41 -0700197
Protobuf Team Bot89d6b742023-02-08 09:05:07 -0800198rules_rust_dependencies()
Jason Lunn456dec42023-07-12 15:16:41 -0700199
Marcel Hlopko3dc546d2023-03-06 14:09:46 -0800200rust_register_toolchains(edition = "2021")
Hong Shin5e2f4fa2023-10-16 10:53:16 -0700201load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
202# to repin, invoke `CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index`
203crates_repository(
204 name = "crate_index",
205 cargo_lockfile = "//:Cargo.lock",
206 lockfile = "//:Cargo.bazel.lock",
207 packages = {
208 "googletest": crate.spec(
209 version = ">0.0.0",
210 ),
Protobuf Team Bote1bb7d62023-10-17 14:15:37 -0700211 "paste": crate.spec(
212 version = ">=1",
213 ),
Hong Shin5e2f4fa2023-10-16 10:53:16 -0700214 },
215)
216
217load("@crate_index//:defs.bzl", "crate_repositories")
218crate_repositories()