blob: 6461fb2766742769c1b923d9050aea1797ebd97f [file] [log] [blame]
Serge Bazanski31370b02021-01-07 16:31:14 +01001workspace(name = "dev_source_monogon")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02002
Lorenz Brunc88c82d2020-05-08 14:35:04 +02003load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
Leopold Schabel5c80aca2019-10-22 15:48:58 +02004load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
5
6# Load skylib
7
8http_archive(
9 name = "bazel_skylib",
10 sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44",
11 urls = [
12 "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
13 "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz",
14 ],
15)
16
17load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
18
19bazel_skylib_workspace()
20
21# Assert minimum Bazel version
22
23load("@bazel_skylib//lib:versions.bzl", "versions")
24
Leopold Schabelaf5ec372020-03-11 13:33:17 +010025versions.check(minimum_bazel_version = "2.2.0")
Leopold Schabel5c80aca2019-10-22 15:48:58 +020026
27# Go and Gazelle
28
29load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
30
31http_archive(
32 name = "io_bazel_rules_go",
Lorenz Brunadb98f92022-07-04 14:09:41 +000033 patch_args = ["-p1"],
34 patches = [
Lorenz Brun073a1c52022-08-02 11:36:36 +000035 "//third_party/go/patches:rules_go_absolute_embedsrc.patch",
Lorenz Brunadb98f92022-07-04 14:09:41 +000036 ],
Lorenz Brun073a1c52022-08-02 11:36:36 +000037 sha256 = "685052b498b6ddfe562ca7a97736741d87916fe536623afb7da2824c0211c369",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020038 urls = [
Serge Bazanskifcc51152022-06-30 19:10:42 +020039 "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.33.0/rules_go-v0.33.0.zip",
40 "https://github.com/bazelbuild/rules_go/releases/download/v0.33.0/rules_go-v0.33.0.zip",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020041 ],
42)
43
44http_archive(
45 name = "bazel_gazelle",
Lorenz Brun2073ce32021-02-03 18:52:59 +010046 patch_args = ["-p1"],
Lorenz Brunefb028f2020-07-28 17:04:49 +020047 patches = [
48 "//third_party/gazelle:add-prepatching.patch",
49 ],
Lorenz Brund13c1c62022-03-30 19:58:58 +020050 sha256 = "5982e5463f171da99e3bdaeff8c0f48283a7a5f396ec5282910b9e8a49c0dd7e",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020051 urls = [
Lorenz Brund13c1c62022-03-30 19:58:58 +020052 "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
53 "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.25.0/bazel-gazelle-v0.25.0.tar.gz",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020054 ],
55)
56
57load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
Lorenz Brund13c1c62022-03-30 19:58:58 +020058load("//third_party/go:repositories.bzl", "go_repositories")
59
60# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
61go_repositories()
62
Leopold Schabel5c80aca2019-10-22 15:48:58 +020063go_rules_dependencies()
64
Leopold Schabel60a85b62019-11-17 19:12:41 +010065go_register_toolchains(
Serge Bazanskifcc51152022-06-30 19:10:42 +020066 go_version = "1.18.3",
Serge Bazanski0ef96292021-05-21 15:41:32 +020067 nogo = "@dev_source_monogon//build/analysis:nogo",
Leopold Schabel60a85b62019-11-17 19:12:41 +010068)
Leopold Schabel5c80aca2019-10-22 15:48:58 +020069
Lorenz Brunc2e3b1b2021-11-11 11:06:41 +010070load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
71
72# Load Gazelle-generated local dependencies
73gazelle_dependencies()
74
Leopold Schabel5c80aca2019-10-22 15:48:58 +020075# Protobuf
76
77http_archive(
78 name = "com_google_protobuf",
Serge Bazanskicbeb8a02021-08-24 15:17:04 +020079 sha256 = "c6003e1d2e7fefa78a3039f19f383b4f3a61e81be8c19356f85b6461998ad3db",
80 strip_prefix = "protobuf-3.17.3",
81 urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.17.3.tar.gz"],
Leopold Schabel5c80aca2019-10-22 15:48:58 +020082)
83
84load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
85
86protobuf_deps()
87
Serge Bazanskibb7db922020-04-30 12:43:10 +020088# Build packages
89http_archive(
90 name = "rules_pkg",
Lorenz Brun3ec81162021-11-09 03:37:03 +010091 sha256 = "a89e203d3cf264e564fcb96b6e06dd70bc0557356eb48400ce4b5d97c2c3720d",
92 urls = [
93 "https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
94 "https://github.com/bazelbuild/rules_pkg/releases/download/0.5.1/rules_pkg-0.5.1.tar.gz",
95 ],
Serge Bazanskibb7db922020-04-30 12:43:10 +020096)
97
Lorenz Brun3ec81162021-11-09 03:37:03 +010098load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
99
100rules_pkg_dependencies()
101
Serge Bazanskicbf1fa92021-07-02 17:28:50 +0200102# Rust rules
103http_archive(
104 name = "rules_rust",
105 sha256 = "6c6abf4100b3118467a9674e9dba5f4933aa97840f909823aacddffc2abe139b",
106 strip_prefix = "rules_rust-f4cbea56b8053436fbab625fc32254da212a0304",
107 urls = [
108 # Main branch as of 2021-07-01
109 "https://github.com/bazelbuild/rules_rust/archive/f4cbea56b8053436fbab625fc32254da212a0304.tar.gz",
110 ],
111)
112
113load("@rules_rust//rust:repositories.bzl", "rust_repositories")
114
115rust_repositories()
116
117load("//third_party/rust/cargo:crates.bzl", "raze_fetch_remote_crates")
118
119raze_fetch_remote_crates()
120
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100121# third_party external repositories
122load("//third_party/linux:external.bzl", "linux_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100123
124linux_external(
125 name = "linux",
Lorenz Brunfc2d0d82022-03-31 14:36:17 +0200126 version = "5.15.32",
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100127)
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200128
Lorenz Brun17c4c8b2022-02-01 12:59:47 +0100129load("//third_party/linux-firmware:external.bzl", "linux_firmware_external")
130
131linux_firmware_external(
132 name = "linux-firmware",
133 version = "20211216",
134)
135
Lorenz Brun80deba52022-02-24 17:07:13 +0100136load("//third_party/intel_ucode:external.bzl", "intel_ucode_external")
137
138intel_ucode_external(
139 name = "intel_ucode",
140 version = "20220207",
141)
142
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100143load("//third_party/edk2:external.bzl", "edk2_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100144
145edk2_external(name = "edk2")
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200146
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100147load("//third_party/musl:external.bzl", "musl_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100148
149musl_external(
150 name = "musl",
151 version = "1.1.24",
152)
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200153
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100154load("//third_party/util-linux:external.bzl", "util_linux_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100155
156util_linux_external(
157 name = "util_linux",
Lorenz Brunddd6caf2021-03-04 17:16:04 +0100158 version = "2.36.2",
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100159)
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200160
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100161load("//third_party/xfsprogs:external.bzl", "xfsprogs_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100162
163xfsprogs_external(
164 name = "xfsprogs",
Lorenz Brunddd6caf2021-03-04 17:16:04 +0100165 version = "5.10.0",
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100166)
Lorenz Brun6c39ea12019-11-04 11:39:42 +0100167
Lorenz Brun0de18932021-03-11 00:36:48 +0100168load("//third_party/pixman:external.bzl", "pixman_external")
169
170pixman_external(
171 name = "pixman",
172 version = "0.40.0",
173)
174
175load("//third_party/uring:external.bzl", "uring_external")
176
177uring_external(
178 name = "uring",
179 version = "2.0",
180)
181
182load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
183
184git_repository(
185 name = "gperf",
186 commit = "de9373c2d48a3edf29862eb8be44764a7f7d24c6",
Leopold Schabel57a9d3e2021-04-01 17:31:48 +0200187 remote = "https://github.com/monogon-dev/gperf.git",
Lorenz Brun0de18932021-03-11 00:36:48 +0100188 shallow_since = "1615306886 +0100",
189)
190
191load("//third_party/seccomp:external.bzl", "seccomp_external")
192
193seccomp_external(
194 name = "seccomp",
195 version = "2.5.1",
196)
197
198load("//third_party/glib:external.bzl", "glib_external")
199
200glib_external(
201 name = "glib",
202 version = "2.67.5",
203)
204
205load("//third_party/qemu:external.bzl", "qemu_external")
206
207qemu_external(
208 name = "qemu",
209 version = "5.2.0",
210)
211
Serge Bazanski8ff4b7c2021-08-17 19:21:18 +0200212load("//third_party/chrony:external.bzl", "chrony_external")
213
214chrony_external(
215 name = "chrony",
216)
217
Lorenz Brun40025ff2021-08-31 13:06:02 +0200218load("//third_party/cap:external.bzl", "cap_external")
219
220cap_external(
221 name = "cap",
222 version = "1.2.55",
223)
224
Lorenz Brun296bde22021-09-28 15:04:40 +0200225load("//third_party/gnuefi:external.bzl", "gnuefi_external")
226
227gnuefi_external(
228 name = "gnuefi",
229 version = "3.0.14",
230)
231
Lorenz Brun5d40c672021-09-28 15:06:37 +0200232load("//third_party/efistub:external.bzl", "efistub_external")
233
234efistub_external(
235 name = "efistub",
236 # Developed in the systemd monorepo, pinned to master as there have been a bunch of critical fixes for the
237 # EFI stub since 249.
238 version = "3542da2442d8b29661b47c42ad7e5fa9bc8562ec",
239)
240
Serge Bazanski46e72ab2022-09-05 15:13:22 +0200241load("//third_party/libpg_query:external.bzl", "libpg_query_external")
242libpg_query_external(
243 name = "libpg_query",
244 version = "13-2.1.2",
245)
246
Serge Bazanskibb7db922020-04-30 12:43:10 +0200247register_toolchains("//:host_python")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100248
Serge Bazanskibb7db922020-04-30 12:43:10 +0200249# same for gvisor/rules_docker.
250
251http_archive(
252 name = "io_bazel_rules_docker",
Serge Bazanski3536e4d2021-05-11 11:58:56 +0200253 sha256 = "59d5b42ac315e7eadffa944e86e90c2990110a1c8075f1cd145f487e999d22b3",
254 strip_prefix = "rules_docker-0.17.0",
255 urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.17.0/rules_docker-v0.17.0.tar.gz"],
Serge Bazanskibb7db922020-04-30 12:43:10 +0200256)
Lorenz Brunc88c82d2020-05-08 14:35:04 +0200257
Lorenz Brun8b0431a2020-07-13 16:56:36 +0200258load(
259 "@io_bazel_rules_docker//repositories:repositories.bzl",
260 container_repositories = "repositories",
261)
262
263container_repositories()
264
265load(
266 "@io_bazel_rules_docker//go:image.bzl",
267 go_image_repos = "repositories",
268)
269
270go_image_repos()
271
Lorenz Brunc88c82d2020-05-08 14:35:04 +0200272# Derived from Mozilla NSS, currently needed for containerd to be able to pull images
273http_file(
274 name = "cacerts",
275 sha256 = "adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f",
276 urls = ["https://curl.haxx.se/ca/cacert-2020-01-01.pem"],
277)
Serge Bazanski140bddc2020-06-05 21:01:19 +0200278
279# lz4, the library and the tool.
280http_archive(
281 name = "com_github_lz4_lz4",
282 patch_args = ["-p1"],
283 patches = ["//third_party/lz4:build.patch"],
284 sha256 = "658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc",
285 strip_prefix = "lz4-1.9.2",
286 urls = ["https://github.com/lz4/lz4/archive/v1.9.2.tar.gz"],
287)
Lorenz Brun2e30e882020-06-24 15:17:29 +0200288
Lorenz Brunddd6caf2021-03-04 17:16:04 +0100289# ini.h, a tiny ini parser library
290http_archive(
291 name = "inih",
292 build_file = "@//third_party/inih:inih.bzl",
293 sha256 = "01b0366fdfdf6363efc070c2f856f1afa33e7a6546548bada5456ad94a516241",
294 strip_prefix = "inih-r53",
295 urls = ["https://github.com/benhoyt/inih/archive/r53.tar.gz"],
296)
297
Lorenz Brun2e30e882020-06-24 15:17:29 +0200298# qboot bootloader for MicroVMs
299http_archive(
300 name = "com_github_bonzini_qboot",
301 build_file = "//third_party/qboot:qboot.bzl",
302 sha256 = "a643b2486fbee57b969659d408984094ca9afa1a048317dd3f5d3022e47213e8",
303 strip_prefix = "qboot-a5300c4949b8d4de2d34bedfaed66793f48ec948",
304 urls = ["https://github.com/bonzini/qboot/archive/a5300c4949b8d4de2d34bedfaed66793f48ec948.tar.gz"],
305)
Serge Bazanski9e861a82020-09-16 13:46:41 +0200306
Lorenz Brun073a1c52022-08-02 11:36:36 +0000307load("//third_party/dosfstools:external.bzl", "dosfstools_external")
308
309dosfstools_external(
310 name = "com_github_dosfstools_dosfstools",
311 version = "c888797b1d84ffbb949f147e3116e8bfb2e145a7",
312)
313
Serge Bazanski662b5b32020-12-21 13:49:00 +0100314# Load musl toolchain Metropolis sysroot tarball into external repository.
Serge Bazanski9e861a82020-09-16 13:46:41 +0200315load("//build/toolchain/musl-host-gcc:sysroot.bzl", "musl_sysroot_repositories")
Lorenz Brun2073ce32021-02-03 18:52:59 +0100316
Serge Bazanski9e861a82020-09-16 13:46:41 +0200317musl_sysroot_repositories()
Serge Bazanski1e9d7d82022-09-15 18:45:44 +0200318
319# CockroachDB binary used for tests.
320#
321# WARNING: Not distributed under an OSI certified license. Must only be used in
322# tests, not be redistributed!
323http_archive(
324 name = "cockroach",
325 urls = [
326 # TODO: select() to pick other host architectures.
327 "https://binaries.cockroachdb.com/cockroach-v22.1.6.linux-amd64.tgz",
328 ],
329 sha256 = "0821cff5770400fb94c8b6c2ab338d96f4114fbf2b3206bc8a6dcf62f9c0f4ea",
330 strip_prefix = "cockroach-v22.1.6.linux-amd64",
331 build_file_content = """
332exports_files([
333 "cockroach"
334])
335""",
336)
Leopoldbe326c22023-01-04 20:42:59 +0100337
338# bazeldnf is used to generate our sandbox root.
339http_archive(
340 name = "bazeldnf",
341 sha256 = "404fc34e6bd3b568a7ca6fbcde70267d43830d0171d3192e3ecd83c14c320cfc",
342 strip_prefix = "bazeldnf-0.5.4",
343 urls = [
344 "https://github.com/rmohr/bazeldnf/archive/v0.5.4.tar.gz",
345 "https://storage.googleapis.com/builddeps/404fc34e6bd3b568a7ca6fbcde70267d43830d0171d3192e3ecd83c14c320cfc",
346 ],
347)
348
349load("@bazeldnf//:deps.bzl", "bazeldnf_dependencies", "rpm")
350
351bazeldnf_dependencies()