-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathWORKSPACE.bazel
More file actions
120 lines (92 loc) · 3.28 KB
/
WORKSPACE.bazel
File metadata and controls
120 lines (92 loc) · 3.28 KB
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
workspace(
name = "blade",
)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "io_tweag_rules_nixpkgs",
sha256 = "30271f7bd380e4e20e4d7132c324946c4fdbc31ebe0bbb6638a0f61a37e74397",
strip_prefix = "rules_nixpkgs-0.13.0",
urls = ["https://github.com/tweag/rules_nixpkgs/releases/download/v0.13.0/rules_nixpkgs-0.13.0.tar.gz"],
)
load("@io_tweag_rules_nixpkgs//nixpkgs:repositories.bzl", "rules_nixpkgs_dependencies")
rules_nixpkgs_dependencies()
load("@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", "nixpkgs_cc_configure", "nixpkgs_local_repository")
# It is recommended to keep nixpkgs of nix-shell (which provide Bazel),
# and nixpkgs of Bazel Workspace in sync - otherwise one may
# got hit with nasty glibc mismatch errors.
nixpkgs_local_repository(
name = "nixpkgs",
nix_file = "//nix/bazel:nixpkgs.nix",
nix_file_deps = [
"//:flake.lock",
"//nix/bazel:nixpkgs.nix",
],
)
nixpkgs_local_repository(
name = "fenix",
nix_file = "//nix/rust:fenix.nix",
nix_file_deps = ["//:flake.lock"],
)
# rules_rust also uses the cc compiler
nixpkgs_cc_configure(
name = "nixpkgs_config_cc",
nix_file_content = "import ./nix/cc/cc.nix {}",
nix_file_deps = ["//nix/cc:cc.nix"],
repository = "@nixpkgs",
)
load("@io_tweag_rules_nixpkgs//nixpkgs:toolchains/rust.bzl", "nixpkgs_rust_configure")
# Note that default_edition doesn't work.
nixpkgs_rust_configure(
name = "nix_rust",
nix_file = "//nix/rust:rust.nix",
repositories = {
"nixpkgs": "@nixpkgs",
"fenix": "@fenix",
},
)
nixpkgs_rust_configure(
name = "nix_rust_wasm",
nix_file = "//nix/rust:rust.nix",
nixopts = [
"--argstr",
"target",
"wasm32-unknown-unknown",
],
repositories = {
"nixpkgs": "@nixpkgs",
"fenix": "@fenix",
},
target_constraints = [
"@platforms//cpu:wasm32",
"@platforms//os:none",
],
)
# crate_universe as a way of governing deps
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
crate_universe_dependencies(
rust_toolchain_cargo_template = "@nix_rust//:bin/{tool}",
rust_toolchain_rustc_template = "@nix_rust//:bin/{tool}",
)
load("//third_party/nix:deps.bzl", "third_party_nix_deps")
third_party_nix_deps()
load("//third_party/rust:deps.bzl", "rust_dependencies")
rust_dependencies()
load("@crate//:defs.bzl", "crate_repositories")
crate_repositories()
load("@wasm_crate//:defs.bzl", wasm_crate_repositories = "crate_repositories")
wasm_crate_repositories()
register_toolchains("//nix/rust:rust_analyzer_toolchain")
register_toolchains("//nix/rust:rustfmt_toolchain")
register_toolchains("//nix/rust:wasm_bindgen_toolchain")
register_toolchains("//prost:prost_toolchain")
http_archive(
name = "googleapis",
repo_mapping = {
"@com_google_protobuf": "@protobuf",
},
sha256 = "9094b43a8a8b6f05dd4868cb509fa934012725107995865b5c8eb9c67fbea35d",
strip_prefix = "googleapis-db5ce67d735d2ceb6fe925f3e317a3f30835cfd6",
urls = ["https://github.com/googleapis/googleapis/archive/db5ce67d735d2ceb6fe925f3e317a3f30835cfd6.tar.gz"],
)
load("@googleapis//:repository_rules.bzl", "switched_rules_by_language")
switched_rules_by_language("com_google_googleapis_imports")