-
Notifications
You must be signed in to change notification settings - Fork 45
/
MODULE.bazel
65 lines (55 loc) · 2.25 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
module(
name = "hermetic_cc_toolchain",
version = "3.1.1",
)
bazel_dep(name = "platforms", version = "0.0.8")
bazel_dep(name = "rules_go", version = "0.45.1", dev_dependency = True)
go_sdk = use_extension(
"@rules_go//go:extensions.bzl",
"go_sdk",
dev_dependency = True,
)
use_repo(go_sdk, "go_default_sdk")
bazel_dep(name = "gazelle", version = "0.35.0", dev_dependency = True)
go_deps = use_extension(
"@gazelle//:extensions.bzl",
"go_deps",
dev_dependency = True,
)
go_deps.from_file(go_mod = "//:go.mod")
use_repo(
go_deps,
"com_github_bazelbuild_buildtools",
"com_github_stretchr_testify",
"com_github_tetratelabs_wazero",
)
toolchains = use_extension("//toolchain:ext.bzl", "toolchains")
use_repo(toolchains, "zig_sdk", "zig_sdk-linux-amd64", "zig_sdk-linux-arm64", "zig_sdk-macos-amd64", "zig_sdk-macos-arm64", "zig_sdk-windows-amd64")
_COMMON_EXEC_PLATFORMS = [
("linux", "amd64"),
("linux", "arm64"),
("windows", "amd64"),
("macos", "arm64"),
("macos", "amd64"),
]
[register_toolchains(
# if no `--platform` is specified, these toolchains will be used for
# (linux,darwin,windows)x(amd64,arm64)
"@zig_sdk-{}-{}//toolchain:linux_amd64_gnu.2.28".format(os, arch),
"@zig_sdk-{}-{}//toolchain:linux_arm64_gnu.2.28".format(os, arch),
"@zig_sdk-{}-{}//toolchain:windows_amd64".format(os, arch),
"@zig_sdk-{}-{}//toolchain:windows_arm64".format(os, arch),
# "@zig_sdk-{}-{}//toolchain:darwin_amd64".format(os, arch),
# "@zig_sdk-{}-{}//toolchain:darwin_arm64".format(os, arch),
# amd64 toolchains for libc-aware platforms:
"@zig_sdk-{}-{}//libc_aware/toolchain:linux_amd64_gnu.2.28".format(os, arch),
"@zig_sdk-{}-{}//libc_aware/toolchain:linux_amd64_gnu.2.31".format(os, arch),
"@zig_sdk-{}-{}//libc_aware/toolchain:linux_amd64_musl".format(os, arch),
# arm64 toolchains for libc-aware platforms:
"@zig_sdk-{}-{}//libc_aware/toolchain:linux_arm64_gnu.2.28".format(os, arch),
"@zig_sdk-{}-{}//libc_aware/toolchain:linux_arm64_musl".format(os, arch),
# wasm/wasi toolchains
"@zig_sdk-{}-{}//toolchain:wasip1_wasm".format(os, arch),
# These toolchains are only registered locally.
dev_dependency = True,
) for os, arch in _COMMON_EXEC_PLATFORMS]