-
Notifications
You must be signed in to change notification settings - Fork 11
/
WORKSPACE.bazel
250 lines (201 loc) · 7.83 KB
/
WORKSPACE.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
## RUST SECTION ##
http_archive(
name = "rules_rust",
# sha256 = "950a3ad4166ae60c8ccd628d1a8e64396106e7f98361ebe91b0bcfe60d8e4b60",
# urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.20.0/rules_rust-v0.20.0.tar.gz"],
sha256 = "4a9cb4fda6ccd5b5ec393b2e944822a62e050c7c06f1ea41607f14c4fdec57a2",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.25.1/rules_rust-v0.25.1.tar.gz"],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
rules_rust_dependencies()
RUST_VERSION = "nightly/2023-09-20"
rust_register_toolchains(
edition = "2021",
rustfmt_version = RUST_VERSION,
versions = [RUST_VERSION],
)
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
crate_universe_dependencies()
# Generate `rust-analyser` "rust-project.json"
load("@rules_rust//tools/rust_analyzer:deps.bzl", "rust_analyzer_dependencies")
rust_analyzer_dependencies()
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
crates_repository(
name = "crate_index",
# The following annotations are needed to prevent Bazel passing incompatible C/CXX flags when coverage is enabled
# https://github.com/bazelbuild/rules_rust/issues/1550
annotations = {
"librocksdb-sys": [crate.annotation(
build_script_env = {
"CXXFLAGS": "-Wno-error=coverage-invalid-line-number",
},
)],
"libudev-sys": [crate.annotation(
patch_args = ["-p1"],
patches = ["@//third_party/cargo/patches:libudev-sys-0.1.4.patch"],
)],
},
cargo_lockfile = "//:Cargo.Bazel.lock",
lockfile = "//:cargo-bazel-lock.json",
manifests = [
"//:Cargo.toml",
"//src/genesis-from-db:Cargo.toml",
"//src/http-proxy:Cargo.toml",
"//src/idstore-export:Cargo.toml",
"//src/kvstore:Cargo.toml",
"//src/ledger-db:Cargo.toml",
"//src/ledger:Cargo.toml",
"//src/many-abci:Cargo.toml",
"//src/many-cli-helpers:Cargo.toml",
"//src/many-client-macros:Cargo.toml",
"//src/many-client:Cargo.toml",
"//src/many-compute:Cargo.toml",
"//src/many-error:Cargo.toml",
"//src/many-identity-dsa:Cargo.toml",
"//src/many-identity-hsm:Cargo.toml",
"//src/many-identity-webauthn:Cargo.toml",
"//src/many-identity:Cargo.toml",
"//src/many-kvstore:Cargo.toml",
"//src/many-ledger/test-macros:Cargo.toml",
"//src/many-ledger/test-utils:Cargo.toml",
"//src/many-ledger:Cargo.toml",
"//src/many-macros:Cargo.toml",
"//src/many-migration:Cargo.toml",
"//src/many-mock:Cargo.toml",
"//src/many-modules:Cargo.toml",
"//src/many-protocol:Cargo.toml",
"//src/many-server:Cargo.toml",
"//src/many-server-cache:Cargo.toml",
"//src/many-types:Cargo.toml",
"//src/many-web:Cargo.toml",
"//src/many:Cargo.toml",
"//src/web:Cargo.toml",
],
rust_version = RUST_VERSION,
)
load("@crate_index//:defs.bzl", "crate_repositories")
crate_repositories()
## END RUST SECTION ##
## PACKAGE SECTION ##
http_archive(
name = "rules_pkg",
sha256 = "eea0f59c28a9241156a47d7a8e32db9122f3d50b505fae0f33de6ce4d9b61834",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.8.0/rules_pkg-0.8.0.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.8.0/rules_pkg-0.8.0.tar.gz",
],
)
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
rules_pkg_dependencies()
## END PACKAGE SECTION ##
## GO PACKAGE SECTION ##
# Go (necessary to avoid Docker building issue on macOS described in https://github.com/bazelbuild/rules_docker/issues/2036)
# https://github.com/bazelbuild/bazel/issues/10134#issuecomment-1193395705
http_archive(
name = "io_bazel_rules_go",
sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d",
urls = [
"https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip",
],
)
http_archive(
name = "bazel_gazelle",
sha256 = "ecba0f04f96b4960a5b250c8e8eeec42281035970aa8852dda73098274d14a1d",
urls = [
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.29.0/bazel-gazelle-v0.29.0.tar.gz",
],
)
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
go_rules_dependencies()
go_register_toolchains(version = "1.19.5")
gazelle_dependencies(go_repository_default_config = "//:WORKSPACE.bazel")
## END GO PACKAGE SECTION ##
## DOCKER SECTION ##
http_archive(
name = "io_bazel_rules_docker",
sha256 = "b1e80761a8a8243d03ebca8845e9cc1ba6c82ce7c5179ce2b295cd36f7e394bf",
urls = ["https://github.com/bazelbuild/rules_docker/releases/download/v0.25.0/rules_docker-v0.25.0.tar.gz"],
)
load("@rules_rust//rust:repositories.bzl", "rust_repositories")
rust_repositories()
load(
"@io_bazel_rules_docker//toolchains/docker:toolchain.bzl",
docker_toolchain_configure = "toolchain_configure",
)
# Force Docker toolchain to use 'which' to find Docker binary.
docker_toolchain_configure(
name = "docker_config",
)
load(
"@io_bazel_rules_docker//repositories:repositories.bzl",
container_repositories = "repositories",
)
container_repositories()
load("@io_bazel_rules_docker//repositories:deps.bzl", container_deps = "deps")
container_deps(
# https://github.com/bazelbuild/rules_docker/issues/1902
go_repository_default_config = "@//:WORKSPACE.bazel",
)
load(
"@io_bazel_rules_docker//container:container.bzl",
"container_pull",
)
container_pull(
name = "ubuntu_base",
digest = "sha256:c985bc3f77946b8e92c9a3648c6f31751a7dd972e06604785e47303f4ad47c4c", # amd64
registry = "index.docker.io",
repository = "ubuntu",
tag = "jammy",
)
container_pull(
name = "tendermint",
digest = "sha256:66a31574012e080fcad37bb94cb088109dc898fe21432059793388a47962b3cd", # amd64
registry = "index.docker.io",
repository = "tendermint/tendermint",
tag = "v0.34.24",
)
# TODO: LL should have it's own openssl image
# This image is not official nor tagged
container_pull(
name = "openssl",
digest = "sha256:cf89651f07a33d2faf4499f72e6f8b0ee2542cd40735d51c7e75b8965c17af0e", # amd64
registry = "index.docker.io",
repository = "alpine/openssl",
tag = "latest",
)
container_pull(
name = "jsonnet",
digest = "sha256:a255e35fb249e23c07c54bccbb6482744597973957a4ccb654ed681e23a4f8b4", # amd64
registry = "index.docker.io",
repository = "bitnami/jsonnet",
tag = "0.19.1",
)
### END DOCKER SECTION ##
### BATS SECTION ###
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
BAZEL_BATS_COMMIT_ID = "8ebd7d11cac3316e429b55d414667f320fb5eda3"
git_repository(
name = "bazel_bats",
commit = BAZEL_BATS_COMMIT_ID,
remote = "https://github.com/fmorency/bazel-bats",
shallow_since = "1680722748 -0400",
)
load("@bazel_bats//:deps.bzl", "bazel_bats_dependencies")
bazel_bats_dependencies()
BATS_ASSERT_VERSION = "2.0.0"
BATS_ASSERT_SHA256 = "15dbf1abb98db785323b9327c86ee2b3114541fe5aa150c410a1632ec06d9903"
BATS_CORE_VERSION = "1.7.0"
BATS_CORE_SHA256 = "ac70c2a153f108b1ac549c2eaa4154dea4a7c1cc421e3352f0ce6ea49435454e"
BATS_SUPPORT_VERSION = "0.3.0"
BATS_SUPPORT_SHA256 = "7815237aafeb42ddcc1b8c698fc5808026d33317d8701d5ec2396e9634e2918f"
bazel_bats_dependencies(
bats_assert_sha256 = BATS_ASSERT_SHA256,
bats_assert_version = BATS_ASSERT_VERSION,
bats_support_sha256 = BATS_SUPPORT_SHA256,
bats_support_version = BATS_SUPPORT_VERSION,
sha256 = BATS_CORE_SHA256,
version = BATS_CORE_VERSION,
)
### END BATS SECTION ###