-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
151 lines (139 loc) · 4.14 KB
/
MODULE.bazel
File metadata and controls
151 lines (139 loc) · 4.14 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
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
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(
name = "toolchains_llvm",
dev_dependency = True,
)
bazel_dep(
name = "bazel_clang_format",
version = "0.0.0",
dev_dependency = True,
)
bazel_dep(
name = "rules_clang_tidy",
version = "0.0.0",
dev_dependency = True,
)
bazel_dep(
name = "hedron_compile_commands",
dev_dependency = True,
)
bazel_dep(
name = "platforms",
version = "1.0.0",
dev_dependency = True,
)
bazel_dep(
name = "buildifier_prebuilt",
version = "8.2.0.2",
dev_dependency = True,
)
bazel_dep(
name = "rules_multirun",
version = "0.12.0",
dev_dependency = True,
)
bazel_dep(
name = "rules_multitransition",
version = "0.0.1",
dev_dependency = True,
)
bazel_dep(name = "rules_nixpkgs_core", dev_dependency = True)
bazel_dep(name = "rules_nixpkgs_cc", dev_dependency = True)
bazel_dep(
name = "bazel_skylib",
version = "1.7.1",
dev_dependency = True,
)
bazel_dep(
name = "skytest",
version = "0.0.0",
dev_dependency = True,
)
TOOLCHAINS_LLVM_COMMIT = "ace6215bbfe8a76884646b2458b42380e2201607"
archive_override(
module_name = "toolchains_llvm",
integrity = "sha256-Z2J+zsJsLvi7UjZY50F4Ub4M/5oYpUFSlZeAhiAePC4=",
strip_prefix = "toolchains_llvm-{commit}".format(
commit = TOOLCHAINS_LLVM_COMMIT,
),
urls = ["https://github.com/bazel-contrib/toolchains_llvm/archive/{commit}.tar.gz".format(
commit = TOOLCHAINS_LLVM_COMMIT,
)],
)
HEDRON_COMPILE_COMMANDS_COMMIT = "4f28899228fb3ad0126897876f147ca15026151e"
archive_override(
module_name = "hedron_compile_commands",
integrity = "sha256-ZYEiz7HyW+duohKwD16wR9jirci8+SO5GEYfKx43zfI=",
strip_prefix = "bazel-compile-commands-extractor-{commit}".format(
commit = HEDRON_COMPILE_COMMANDS_COMMIT,
),
urls = ["https://github.com/hedronvision/bazel-compile-commands-extractor/archive/{commit}.tar.gz".format(
commit = HEDRON_COMPILE_COMMANDS_COMMIT,
)],
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "lcov",
build_file_content = """\
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
native_binary(
name = "genhtml",
src = "bin/genhtml",
visibility = ["//visibility:public"],
)
""",
integrity = "sha256-mHAxrVUoyKdG1LUrOAvBv/5BLeHyucK6UiSZVmjjJAs=",
strip_prefix = "lcov-1.16",
url = "https://github.com/linux-test-project/lcov/releases/download/v1.16/lcov-1.16.tar.gz",
)
# rules_nixpkgs_cc isn't available from the BCR so we obtain both *_core and
# *_cc from the same archive
[
archive_override(
module_name = "rules_nixpkgs_" + submodule,
integrity = "sha256-3C7HbeS+pnFxNwM6Ez2W+edkjAOeQfaCnUPa+1UJT1s=",
patch_cmds = [
"mv {subdirectory} tmp_subdirectory".format(subdirectory = subdirectory),
"find . -mindepth 1 -maxdepth 1 ! -name tmp_subdirectory -exec rm -rf {} +",
"mv tmp_subdirectory/* . && rm -rf tmp_subdirectory",
],
strip_prefix = "rules_nixpkgs-697daa3881c3ff31076ca17860f3242db668b747",
urls = [
"https://github.com/oliverlee/rules_nixpkgs/archive/697daa3881c3ff31076ca17860f3242db668b747.tar.gz",
],
)
for submodule, subdirectory in [
("core", "core"),
("cc", "toolchains/cc"),
]
]
# use a flake to set the nixpkgs repository
# https://github.com/tweag/rules_nixpkgs/blob/cb0f9be1798131ea4336fd02b850edeeb1972680/examples/toolchains/cc/MODULE.bazel#L23-L50
# https://github.com/tweag/rules_nixpkgs/blob/cb0f9be1798131ea4336fd02b850edeeb1972680/core/extensions/repository.bzl#L286-L289
nix_repo = use_extension(
"@rules_nixpkgs_core//extensions:repository.bzl",
"nix_repo",
dev_dependency = True,
)
nix_repo.flake(
name = "nixpkgs",
lock_file = "//tools/nix:flake.lock",
)
use_repo(
nix_repo,
"nixpkgs",
)
cc_configure = use_extension(
"//toolchain:extension.bzl",
"cc_configure",
dev_dependency = True,
)
use_repo(
cc_configure,
"gcc_toolchain",
"llvm_toolchain",
)
register_toolchains(
"@llvm_toolchain//:all",
"@gcc_toolchain//:all",
)