blob: b0029587269df98e184d91365c8e42c6fa8d6656 [file] [log] [blame]
Hendrik Hofstadt0d7c91e2019-10-23 21:44:47 +02001workspace(name = "nexantic")
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(
Serge Bazanskidf125222020-05-23 00:29:30 +020032 # Pin slightly above 0.23.0 (and 0.23.1 prerelease at time of writing) to pull in this commit.
33 # This fixes https://github.com/bazelbuild/rules_go/issues/2499, which started manifesting at 0.22.4.
Leopold Schabel5c80aca2019-10-22 15:48:58 +020034 name = "io_bazel_rules_go",
Serge Bazanskidf125222020-05-23 00:29:30 +020035 sha256 = "89501e6e6ae6308e82239f0c8e53dceaa428ad8de471a7f8be8b99a1717bb7d8",
Serge Bazanski140bddc2020-06-05 21:01:19 +020036 strip_prefix = "rules_go-c07100d793fc0cdb20bc4f0361c1d53987ba259b",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020037 urls = [
Serge Bazanskidf125222020-05-23 00:29:30 +020038 "https://github.com/bazelbuild/rules_go/archive/c07100d793fc0cdb20bc4f0361c1d53987ba259b.zip",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020039 ],
40)
41
42http_archive(
43 name = "bazel_gazelle",
Serge Bazanskidf125222020-05-23 00:29:30 +020044 sha256 = "bfd86b3cbe855d6c16c6fce60d76bd51f5c8dbc9cfcaef7a2bb5c1aafd0710e8",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020045 urls = [
Serge Bazanskidf125222020-05-23 00:29:30 +020046 "https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazelle-v0.21.0.tar.gz",
47 "https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.21.0/bazel-gazellev0.21.0.tar.gz",
Leopold Schabel5c80aca2019-10-22 15:48:58 +020048 ],
49)
50
51load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
52
53# golang.org/x/sys is overridden by the go_rules protobuf dependency -> declare it first, since
54# we need a newer version of it for the netlink package which would fail to compile otherwise.
55load("@bazel_gazelle//:deps.bzl", "go_repository")
56
57go_repository(
58 name = "org_golang_x_sys",
59 importpath = "golang.org/x/sys",
Serge Bazanskibb7db922020-04-30 12:43:10 +020060 sum = "h1:q9u40nxWT5zRClI/uU9dHCiYGottAg6Nzz4YUQyHxdA=",
61 version = "v0.0.0-20190927073244-c990c680b611",
62)
63
64# we also pin github.com/golang/protobuf to 1.3.2, because we use gRPC 1.26 (can bump to 1.27
65# once https://github.com/etcd-io/etcd/issues/11563 is resolved and merged.
66
67go_repository(
68 name = "com_github_golang_protobuf",
69 build_file_proto_mode = "disable_global",
70 commit = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7",
71 importpath = "github.com/golang/protobuf",
Lorenz Brunc88c82d2020-05-08 14:35:04 +020072 patch_args = ["-p1"],
Serge Bazanskibb7db922020-04-30 12:43:10 +020073 patches = [
74 "@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch",
75 ],
Leopold Schabel5c80aca2019-10-22 15:48:58 +020076)
77
78go_rules_dependencies()
79
Leopold Schabel60a85b62019-11-17 19:12:41 +010080go_register_toolchains(
Lorenz Brund3c59d22020-05-11 16:00:22 +020081 go_version = "1.14",
Leopold Schabel60a85b62019-11-17 19:12:41 +010082 nogo = "@//:nogo_vet",
83)
Leopold Schabel5c80aca2019-10-22 15:48:58 +020084
85load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
86
87gazelle_dependencies()
88
89# Load Gazelle-generated local dependencies
90
Serge Bazanski6c8d5f92020-02-11 12:42:29 +010091# gazelle:repository_macro third_party/go/repositories.bzl%go_repositories
92load("//third_party/go:repositories.bzl", "go_repositories")
Leopold Schabel5c80aca2019-10-22 15:48:58 +020093
94go_repositories()
95
96# Protobuf
97
98http_archive(
99 name = "com_google_protobuf",
100 sha256 = "758249b537abba2f21ebc2d02555bf080917f0f2f88f4cbe2903e0e28c4187ed",
101 strip_prefix = "protobuf-3.10.0",
102 urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.10.0.tar.gz"],
103)
104
105load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
106
107protobuf_deps()
108
Serge Bazanskibb7db922020-04-30 12:43:10 +0200109# Build packages
110http_archive(
111 name = "rules_pkg",
112 sha256 = "5bdc04987af79bd27bc5b00fe30f59a858f77ffa0bd2d8143d5b31ad8b1bd71c",
113 url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.0/rules_pkg-0.2.0.tar.gz",
114)
115
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100116# third_party external repositories
117load("//third_party/linux:external.bzl", "linux_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100118
119linux_external(
120 name = "linux",
Lorenz Brunfd166512020-04-01 17:29:45 +0200121 version = "5.6",
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100122)
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200123
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100124load("//third_party/edk2:external.bzl", "edk2_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100125
126edk2_external(name = "edk2")
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200127
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100128load("//third_party/musl:external.bzl", "musl_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100129
130musl_external(
131 name = "musl",
132 version = "1.1.24",
133)
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200134
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100135load("//third_party/util-linux:external.bzl", "util_linux_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100136
137util_linux_external(
138 name = "util_linux",
139 version = "2.34",
140)
Leopold Schabel5c80aca2019-10-22 15:48:58 +0200141
Serge Bazanski2fb13a82020-02-11 12:41:37 +0100142load("//third_party/xfsprogs:external.bzl", "xfsprogs_external")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100143
144xfsprogs_external(
145 name = "xfsprogs",
146 version = "5.2.1",
147)
Lorenz Brun6c39ea12019-11-04 11:39:42 +0100148
Serge Bazanskibb7db922020-04-30 12:43:10 +0200149register_toolchains("//:host_python")
Lorenz Brun7b5d9942020-03-19 16:14:02 +0100150
Serge Bazanskibb7db922020-04-30 12:43:10 +0200151# python dependencies. Currently we don't use Python, but some of our deps (ie. gvisor) do expect @pydeps// to exist, even
152# if it's not being used.
153
154load("@rules_python//python:pip.bzl", "pip_import")
155
156pip_import(
157 name = "pydeps",
158 requirements = "//third_party/py:requirements.txt",
Lorenz Brun0bcaaee2019-11-06 12:42:39 +0100159)
Serge Bazanski7a1b10c2020-02-11 10:02:21 +0100160
Serge Bazanskibb7db922020-04-30 12:43:10 +0200161load("@pydeps//:requirements.bzl", "pip_install")
162
163pip_install()
164
165# same for gvisor/rules_docker.
166
167http_archive(
168 name = "io_bazel_rules_docker",
169 sha256 = "14ac30773fdb393ddec90e158c9ec7ebb3f8a4fd533ec2abbfd8789ad81a284b",
170 strip_prefix = "rules_docker-0.12.1",
171 urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.12.1/rules_docker-v0.12.1.tar.gz"],
172)
Lorenz Brunc88c82d2020-05-08 14:35:04 +0200173
174# Derived from Mozilla NSS, currently needed for containerd to be able to pull images
175http_file(
176 name = "cacerts",
177 sha256 = "adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f",
178 urls = ["https://curl.haxx.se/ca/cacert-2020-01-01.pem"],
179)
Serge Bazanski140bddc2020-06-05 21:01:19 +0200180
181# lz4, the library and the tool.
182http_archive(
183 name = "com_github_lz4_lz4",
184 patch_args = ["-p1"],
185 patches = ["//third_party/lz4:build.patch"],
186 sha256 = "658ba6191fa44c92280d4aa2c271b0f4fbc0e34d249578dd05e50e76d0e5efcc",
187 strip_prefix = "lz4-1.9.2",
188 urls = ["https://github.com/lz4/lz4/archive/v1.9.2.tar.gz"],
189)