blob: 9370030068c77aa687ff00d88d4f8448eef2cdab [file] [log] [blame]
Sergiusz Bazanski5f9b1ec2019-09-22 02:19:18 +02001workspace(
2 name = "hscloud",
3)
4
Sergiusz Bazanskide061802019-01-13 21:14:02 +01005load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
Serge Bazanski146c99e2021-03-18 19:15:38 +00006load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
Sergiusz Bazanskide061802019-01-13 21:14:02 +01007
Bartosz Stebelcae27ec2020-07-03 07:05:15 +02008# Protobuf deps (shared between many rules).
9# Load this as early as possible, to avoid a different version being pulled in by deps of something else
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020010http_archive(
11 name = "com_google_protobuf",
12 sha256 = "bb8ce9ba11eb7bccf080599fe7cad9cc461751c8dd1ba61701c0070d58cde973",
13 strip_prefix = "protobuf-3.12.2",
14 urls = ["https://github.com/google/protobuf/archive/v3.12.2.tar.gz"],
15)
16
17load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
Serge Bazanski1572e522020-12-03 23:19:28 +010018
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020019protobuf_deps()
20
Serge Bazanski194b1c82020-09-25 20:24:17 +000021# Force rules_python at a bleeding edge version (for pip3_import).
22http_archive(
23 name = "rules_python",
24 url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.3/rules_python-0.0.3.tar.gz",
25 sha256 = "e46612e9bb0dae8745de6a0643be69e8665a03f63163ac6610c210e80d14c3e4",
26)
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020027
Serge Bazanski194b1c82020-09-25 20:24:17 +000028# Download Go/Gazelle rules
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020029http_archive(
30 name = "io_bazel_rules_go",
Serge Bazanski42b21ec2020-11-27 10:22:15 +010031 sha256 = "207fad3e6689135c5d8713e5a17ba9d1290238f47b9ba545b63d9303406209c6",
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020032 urls = [
Serge Bazanski42b21ec2020-11-27 10:22:15 +010033 "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz",
34 "https://github.com/bazelbuild/rules_go/releases/download/v0.24.7/rules_go-v0.24.7.tar.gz",
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020035 ],
36)
Serge Bazanski1572e522020-12-03 23:19:28 +010037
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020038http_archive(
39 name = "bazel_gazelle",
40 sha256 = "bfd86b3cbe855d6c16c6fce60d76bd51f5c8dbc9cfcaef7a2bb5c1aafd0710e8",
41 urls = [
42 "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz",
43 "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz",
44 ],
45)
46
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020047# Python rules
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020048# Important: rules_python must be loaded before protobuf (and grpc) because they load an older version otherwise
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020049load("@rules_python//python:repositories.bzl", "py_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +010050
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020051py_repositories()
52
53load("@rules_python//python:pip.bzl", "pip_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +010054
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020055pip_repositories()
56
Serge Bazanski4b613302021-02-13 13:16:10 +010057load("@rules_python//python:pip.bzl", "pip3_import")
Serge Bazanski1572e522020-12-03 23:19:28 +010058
Serge Bazanski4b613302021-02-13 13:16:10 +010059pip3_import(
Serge Bazanski1572e522020-12-03 23:19:28 +010060 name = "pydeps",
61 requirements = "//third_party/py:requirements.txt",
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020062)
63
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020064load("@pydeps//:requirements.bzl", "pip_install")
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +020065
Serge Bazanski1572e522020-12-03 23:19:28 +010066pip_install()
Serge Bazanski194b1c82020-09-25 20:24:17 +000067
68# Setup Go toolchain.
Serge Bazanski4b613302021-02-13 13:16:10 +010069load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains")
70go_register_toolchains()
Serge Bazanski194b1c82020-09-25 20:24:17 +000071
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020072# IMPORTANT: match protobuf version above with the one loaded by grpc
73http_archive(
74 name = "com_github_grpc_grpc",
75 sha256 = "419dba362eaf8f1d36849ceee17c3e2ff8ff12ac666b42d3ff02a164ebe090e9",
76 strip_prefix = "grpc-1.30.0",
77 urls = ["https://github.com/grpc/grpc/archive/v1.30.0.tar.gz"],
78)
79
Serge Bazanski194b1c82020-09-25 20:24:17 +000080# Load grpc deps after Go, to prevent overriding Go toolchains/SDK.
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020081load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
Serge Bazanski1572e522020-12-03 23:19:28 +010082
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020083grpc_deps()
Serge Bazanski1572e522020-12-03 23:19:28 +010084
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020085load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
Serge Bazanski1572e522020-12-03 23:19:28 +010086
Bartosz Stebelcae27ec2020-07-03 07:05:15 +020087grpc_extra_deps()
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +020088
Serge Bazanski194b1c82020-09-25 20:24:17 +000089load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies")
Serge Bazanski1572e522020-12-03 23:19:28 +010090
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020091go_rules_dependencies()
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020092
Serge Bazanski1e1a4dd2020-08-01 14:07:27 +020093# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
Serge Bazanski1572e522020-12-03 23:19:28 +010094load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
95
Patryk Jakuszew30f9d032020-06-05 23:37:34 +020096gazelle_dependencies()
97
Serge Bazanski194b1c82020-09-25 20:24:17 +000098# Load Go third-party packages.
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +020099load("//third_party/go:repositories.bzl", "go_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +0100100
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +0200101go_repositories()
102
Serge Bazanski2ce36762019-07-14 16:29:52 +0200103# Docker rules
104
105http_archive(
106 name = "io_bazel_rules_docker",
Norbert Szulca6e1b8d2021-05-12 14:17:31 +0200107 sha256 = "59d5b42ac315e7eadffa944e86e90c2990110a1c8075f1cd145f487e999d22b3",
108 strip_prefix = "rules_docker-0.17.0",
109 urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.17.0/rules_docker-v0.17.0.tar.gz"],
Serge Bazanski2ce36762019-07-14 16:29:52 +0200110)
111
Sergiusz Bazanski356ea8b2019-07-21 23:56:43 +0200112load("@io_bazel_rules_docker//toolchains/docker:toolchain.bzl", docker_toolchain_configure = "toolchain_configure")
113
114# This forces the use of Docker $HOME/.docker configuration.
115docker_toolchain_configure(
116 name = "docker_config",
117 client_config = "",
Serge Bazanskib2d6b112019-07-30 13:07:04 +0200118 docker_path = "/usr/bin/docker",
Sergiusz Bazanski356ea8b2019-07-21 23:56:43 +0200119)
120
Serge Bazanski2ce36762019-07-14 16:29:52 +0200121load(
122 "@io_bazel_rules_docker//repositories:repositories.bzl",
123 container_repositories = "repositories",
124)
Serge Bazanski1572e522020-12-03 23:19:28 +0100125
Serge Bazanski2ce36762019-07-14 16:29:52 +0200126container_repositories()
Sergiusz Bazanski8fe651b2019-07-21 23:50:05 +0200127
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200128# Docker base images
129
130load("@io_bazel_rules_docker//container:container.bzl", "container_pull")
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200131
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200132container_pull(
133 name = "prodimage-bionic",
Serge Bazanskib2d6b112019-07-30 13:07:04 +0200134 registry = "registry.k0.hswaw.net",
135 repository = "q3k/prodimage",
Serge Bazanskiec71cb52019-08-22 18:13:13 +0200136 tag = "20190822-1227",
137 digest = "sha256:1cd1f84169b8e1414a5d511b42909f2d540831c67b6799ae9af8cd6a80d75b5f",
Sergiusz Bazanski65865332019-05-18 16:23:45 +0200138)
139
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200140container_pull(
Serge Bazanskidd692212021-03-11 17:51:02 +0100141 name = "gerrit-3.3.2",
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200142 registry = "index.docker.io",
143 repository = "gerritcodereview/gerrit",
Serge Bazanskidd692212021-03-11 17:51:02 +0100144 tag = "3.3.2-ubuntu20",
145 digest = "sha256:f7fc8b749706f38475f94191117091973914a8f084e69518deff7dbc9c2c557d",
Sergiusz Bazanskia7e26cc2019-06-21 20:38:35 +0200146)
147
Sergiusz Bazanski48050572020-05-10 21:34:10 +0200148# third_party/factorio
149load("//third_party/factorio:factorio.bzl", "factorio_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +0100150
Sergiusz Bazanski48050572020-05-10 21:34:10 +0200151factorio_repositories()
Sergiusz Bazanski59786c52020-04-01 02:05:42 +0200152
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200153# For devtools/gerrit/gerrit-oauth-provider and gerrit OWNERS plugin
Sergiusz Bazanski573da782019-06-21 19:59:52 +0200154
155git_repository(
156 name = "com_googlesource_gerrit_bazlets",
157 remote = "https://gerrit.googlesource.com/bazlets",
Serge Bazanskifaa326a2020-12-17 23:32:42 +0100158 commit = "a511f3c90129d7de7ae67c0637001162980c08d5",
Bartosz Stebel0e2057f2020-12-28 21:40:09 +0100159 shallow_since = "1606931369 -0600",
Sergiusz Bazanski573da782019-06-21 19:59:52 +0200160)
161
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +0200162load("@com_googlesource_gerrit_bazlets//:gerrit_api.bzl", "gerrit_api")
Serge Bazanski1572e522020-12-03 23:19:28 +0100163
Sergiusz Bazanski573da782019-06-21 19:59:52 +0200164gerrit_api()
165
Serge Bazanskifaa326a2020-12-17 23:32:42 +0100166load("//devtools/gerrit/gerrit-oauth-provider:external_plugin_deps.bzl", gerrit_oauth_deps="external_plugin_deps")
167gerrit_oauth_deps(omit_commons_codec=False)
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200168
Serge Bazanski146c99e2021-03-18 19:15:38 +0000169# Gerrit 3.3.2 built by q3k, backported with fix for 'empty reviewers column' bug.
170# See: https://bugs.chromium.org/p/gerrit/issues/detail?id=13899
171# Override can be removed once we update to > 3.3.2, as the fix for this is
172# pending for the 3.3 branch.
173#
174# Built from v3.3.2 tag at df0507df5917fd78af01aee2495b2663530d52d1
175# Cherry-picked fix from 8731af3ae785efe9ecff7f3d04302b6b01c4fc0b
176# Resulted in commit 5949bfb86e62a32a95293e339ed86bfe52a283e9
177# Built against Java 8:
178# bazel build --java_toolchain //tools:error_prone_warnings_toolchain :release
179#
180http_file(
181 name = "org_q3k_gerrit_3_3_2_backport",
182 urls = [
183 "https://object.ceph-waw3.hswaw.net/q3k-personal/d1839d691a8534f4ccb27bed9a98281e45972fbebec50d004cecd4d5da2b15a6.war",
184 ],
185 downloaded_file_path = "gerrit.war",
186 sha256 = "d1839d691a8534f4ccb27bed9a98281e45972fbebec50d004cecd4d5da2b15a6",
187)
188
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200189# minecraft spigot/bukkit deps
190# this uses rules_jvm_external vs gerrit's maven_jar because we need SNAPSHOT support
191
192http_archive(
193 name = "io_grpc_grpc_java",
194 sha256 = "446ad7a2e85bbd05406dbf95232c7c49ed90de83b3b60cb2048b0c4c9f254d29",
195 strip_prefix = "grpc-java-1.29.0",
196 url = "https://github.com/grpc/grpc-java/archive/v1.29.0.zip",
197)
198
199RULES_JVM_EXTERNAL_TAG = "3.0"
Serge Bazanski1572e522020-12-03 23:19:28 +0100200
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200201RULES_JVM_EXTERNAL_SHA = "62133c125bf4109dfd9d2af64830208356ce4ef8b165a6ef15bbff7460b35c3a"
202
203http_archive(
204 name = "rules_jvm_external",
205 strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG,
206 sha256 = RULES_JVM_EXTERNAL_SHA,
207 url = "https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip" % RULES_JVM_EXTERNAL_TAG,
208)
209
210load("@rules_jvm_external//:defs.bzl", "maven_install")
211load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS")
212load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS")
213
214maven_install(
215 artifacts = [
Serge Bazanski55cc9ab2021-02-15 22:09:17 +0100216 "org.spigotmc:spigot-api:1.15.2-R0.1-20200624.001023-124",
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200217 "io.grpc:grpc-netty-shaded:1.29.0",
218 "io.grpc:grpc-services:1.29.0",
Serge Bazanski1572e522020-12-03 23:19:28 +0100219 ] + IO_GRPC_GRPC_JAVA_ARTIFACTS,
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200220 generate_compat_repositories = True,
221 override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
222 repositories = [
223 "https://hub.spigotmc.org/nexus/content/repositories/snapshots",
224 "https://oss.sonatype.org/content/repositories/snapshots",
225 "https://repo1.maven.org/maven2/",
226 ],
227 maven_install_json = "//third_party/java:maven_install.json",
228)
229
230load("@maven//:defs.bzl", "pinned_maven_install")
Serge Bazanski1572e522020-12-03 23:19:28 +0100231
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200232pinned_maven_install()
233
234load("@maven//:compat.bzl", "compat_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +0100235
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200236compat_repositories()
237
238load("@io_grpc_grpc_java//:repositories.bzl", "grpc_java_repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +0100239
Sergiusz Bazanski32f8a582020-05-18 00:27:23 +0200240grpc_java_repositories()
241
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200242# Gerrit OWNERS plugins external repositories
243
244git_repository(
245 name = "com_googlesource_gerrit_plugin_owners",
246 remote = "https://gerrit.googlesource.com/plugins/owners/",
Serge Bazanskifaa326a2020-12-17 23:32:42 +0100247 commit = "17817c9e319073c03513f9d5177b6142b8fd567b",
Bartosz Stebel0e2057f2020-12-28 21:40:09 +0100248 shallow_since = "1593642470 +0200",
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200249)
Serge Bazanskifaa326a2020-12-17 23:32:42 +0100250load("@com_googlesource_gerrit_plugin_owners//:external_plugin_deps_standalone.bzl", gerrit_owners_deps="external_plugin_deps_standalone")
251gerrit_owners_deps()
Sergiusz Bazanski222a00a2020-04-12 18:37:21 +0200252
Sergiusz Bazanski356ea8b2019-07-21 23:56:43 +0200253# Go image repos for Docker
254
Sergiusz Bazanski0c3b9a52020-06-21 01:26:22 +0200255load("@io_bazel_rules_docker//go:image.bzl", go_image_repositories = "repositories")
Serge Bazanski1572e522020-12-03 23:19:28 +0100256
Sergiusz Bazanski356ea8b2019-07-21 23:56:43 +0200257go_image_repositories()
Sergiusz Bazanski0037eda2020-06-13 22:43:06 +0200258
259# oniguruma, with build from //third_party/oniguruma
260
261http_archive(
262 name = "com_github_kkos_oniguruma",
263 urls = ["https://github.com/kkos/oniguruma/releases/download/v6.9.5_rev1/onig-6.9.5_rev1.tar.gz"],
264 strip_prefix = "onig-6.9.5",
265 sha256 = "d33c849d1672af227944878cefe0a8fcf26fc62bedba32aa517f2f63c314a99e",
266 build_file = "@hscloud//third_party/oniguruma:BUILD.external",
267)
268
269# jq, with build from //third_party/jq
270
271http_archive(
272 name = "com_github_stedolan_jq",
273 urls = ["https://github.com/stedolan/jq/releases/download/jq-1.6/jq-1.6.tar.gz"],
274 strip_prefix = "jq-1.6",
275 sha256 = "5de8c8e29aaa3fb9cc6b47bb27299f271354ebb72514e3accadc7d38b5bbaa72",
276 build_file = "@hscloud//third_party/jq:BUILD.external",
277)
Serge Bazanski1572e522020-12-03 23:19:28 +0100278
Serge Bazanski1f062302021-06-01 22:24:34 +0000279# leaflet.js from NPM, used by //hswaw/site.
280http_archive(
281 name = "com_npmjs_leaflet",
282 urls = ["https://registry.npmjs.org/leaflet/-/leaflet-1.7.1.tgz"],
283 sha256 = "43aca726165904ff73a34571c263b561cec94e6b9992a4414a600f3e984d1b03",
284 build_file_content = """
285filegroup(
286 name = "distfiles",
287 srcs = [
288 "package/dist/leaflet.js",
289 "package/dist/leaflet.css",
290 "package/dist/images/layers-2x.png",
291 "package/dist/images/layers.png",
292 "package/dist/images/marker-icon-2x.png",
293 "package/dist/images/marker-icon.png",
294 "package/dist/images/marker-shadow.png",
295 ],
296 visibility = ["//visibility:public"],
297)
298""",
299)
300
Serge Bazanski1572e522020-12-03 23:19:28 +0100301go_repository(
302 name = "com_github_gorilla_sessions",
303 importpath = "github.com/gorilla/sessions",
304 sum = "h1:DHd3rPN5lE3Ts3D8rKkQ8x/0kqfeNmBAaiSi+o7FsgI=",
305 version = "v1.2.1",
306)
307
308go_repository(
309 name = "com_github_boltdb_bolt",
310 importpath = "github.com/boltdb/bolt",
311 sum = "h1:JQmyP4ZBrce+ZQu0dY660FMfatumYDLun9hBCUVIkF4=",
312 version = "v1.3.1",
313)
314
315go_repository(
316 name = "com_github_gorilla_securecookie",
317 importpath = "github.com/gorilla/securecookie",
318 sum = "h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=",
319 version = "v1.1.1",
320)