blob: 487c9334fc64a7145f2d7e837408fba6c6f9d54b [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
Mike Kruskal2eea38e2022-08-22 14:39:03 -070020# Bazel platform rules.
21http_archive(
22 name = "platforms",
Keith Smiley6f980072023-08-30 08:23:00 -070023 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 Kruskal2eea38e2022-08-22 14:39:03 -070028)
29
Deanna Garcia244b2452023-03-16 13:50:11 -070030http_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
39load("@com_google_googletest//:googletest_deps.bzl", "googletest_deps")
40
41googletest_deps()
42
deannagarcia5b27b4f2023-01-19 15:10:20 -080043load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
44
45rules_jvm_external_deps()
46
47load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup")
48
49rules_jvm_external_setup()
50
Derek Perezbc45f922021-04-20 11:36:32 -070051load("@rules_jvm_external//:defs.bzl", "maven_install")
Adam Cozzette454f0cc2021-10-12 15:37:40 -070052
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070053maven_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 Perezbc45f922021-04-20 11:36:32 -070058 repositories = [
Jingwen Chen51d98762019-12-02 12:35:00 -050059 "https://repo1.maven.org/maven2",
Derek Perez87d140f2021-04-22 12:12:41 -070060 "https://repo.maven.apache.org/maven2",
Jingwen Chen51d98762019-12-02 12:35:00 -050061 ],
Steven Parkesa9244ca2016-03-10 17:50:25 -080062)
63
Derek Perezdb8f7252021-04-21 16:26:05 -070064load("@maven//:defs.bzl", "pinned_maven_install")
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070065
Derek Perezdb8f7252021-04-21 16:26:05 -070066pinned_maven_install()
67
Derek Perez61689222021-04-21 18:05:18 -070068# For `cc_proto_blacklist_test` and `build_test`.
Yannic948740b2020-01-15 19:27:35 +010069load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
Adam Cozzettec7dfd0d2021-10-28 10:34:54 -070070
Yannic948740b2020-01-15 19:27:35 +010071bazel_skylib_workspace()
Derek Perez3a4d9312021-11-04 22:57:29 +000072
73load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
Jason Lunn456dec42023-07-12 15:16:41 -070074
Derek Perez3a4d9312021-11-04 22:57:29 +000075rules_pkg_dependencies()
Deanna Garciadfd99e72022-01-12 21:54:30 +000076
Mike Kruskal633e8f72023-01-03 12:11:31 -080077load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
Jason Lunn456dec42023-07-12 15:16:41 -070078
Mike Kruskal633e8f72023-01-03 12:11:31 -080079apple_rules_dependencies()
80
Deanna Garciadfd99e72022-01-12 21:54:30 +000081# For `kt_jvm_library`
Deanna Garciadfd99e72022-01-12 21:54:30 +000082load("@io_bazel_rules_kotlin//kotlin:repositories.bzl", "kotlin_repositories")
Jason Lunn456dec42023-07-12 15:16:41 -070083
Deanna Garciadfd99e72022-01-12 21:54:30 +000084kotlin_repositories()
85
86load("@io_bazel_rules_kotlin//kotlin:core.bzl", "kt_register_toolchains")
Jason Lunn456dec42023-07-12 15:16:41 -070087
Deanna Garciadfd99e72022-01-12 21:54:30 +000088kt_register_toolchains()
Joshua Habermana6901f02022-04-25 22:00:57 +000089
Mike Kruskal633e8f72023-01-03 12:11:31 -080090load("@rules_ruby//ruby:defs.bzl", "ruby_runtime")
Jason Lunn456dec42023-07-12 15:16:41 -070091
Mike Kruskal633e8f72023-01-03 12:11:31 -080092ruby_runtime("system_ruby")
Jason Lunn456dec42023-07-12 15:16:41 -070093
Mike Kruskal633e8f72023-01-03 12:11:31 -080094register_toolchains("@system_ruby//:toolchain")
95
Jason Lunn456dec42023-07-12 15:16:41 -070096# 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 Kruskal633e8f72023-01-03 12:11:31 -0800107load("@system_ruby//:bundle.bzl", "ruby_bundle")
Jason Lunn456dec42023-07-12 15:16:41 -0700108
Mike Kruskal633e8f72023-01-03 12:11:31 -0800109ruby_bundle(
110 name = "protobuf_bundle",
111 srcs = ["//ruby:google-protobuf.gemspec"],
112 gemfile = "//ruby:Gemfile",
113)
114
Adam Cozzette6841d112023-08-11 11:45:54 -0700115http_archive(
116 name = "lua",
Adam Cozzette501ecec2023-09-26 14:36:20 -0700117 build_file = "//bazel:lua.BUILD",
Adam Cozzette6841d112023-08-11 11:45:54 -0700118 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
126http_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
133http_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 Cozzette501ecec2023-09-26 14:36:20 -0700138 build_file = "//benchmarks:BUILD.googleapis",
Adam Cozzette6841d112023-08-11 11:45:54 -0700139 patch_cmds = ["find google -type f -name BUILD.bazel -delete"],
140)
141
Adam Cozzette501ecec2023-09-26 14:36:20 -0700142load("//bazel:system_python.bzl", "system_python")
Jason Lunn456dec42023-07-12 15:16:41 -0700143
Mike Kruskal3bc50492022-12-01 13:34:12 -0800144system_python(
145 name = "system_python",
146 minimum_python_version = "3.7",
147)
148
149load("@system_python//:pip.bzl", "pip_parse")
Jason Lunn456dec42023-07-12 15:16:41 -0700150
Mike Kruskal3bc50492022-12-01 13:34:12 -0800151pip_parse(
Jason Lunn456dec42023-07-12 15:16:41 -0700152 name = "pip_deps",
Adam Cozzette501ecec2023-09-26 14:36:20 -0700153 requirements = "//python:requirements.txt",
Mike Kruskal3bc50492022-12-01 13:34:12 -0800154)
155
156load("@pip_deps//:requirements.bzl", "install_deps")
Jason Lunn456dec42023-07-12 15:16:41 -0700157
Mike Kruskal3bc50492022-12-01 13:34:12 -0800158install_deps()
Mike Kruskaled5c57a2022-08-10 22:51:29 -0700159
Mike Kruskal0efb02e2022-10-10 14:46:14 -0700160load("@utf8_range//:workspace_deps.bzl", "utf8_range_deps")
Jason Lunn456dec42023-07-12 15:16:41 -0700161
Mike Kruskal0efb02e2022-10-10 14:46:14 -0700162utf8_range_deps()
163
Mike Kruskal8dc14f62023-02-03 16:36:30 -0800164http_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
171load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies")
Jason Lunn456dec42023-07-12 15:16:41 -0700172
Mike Kruskal8dc14f62023-02-03 16:36:30 -0800173rules_fuzzing_dependencies()
174
Mike Kruskaled5c57a2022-08-10 22:51:29 -0700175bind(
176 name = "python_headers",
Mike Kruskal3bc50492022-12-01 13:34:12 -0800177 actual = "@system_python//:python_headers",
Mike Kruskaled5c57a2022-08-10 22:51:29 -0700178)
Protobuf Team Bot89d6b742023-02-08 09:05:07 -0800179
180http_archive(
181 name = "rules_rust",
Krasimir Georgiev5eecee22023-10-20 09:35:03 -0700182 sha256 = "9ecd0f2144f0a24e6bc71ebcc50a1ee5128cedeceb32187004532c9710cb2334",
183 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 -0800184)
185
186load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
Jason Lunn456dec42023-07-12 15:16:41 -0700187
Protobuf Team Bot89d6b742023-02-08 09:05:07 -0800188rules_rust_dependencies()
Jason Lunn456dec42023-07-12 15:16:41 -0700189
Marcel Hlopko3dc546d2023-03-06 14:09:46 -0800190rust_register_toolchains(edition = "2021")
Hong Shin5e2f4fa2023-10-16 10:53:16 -0700191load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
192# to repin, invoke `CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index`
193crates_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 Bote1bb7d62023-10-17 14:15:37 -0700201 "paste": crate.spec(
202 version = ">=1",
203 ),
Hong Shin5e2f4fa2023-10-16 10:53:16 -0700204 },
205)
206
207load("@crate_index//:defs.bzl", "crate_repositories")
208crate_repositories()