-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
93 lines (80 loc) · 2.91 KB
/
MODULE.bazel
File metadata and controls
93 lines (80 loc) · 2.91 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
module(
name = "shimmer_mojo",
version = "0.1.0",
)
PACKAGE_VERSION = "26.1.0.dev2025121405"
BASE_URL = "https://dl.modular.com/public/nightly/python"
bazel_dep(name = "rules_mojo", version = "0.6.0")
bazel_dep(name = "rules_cc", version = "0.1.1")
bazel_dep(name = "rules_foreign_cc", version = "0.13.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_python", version = "1.3.0")
bazel_dep(name = "rules_uv", version = "0.89.2")
# Use latest rules_mojo from main branch (0.6.0 has outdated Mojo version)
git_override(
module_name = "rules_mojo",
remote = "https://github.com/modular/rules_mojo.git",
commit = "f2bda941410fb67b394ba43373f1eca294bf8cd7",
)
# Configure Mojo toolchain with the same version as pixi.lock
mojo = use_extension("@rules_mojo//mojo:extensions.bzl", "mojo")
mojo.toolchain(
base_url = BASE_URL,
version = "0." + PACKAGE_VERSION,
use_prebuilt_packages = True,
)
# Configure GPU toolchains for Metal (macOS)
mojo.gpu_toolchains(
supported_gpus = {
"metal3": "metal:3",
"metal4": "metal:4",
},
gpu_mapping = {
"Metal 3": "metal3",
"Metal 4": "metal4",
},
)
# Make GPU toolchains available
use_repo(mojo, "mojo_gpu_toolchains", "mojo_toolchains")
# Native library dependencies via http_archive
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# GLFW - windowing library
http_archive(
name = "glfw",
build_file = "//third_party:glfw.BUILD.bazel",
sha256 = "b5ec004b2712fd08e8861dc271428f048775200a2df719ccf575143ba749a3e9",
strip_prefix = "glfw-3.4",
urls = ["https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip"],
)
# wgpu-native - WebGPU implementation (prebuilt)
http_archive(
name = "wgpu_native",
build_file = "//third_party:wgpu.BUILD.bazel",
sha256 = "98b7719174b529b53aedac3f506a664f8b5e66e27436e277b2df53543a76f4b3",
urls = ["https://github.com/gfx-rs/wgpu-native/releases/download/v22.1.0.5/wgpu-macos-aarch64-release.zip"],
)
# cimgui - ImGui C bindings (built from source)
git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
git_repository(
name = "cimgui_src",
remote = "https://github.com/cimgui/cimgui.git",
branch = "docking_inter",
build_file = "//third_party:cimgui.BUILD.bazel",
init_submodules = True,
recursive_init_submodules = True,
)
# Python toolchain for mblack
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.12",
is_default = True,
)
# mblack and dependencies via pip.parse (mblack from modular nightly, deps from PyPI)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pip",
python_version = "3.12",
requirements_lock = "//:requirements.lock",
)
use_repo(pip, "pip")