forked from modular/modular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
116 lines (93 loc) · 3.8 KB
/
MODULE.bazel
File metadata and controls
116 lines (93 loc) · 3.8 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
"""Define bazel dependencies."""
module(
name = "modular",
version = "0",
)
include("//bazel:common.MODULE.bazel")
bazel_dep(name = "toolchains_llvm", version = "1.4.0", dev_dependency = True)
single_version_override(
module_name = "toolchains_llvm",
patch_strip = 1,
patches = [
"//bazel:toolchains_llvm.patch",
],
)
mojo_aliases = use_repo_rule("//bazel:mojo_aliases.bzl", "mojo_aliases")
mojo_aliases(name = "mojo")
mblack_alias = use_repo_rule("//bazel:mblack_alias.bzl", "mblack_alias")
mblack_alias(name = "mblack")
modular_wheel_repository = use_repo_rule("//bazel:modular_wheel_repository.bzl", "modular_wheel_repository")
modular_wheel_repository(name = "modular_wheel")
include("//bazel:mojo.MODULE.bazel")
register_toolchains("@mojo_toolchains//...")
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True)
llvm.toolchain(
name = "llvm_toolchain",
llvm_versions = {
"linux-aarch64": "20.1.1",
"linux-x86_64": "20.1.1",
},
sha256 = {
"linux-aarch64": "86314680f7abea8e054d635c0e54b3f3f6993f8e826df0da8cfd02e456976625",
"linux-x86_64": "58d7a1a8fa22a001794e82a8e9ca441e12fb6d62fd8b7d47040df58a459dec8e",
},
stdlib = {
"linux-aarch64": "dynamic-stdc++",
"linux-x86_64": "dynamic-stdc++",
},
urls = {
"linux-aarch64": ["https://github.com/dzbarsky/static-clang/releases/download/v20.1.1/linux_arm64.tar.xz"],
"linux-x86_64": ["https://github.com/dzbarsky/static-clang/releases/download/v20.1.1/linux_amd64.tar.xz"],
},
)
use_repo(llvm, "llvm_toolchain")
register_toolchains("@llvm_toolchain//:all")
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# This section is derived from the full LLVM workspace, available at
# llvm-project/utils/bazel/WORKSPACE. If there are changes in
# LLVM that require updating these dependencies, this file may also need to
# be updated in the future.
http_archive(
name = "llvm_zlib",
build_file = "@llvm-raw//utils/bazel/third_party_build:zlib-ng.BUILD",
dev_dependency = True,
sha256 = "e36bb346c00472a1f9ff2a0a4643e590a254be6379da7cddd9daeb9a7f296731",
strip_prefix = "zlib-ng-2.0.7",
urls = [
"https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.0.7.zip",
],
)
http_archive(
name = "llvm_zstd",
build_file = "@llvm-raw//utils/bazel/third_party_build:zstd.BUILD",
dev_dependency = True,
sha256 = "7c42d56fac126929a6a85dbc73ff1db2411d04f104fae9bdea51305663a83fd0",
strip_prefix = "zstd-1.5.2",
urls = [
"https://github.com/facebook/zstd/releases/download/v1.5.2/zstd-1.5.2.tar.gz",
],
)
# NOTE: These versions don't particularly match what modular uses internally, this is only used for test dependencies
LLVM_COMMIT = "6274cdb9a6714908c8a4e30d2ef0bf22a6949065"
LLVM_SHA = "ee26cf9d90a87bd02f10f0846cda0f2e82e4d930a3704d5c790cb2ee76f44124"
http_archive(
name = "llvm-raw",
build_file_content = "exports_files(glob([\"**\"]))",
dev_dependency = True,
sha256 = LLVM_SHA,
strip_prefix = "llvm-project-{}".format(LLVM_COMMIT),
url = "https://github.com/llvm/llvm-project/archive/{}.tar.gz".format(LLVM_COMMIT),
)
llvm_configure = use_repo_rule("@llvm-raw//utils/bazel:configure.bzl", "llvm_configure")
llvm_configure(name = "llvm-project")
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
data = ["//bazel/lint:package.json"],
npm_package_lock = "//bazel/lint:package-lock.json",
pnpm_lock = "//bazel/lint:pnpm-lock.yaml",
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")
pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True)
use_repo(pnpm, "pnpm")