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 | |
| 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 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 | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 32 | # Currently pinned to an unreleased commit for compatibility with pinned Gazelle below. |
| 33 | # (we need //go/platforms:{aix,illumos,...} as generated by Gazelle) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 34 | name = "io_bazel_rules_go", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 35 | urls = [ |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 36 | "https://github.com/bazelbuild/rules_go/archive/64f44314a710ce0e3ccc07891cec5f2047901ac8.tar.gz", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 37 | ], |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 38 | strip_prefix = "rules_go-64f44314a710ce0e3ccc07891cec5f2047901ac8", |
| 39 | sha256 = "a8045644f4790d8dc7f25d25ee56ed9b7668f609f2aa1c59eef48d2dd9755430", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 40 | ) |
| 41 | |
| 42 | http_archive( |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 43 | # Currently pinned to an unreleased commit that fixes build tag usage in `update-repos`. |
| 44 | # This can be unpinned once it makes it into 0.21.0. |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 45 | name = "bazel_gazelle", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 46 | urls = [ |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 47 | "https://github.com/bazelbuild/bazel-gazelle/archive/f6ed80dc6ff71e33233006db9584da4cd36a81e6.zip", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 48 | ], |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 49 | strip_prefix = "bazel-gazelle-f6ed80dc6ff71e33233006db9584da4cd36a81e6", |
| 50 | sha256 = "509bb26e377a8ac28ebbd5fb999d15a428b092b0c533dc1e528d66d766ea273e", |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 51 | ) |
| 52 | |
| 53 | load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") |
| 54 | |
| 55 | # golang.org/x/sys is overridden by the go_rules protobuf dependency -> declare it first, since |
| 56 | # we need a newer version of it for the netlink package which would fail to compile otherwise. |
| 57 | load("@bazel_gazelle//:deps.bzl", "go_repository") |
| 58 | |
| 59 | go_repository( |
| 60 | name = "org_golang_x_sys", |
| 61 | importpath = "golang.org/x/sys", |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 62 | sum = "h1:q9u40nxWT5zRClI/uU9dHCiYGottAg6Nzz4YUQyHxdA=", |
| 63 | version = "v0.0.0-20190927073244-c990c680b611", |
| 64 | ) |
| 65 | |
| 66 | # we also pin github.com/golang/protobuf to 1.3.2, because we use gRPC 1.26 (can bump to 1.27 |
| 67 | # once https://github.com/etcd-io/etcd/issues/11563 is resolved and merged. |
| 68 | |
| 69 | go_repository( |
| 70 | name = "com_github_golang_protobuf", |
| 71 | build_file_proto_mode = "disable_global", |
| 72 | commit = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7", |
| 73 | importpath = "github.com/golang/protobuf", |
| 74 | patches = [ |
| 75 | "@io_bazel_rules_go//third_party:com_github_golang_protobuf-extras.patch", |
| 76 | ], |
| 77 | patch_args = ["-p1"], |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 78 | ) |
| 79 | |
| 80 | go_rules_dependencies() |
| 81 | |
Leopold Schabel | 60a85b6 | 2019-11-17 19:12:41 +0100 | [diff] [blame] | 82 | go_register_toolchains( |
| 83 | go_version = "1.13", |
| 84 | nogo = "@//:nogo_vet", |
| 85 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 86 | |
| 87 | load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies") |
| 88 | |
| 89 | gazelle_dependencies() |
| 90 | |
| 91 | # Load Gazelle-generated local dependencies |
| 92 | |
Serge Bazanski | 6c8d5f9 | 2020-02-11 12:42:29 +0100 | [diff] [blame] | 93 | # gazelle:repository_macro third_party/go/repositories.bzl%go_repositories |
| 94 | load("//third_party/go:repositories.bzl", "go_repositories") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 95 | |
| 96 | go_repositories() |
| 97 | |
| 98 | # Protobuf |
| 99 | |
| 100 | http_archive( |
| 101 | name = "com_google_protobuf", |
| 102 | sha256 = "758249b537abba2f21ebc2d02555bf080917f0f2f88f4cbe2903e0e28c4187ed", |
| 103 | strip_prefix = "protobuf-3.10.0", |
| 104 | urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.10.0.tar.gz"], |
| 105 | ) |
| 106 | |
| 107 | load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") |
| 108 | |
| 109 | protobuf_deps() |
| 110 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 111 | # Build packages |
| 112 | http_archive( |
| 113 | name = "rules_pkg", |
| 114 | sha256 = "5bdc04987af79bd27bc5b00fe30f59a858f77ffa0bd2d8143d5b31ad8b1bd71c", |
| 115 | url = "https://github.com/bazelbuild/rules_pkg/releases/download/0.2.0/rules_pkg-0.2.0.tar.gz", |
| 116 | ) |
| 117 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 118 | # third_party external repositories |
| 119 | load("//third_party/linux:external.bzl", "linux_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 120 | |
| 121 | linux_external( |
| 122 | name = "linux", |
Lorenz Brun | fd16651 | 2020-04-01 17:29:45 +0200 | [diff] [blame] | 123 | version = "5.6", |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 124 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 125 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 126 | load("//third_party/edk2:external.bzl", "edk2_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 127 | |
| 128 | edk2_external(name = "edk2") |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 129 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 130 | load("//third_party/musl:external.bzl", "musl_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 131 | |
| 132 | musl_external( |
| 133 | name = "musl", |
| 134 | version = "1.1.24", |
| 135 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 136 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 137 | load("//third_party/util-linux:external.bzl", "util_linux_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 138 | |
| 139 | util_linux_external( |
| 140 | name = "util_linux", |
| 141 | version = "2.34", |
| 142 | ) |
Leopold Schabel | 5c80aca | 2019-10-22 15:48:58 +0200 | [diff] [blame] | 143 | |
Serge Bazanski | 2fb13a8 | 2020-02-11 12:41:37 +0100 | [diff] [blame] | 144 | load("//third_party/xfsprogs:external.bzl", "xfsprogs_external") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 145 | |
| 146 | xfsprogs_external( |
| 147 | name = "xfsprogs", |
| 148 | version = "5.2.1", |
| 149 | ) |
Lorenz Brun | 6c39ea1 | 2019-11-04 11:39:42 +0100 | [diff] [blame] | 150 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 151 | register_toolchains("//:host_python") |
Lorenz Brun | 7b5d994 | 2020-03-19 16:14:02 +0100 | [diff] [blame] | 152 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 153 | # python dependencies. Currently we don't use Python, but some of our deps (ie. gvisor) do expect @pydeps// to exist, even |
| 154 | # if it's not being used. |
| 155 | |
| 156 | load("@rules_python//python:pip.bzl", "pip_import") |
| 157 | |
| 158 | pip_import( |
| 159 | name = "pydeps", |
| 160 | requirements = "//third_party/py:requirements.txt", |
Lorenz Brun | 0bcaaee | 2019-11-06 12:42:39 +0100 | [diff] [blame] | 161 | ) |
Serge Bazanski | 7a1b10c | 2020-02-11 10:02:21 +0100 | [diff] [blame] | 162 | |
Serge Bazanski | bb7db92 | 2020-04-30 12:43:10 +0200 | [diff] [blame] | 163 | load("@pydeps//:requirements.bzl", "pip_install") |
| 164 | |
| 165 | pip_install() |
| 166 | |
| 167 | # same for gvisor/rules_docker. |
| 168 | |
| 169 | http_archive( |
| 170 | name = "io_bazel_rules_docker", |
| 171 | sha256 = "14ac30773fdb393ddec90e158c9ec7ebb3f8a4fd533ec2abbfd8789ad81a284b", |
| 172 | strip_prefix = "rules_docker-0.12.1", |
| 173 | urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.12.1/rules_docker-v0.12.1.tar.gz"], |
| 174 | ) |