-
Notifications
You must be signed in to change notification settings - Fork 9
/
WORKSPACE
54 lines (39 loc) · 1.48 KB
/
WORKSPACE
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
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_rust",
sha256 = "c30dfdf1e86fd50650a76ea645b3a45f2f00667b06187a685e9554e167ca97ee",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.40.0/rules_rust-v0.40.0.tar.gz"],
)
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
rules_rust_dependencies()
rust_register_toolchains(
edition = "2021",
versions = ["1.75.0"],
)
load("@rules_rust//crate_universe:defs.bzl", "crate", "crates_repository")
# Example of using crate_universe. For gazelle_rust to work correctly with crate_universe
# dependencies, this must be paired with two gazelle directives; see BUILD.bazel.
crates_repository(
name = "crates",
cargo_lockfile = "//:cargo.lock",
lockfile = "//:cargo.bazel.lock",
packages = {
"clap": crate.spec(
features = ["derive"],
version = "3.2",
),
},
)
load("@crates//:defs.bzl", "crate_repositories")
crate_repositories()
# Load gazelle_rust. In a real project, this would use http_archive.
local_repository(
name = "gazelle_rust",
path = "..",
)
# Load gazelle_rust transitive dependencies (includes gazelle). You can also load gazelle yourself,
# before these macros.
load("@gazelle_rust//:deps1.bzl", "gazelle_rust_dependencies1")
gazelle_rust_dependencies1()
load("@gazelle_rust//:deps2.bzl", "gazelle_rust_dependencies2")
gazelle_rust_dependencies2()