-
Notifications
You must be signed in to change notification settings - Fork 469
/
MODULE.bazel
127 lines (103 loc) · 4.69 KB
/
MODULE.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
repo_license = use_repo_rule("//bazel/rules:repo_license.bzl", "detect_repo_license")
repo_license(name = "repo_license")
# Hedron's Compile Commands Extractor for Bazel
# https://github.com/hedronvision/bazel-compile-commands-extractor
bazel_dep(name = "hedron_compile_commands", dev_dependency = True)
git_override(
module_name = "hedron_compile_commands",
# No tags, no releases. Let's go with today's head.
commit = "1e08f8e0507b6b6b1f4416a9a22cf5c28beaba93",
remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git",
)
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(name = "rules_rust", version = "0.49.3")
bazel_dep(name = "rules_python", version = "0.37.0")
bazel_dep(name = "rules_uv", version = "0.42.0")
# TODO: how to sync this with the PYTHON_VERSION in package_versions.bzl?
PYTHON_VERSION = "3.12.3"
# TODO: Duplicate from bazel_variables.bzl. won't be needed anymore when all omd packages are loaded via MODULE.bazel
UPSTREAM_MIRROR_URL = "https://artifacts.lan.tribe29.com/repository/upstream-archives/"
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
is_default = True,
# We can specify the exact version.
python_version = PYTHON_VERSION,
)
bazel_dep(name = "rules_mypy", version = "0.11.0")
# Switch to upstream as soon https://github.com/theoremlp/rules_mypy/pull/54 is merged
git_override(
module_name = "rules_mypy",
commit = "9a8ddd0a166830ea89f7d05311030df708762272",
remote = "https://github.com/Synss/rules_mypy",
)
bazel_dep(name = "aspect_rules_py", version = "0.7.4")
# TODO (TBC): Switch back to upstream as soon as https://github.com/aspect-build/rules_py/pull/428 is merged
git_override(
module_name = "aspect_rules_py",
commit = "6a3242d016798c6892a848939e36cc7bff99d6c8",
remote = "https://github.com/TimotheusBachinger/rules_py",
)
bazel_dep(name = "aspect_rules_lint", version = "1.0.2")
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
environment = {
# Hack for building extensions from source.
# See also: https://github.com/bazelbuild/rules_python/issues/1463
"CC": "gcc-13",
},
hub_name = "cmk_requirements",
python_version = PYTHON_VERSION,
requirements_by_platform = {
"@//:requirements_lock.txt": "linux_*",
},
)
use_repo(pip, "cmk_requirements")
types = use_extension("@rules_mypy//mypy:types.bzl", "types")
types.requirements(
name = "cmk_types",
pip_requirements = "@cmk_requirements//:requirements.bzl",
requirements_txt = "//:requirements_lock.txt",
)
use_repo(types, "cmk_types")
# Keep in synch with Pipfile---will work automatically when we drop pipenv
bazel_dep(name = "protobuf", version = "28.3", repo_name = "com_google_protobuf")
bazel_dep(name = "rules_proto_grpc", version = "5.0.1")
fork_cc_toolchain_config = use_repo_rule("//bazel/toolchains/cc:fork_cc_toolchain_config.bzl", "fork_cc_toolchain_config")
fork_cc_toolchain_config(
name = "forked_cc_toolchain_config",
)
register_toolchains("//bazel/toolchains/cc:linux_gcc13")
# bazel_skylib: Required for setting up rules_foreign_cc
bazel_dep(name = "bazel_skylib", version = "1.7.1")
single_version_override(
module_name = "rules_foreign_cc",
patch_strip = 1,
patches = ["//omd/packages/foreign_cc:symlink.patch"],
)
bazel_dep(name = "rules_foreign_cc", version = "0.11.1")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
PATCH_VERSION = "2.7.6"
PATCH_FILENAME = "patch-" + PATCH_VERSION + ".tar.gz"
http_archive(
name = "patch",
build_file = "//omd/packages/patch:BUILD.patch.bazel",
patch_args = ["-p1"],
patch_tool = "patch",
patches = [
"//omd/packages/patch/patches:ed-style-01-missing-input-files.patch.dif",
"//omd/packages/patch/patches:ed-style-02-fix-arbitrary-command-execution.patch.dif",
"//omd/packages/patch/patches:ed-style-03-update-test-Makefile.patch.dif",
"//omd/packages/patch/patches:ed-style-04-invoke-ed-directly.patch.dif",
"//omd/packages/patch/patches:ed-style-05-minor-cleanups.patch.dif",
"//omd/packages/patch/patches:ed-style-06-fix-test-failure.patch.dif",
"//omd/packages/patch/patches:ed-style-07-dont-leak-tmp-file.patch.dif",
"//omd/packages/patch/patches:ed-style-08-dont-leak-tmp-file-multi.patch.dif",
"//omd/packages/patch/patches:fix-segfault-mangled-rename.patch.dif",
],
sha256 = "8cf86e00ad3aaa6d26aca30640e86b0e3e1f395ed99f189b06d4c9f74bc58a4e",
strip_prefix = "patch-" + PATCH_VERSION,
urls = [
"https://ftp.gnu.org/gnu/patch/patch-" + PATCH_FILENAME,
UPSTREAM_MIRROR_URL + PATCH_FILENAME,
],
)