-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMODULE.bazel
More file actions
74 lines (59 loc) · 1.84 KB
/
MODULE.bazel
File metadata and controls
74 lines (59 loc) · 1.84 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
module(
name = "rules_mojo",
version = "0",
bazel_compatibility = [">=8.0.0"],
)
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_cc", version = "0.2.16")
bazel_dep(name = "rules_python", version = "1.0.0")
# Apply this patch in your project if you want to use shared libraries with mojo
single_version_override(
module_name = "rules_cc",
patch_strip = 1,
patches = [
# https://github.com/bazelbuild/rules_cc/pull/578
"//tools:rules_cc.patch",
],
)
mojo = use_extension("//mojo:extensions.bzl", "mojo")
mojo.toolchain()
mojo.gpu_toolchains()
use_repo(mojo, "mojo_gpu_toolchains", "mojo_host_platform", "mojo_toolchains")
register_toolchains("@mojo_toolchains//...", "@mojo_gpu_toolchains//...")
_DEFAULT_PYTHON_VERSION = "3.12"
_PYTHON_VERSIONS = [
"3.10",
"3.11",
"3.12",
"3.13",
]
python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
[
python.toolchain(
ignore_root_user_error = True,
is_default = version == _DEFAULT_PYTHON_VERSION,
python_version = version,
)
for version in _PYTHON_VERSIONS
]
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
[
pip.parse(
hub_name = "rules_mojo_test_deps",
python_version = version,
requirements_lock = "tests/python/requirements.txt",
)
for version in _PYTHON_VERSIONS
]
use_repo(pip, "rules_mojo_test_deps")
versions = use_repo_rule("//tests:versions.bzl", "versions")
versions(
name = "versions",
dev_dependency = True,
python_versions = _PYTHON_VERSIONS,
)
link_hack = use_repo_rule("//mojo/private:link_hack.bzl", "link_hack")
link_hack(
name = "build_bazel_rules_android", # See link_hack.bzl for details
)