Hendrik Hofstadt | 0d7c91e | 2019-10-23 21:44:47 +0200 | [diff] [blame] | 1 | workspace(name = "nexantic") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 2 | |
Lorenz Brun | c88c82d | 2020-05-08 14:35:04 +0200 | [diff] [blame] | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 4 | load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") |
| 5 | |
| 6 | # Load skylib |
| 7 | |
| 8 | http_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 | |
| 17 | load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") |
| 18 | |
| 19 | bazel_skylib_workspace() |
| 20 | |
| 21 | # Assert minimum Bazel version |
| 22 | |
| 23 | load("@bazel_skylib//lib:versions.bzl", "versions") |
| 24 | |
Leopold Schabel | af5ec37 | 2020-03-11 13:33:17 +0100 | [diff] [blame] | 25 | versions.check(minimum_bazel_version = "2.2.0") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 26 | |
| 27 | # Go and Gazelle |
| 28 | |
| 29 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 30 | |
| 31 | http_archive( |
Serge Bazanski | df12522 | 2020-05-23 00:29:30 +0200 | [diff] [blame] | 32 | # 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 Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 34 | name = "io_bazel_rules_go", |
Serge Bazanski | df12522 | 2020-05-23 00:29:30 +0200 | [diff] [blame] | 35 | strip_prefix = "rules_go-c07100d793fc0cdb20bc4f0361c1d53987ba259b", |
| 36 | sha256 = "89501e6e6ae6308e82239f0c8e53dceaa428ad8de471a7f8be8b99a1717bb7d8", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 37 | urls = [ |
Serge Bazanski | df12522 | 2020-05-23 00:29:30 +0200 | [diff] [blame] | 38 | "https://github.com/bazelbuild/rules_go/archive/c07100d793fc0cdb20bc4f0361c1d53987ba259b.zip", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 39 | ], |
| 40 | ) |
| 41 | |
| 42 | http_archive( |
| 43 | name = "bazel_gazelle", |
Serge Bazanski | df12522 | 2020-05-23 00:29:30 +0200 | [diff] [blame] | 44 | sha256 = "bfd86b3cbe855d6c16c6fce60d76bd51f5c8dbc9cfcaef7a2bb5c1aafd0710e8", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 45 | urls = [ |
Serge Bazanski | df12522 | 2020-05-23 00:29:30 +0200 | [diff] [blame] | 46 | "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 Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 48 | ], |
| 49 | ) |
| 50 | |
| 51 | load("@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. |
| 55 | load("@bazel_gazelle//:deps.bzl", "go_repository") |
| 56 | |
| 57 | go_repository( |
| 58 | name = "org_golang_x_sys", |
| 59 | importpath = "golang.org/x/sys", |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 60 | 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 | |
| 67 | go_repository( |
| 68 | name = "com_github_golang_protobuf", |
| 69 | build_file_proto_mode = "disable_global", |
| 70 | commit = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7", |
| 71 | importpath = "github.com/golang/protobuf", |
Lorenz Brun | c88c82d | 2020-05-08 14:35:04 +0200 | [diff] [blame] | 72 | patch_args = ["-p1"], |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 73 | patches = [ |
| 74 | "@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch", |
| 75 | ], |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 76 | ) |
| 77 | |
| 78 | go_rules_dependencies() |
| 79 | |
Leopold Schabel | 60a85b6 | 2019-11-17 19:12:41 +0100 | [diff] [blame] | 80 | go_register_toolchains( |
Lorenz Brun | d3c59d2 | 2020-05-11 16:00:22 +0200 | [diff] [blame] | 81 | go_version = "1.14", |
Leopold Schabel | 60a85b6 | 2019-11-17 19:12:41 +0100 | [diff] [blame] | 82 | nogo = "@//:nogo_vet", |
| 83 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 84 | |
| 85 | load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") |
| 86 | |
| 87 | gazelle_dependencies() |
| 88 | |
| 89 | # Load Gazelle-generated local dependencies |
| 90 | |
Serge Bazanski | 6c8d5f9 | 2020-02-11 12:42:29 +0100 | [diff] [blame] | 91 | # gazelle:repository_macro third_party/go/repositories.bzl%go_repositories |
| 92 | load("//third_party/go:repositories.bzl", "go_repositories") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 93 | |
| 94 | go_repositories() |
| 95 | |
| 96 | # Protobuf |
| 97 | |
| 98 | http_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 | |
| 105 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") |
| 106 | |
| 107 | protobuf_deps() |
| 108 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 109 | # Build packages |
| 110 | http_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 Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 116 | # third_party external repositories |
| 117 | load("//third_party/linux:external.bzl", "linux_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 118 | |
| 119 | linux_external( |
| 120 | name = "linux", |
Lorenz Brun | fd16651 | 2020-04-01 17:29:45 +0200 | [diff] [blame] | 121 | version = "5.6", |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 122 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 123 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 124 | load("//third_party/edk2:external.bzl", "edk2_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 125 | |
| 126 | edk2_external(name = "edk2") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 127 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 128 | load("//third_party/musl:external.bzl", "musl_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 129 | |
| 130 | musl_external( |
| 131 | name = "musl", |
| 132 | version = "1.1.24", |
| 133 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 134 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 135 | load("//third_party/util-linux:external.bzl", "util_linux_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 136 | |
| 137 | util_linux_external( |
| 138 | name = "util_linux", |
| 139 | version = "2.34", |
| 140 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 141 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 142 | load("//third_party/xfsprogs:external.bzl", "xfsprogs_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 143 | |
| 144 | xfsprogs_external( |
| 145 | name = "xfsprogs", |
| 146 | version = "5.2.1", |
| 147 | ) |
Lorenz Brun | 6c39ea1 | 2019-11-04 11:39:42 +0100 | [diff] [blame] | 148 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 149 | register_toolchains("//:host_python") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 150 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 151 | # 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 | |
| 154 | load("@rules_python//python:pip.bzl", "pip_import") |
| 155 | |
| 156 | pip_import( |
| 157 | name = "pydeps", |
| 158 | requirements = "//third_party/py:requirements.txt", |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 159 | ) |
Serge Bazanski | 7a1b10c | 2020-02-11 10:02:21 +0100 | [diff] [blame] | 160 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 161 | load("@pydeps//:requirements.bzl", "pip_install") |
| 162 | |
| 163 | pip_install() |
| 164 | |
| 165 | # same for gvisor/rules_docker. |
| 166 | |
| 167 | http_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 Brun | c88c82d | 2020-05-08 14:35:04 +0200 | [diff] [blame] | 173 | |
| 174 | # Derived from Mozilla NSS, currently needed for containerd to be able to pull images |
| 175 | http_file( |
| 176 | name = "cacerts", |
| 177 | sha256 = "adf770dfd574a0d6026bfaa270cb6879b063957177a991d453ff1d302c02081f", |
| 178 | urls = ["https://curl.haxx.se/ca/cacert-2020-01-01.pem"], |
| 179 | ) |