-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMODULE.bazel
More file actions
127 lines (110 loc) · 3.42 KB
/
MODULE.bazel
File metadata and controls
127 lines (110 loc) · 3.42 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
module(name = "starconf")
bazel_dep(name = "rules_cc", version = "0.2.9")
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(
name = "rules_rust",
version = "0.59.2",
)
crate = use_extension(
"@rules_rust//crate_universe:extension.bzl",
"crate",
)
crate.from_cargo(
name = "crate_index",
cargo_lockfile = "//:Cargo.lock",
manifests = ["//:Cargo.toml"],
supported_platform_triples = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
],
)
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
extra_target_triples = [
"aarch64-apple-darwin",
"aarch64-unknown-linux-gnu",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
],
versions = ["1.81.0"],
)
use_repo(rust, "rust_toolchains")
register_toolchains("@rust_toolchains//:all")
use_repo(crate, "crate_index")
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True)
llvm.toolchain(
name = "llvm_toolchain",
llvm_versions = {
"": "16.0.0",
"darwin-x86_64": "15.0.7", # For CI runner only; remove if you don't have an Intel Mac.
},
stdlib = {
"linux-aarch64": "stdc++",
"linux-x86_64": "stdc++",
},
)
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
_SYSROOT_LINUX_BUILD_FILE = """\
filegroup(
name = "sysroot",
srcs = glob(["*/**"]),
visibility = ["//visibility:public"],
)
"""
http_archive(
name = "org_chromium_sysroot_linux_arm64",
build_file_content = _SYSROOT_LINUX_BUILD_FILE,
sha256 = "b199942a0bd9c34800e8d7b669778ef45f2054b9f106039439383dd66efcef31",
urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_arm64_sysroot.tar.xz"],
)
http_archive(
name = "org_chromium_sysroot_linux_x86_64",
build_file_content = _SYSROOT_LINUX_BUILD_FILE,
sha256 = "b279dd2926e7d3860bb4e134997a45df5106f680e160a959b945580ba4ec755f",
urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_amd64_sysroot.tar.xz"],
)
http_archive(
name = "sysroot_darwin_universal",
build_file_content = """
filegroup(
name = "sysroot",
srcs = glob(
include = ["**"],
exclude = ["**/*:*"],
),
visibility = ["//visibility:public"],
)
""",
# The ruby header has an infinite symlink that we need to remove.
patch_cmds = ["rm System/Library/Frameworks/Ruby.framework/Versions/Current/Headers/ruby/ruby"],
integrity = "sha256-9qzGIJ251Wtn/K+R7B3v5Ici6esT3CH7kc/s6xSJ5X4=",
strip_prefix = "MacOSX14.5.sdk",
urls = ["https://github.com/alexey-lysiuk/macos-sdk/releases/download/14.5/MacOSX14.5.tar.xz"],
)
llvm.sysroot(
name = "llvm_toolchain",
label = "@org_chromium_sysroot_linux_x86_64//:sysroot",
targets = ["linux-x86_64"],
)
llvm.sysroot(
name = "llvm_toolchain",
label = "@org_chromium_sysroot_linux_arm64//:sysroot",
targets = ["linux-aarch64"],
)
llvm.sysroot(
name = "llvm_toolchain",
label = "@sysroot_darwin_universal//:sysroot",
targets = [
"darwin-aarch64",
"darwin-x86_64",
],
)
use_repo(llvm, "llvm_toolchain")
register_toolchains(
"@llvm_toolchain//:all",
dev_dependency = True,
)