2022-10-19 11:35:55 +03:00
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
|
|
|
|
2022-12-12 09:43:08 +02:00
|
|
|
## LLVM
|
2022-10-19 11:35:55 +03:00
|
|
|
|
|
|
|
BAZEL_TOOLCHAIN_TAG = "0.7.2"
|
2022-12-13 18:57:12 +02:00
|
|
|
|
2022-10-19 11:35:55 +03:00
|
|
|
BAZEL_TOOLCHAIN_SHA = "f7aa8e59c9d3cafde6edb372d9bd25fb4ee7293ab20b916d867cd0baaa642529"
|
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "com_grail_bazel_toolchain",
|
2022-12-13 18:57:12 +02:00
|
|
|
canonical_id = BAZEL_TOOLCHAIN_TAG,
|
2022-10-19 11:35:55 +03:00
|
|
|
sha256 = BAZEL_TOOLCHAIN_SHA,
|
|
|
|
strip_prefix = "bazel-toolchain-{tag}".format(tag = BAZEL_TOOLCHAIN_TAG),
|
|
|
|
url = "https://github.com/grailbio/bazel-toolchain/archive/{tag}.tar.gz".format(tag = BAZEL_TOOLCHAIN_TAG),
|
|
|
|
)
|
|
|
|
|
|
|
|
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
|
|
|
|
|
|
|
|
bazel_toolchain_dependencies()
|
|
|
|
|
|
|
|
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
|
|
|
|
|
2022-12-11 15:55:21 +02:00
|
|
|
LLVM_VERSION = "14.0.0"
|
|
|
|
|
2022-10-19 11:35:55 +03:00
|
|
|
llvm_toolchain(
|
|
|
|
name = "llvm_toolchain",
|
2022-12-11 15:55:21 +02:00
|
|
|
llvm_version = LLVM_VERSION,
|
|
|
|
)
|
|
|
|
|
|
|
|
# This sysroot is used by github.com/vsco/bazel-toolchains.
|
|
|
|
http_archive(
|
|
|
|
name = "org_chromium_sysroot_linux_x64",
|
|
|
|
build_file_content = """
|
|
|
|
filegroup(
|
|
|
|
name = "sysroot",
|
|
|
|
srcs = glob(["*/**"]),
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
""",
|
2022-12-13 18:57:12 +02:00
|
|
|
sha256 = "84656a6df544ecef62169cfe3ab6e41bb4346a62d3ba2a045dc5a0a2ecea94a3",
|
|
|
|
urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_amd64_sysroot.tar.xz"],
|
2022-12-11 15:55:21 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
llvm_toolchain(
|
|
|
|
name = "llvm_toolchain_with_sysroot",
|
|
|
|
llvm_version = LLVM_VERSION,
|
|
|
|
sysroot = {
|
|
|
|
"linux-x86_64": "@org_chromium_sysroot_linux_x64//:sysroot",
|
|
|
|
},
|
|
|
|
# We can share the downloaded LLVM distribution with the first configuration.
|
|
|
|
toolchain_roots = {
|
|
|
|
"": "@llvm_toolchain_llvm//",
|
|
|
|
},
|
2022-10-19 11:35:55 +03:00
|
|
|
)
|
|
|
|
|
2022-12-11 15:55:21 +02:00
|
|
|
load("@llvm_toolchain_with_sysroot//:toolchains.bzl", "llvm_register_toolchains")
|
2022-10-19 11:35:55 +03:00
|
|
|
|
|
|
|
#llvm_register_toolchains()
|
|
|
|
|
|
|
|
### ZIG
|
|
|
|
|
2023-04-17 14:29:54 +03:00
|
|
|
#BAZEL_ZIG_CC_VERSION = "v1.0.1"
|
|
|
|
BAZEL_ZIG_CC_VERSION = "60a9f12d67f5b6a5a79d1b45b07ded41cdbb96fe"
|
2022-10-19 11:35:55 +03:00
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "bazel-zig-cc",
|
2023-04-17 14:29:54 +03:00
|
|
|
#sha256 = "e9f82bfb74b3df5ca0e67f4d4989e7f1f7ce3386c295fd7fda881ab91f83e509",
|
|
|
|
sha256 = "b005e86324022ffe040d47b0bf8216a527b403620cfb7b14c162224c6884afb8",
|
2022-10-19 11:35:55 +03:00
|
|
|
strip_prefix = "bazel-zig-cc-{}".format(BAZEL_ZIG_CC_VERSION),
|
|
|
|
urls = [
|
2023-04-17 14:29:54 +03:00
|
|
|
"https://github.com/motiejus/bazel-zig-cc/archive/{}.tar.gz".format(BAZEL_ZIG_CC_VERSION),
|
|
|
|
#"https://mirror.bazel.build/github.com/uber/bazel-zig-cc/releases/download/{0}/{0}.tar.gz".format(BAZEL_ZIG_CC_VERSION),
|
|
|
|
#"https://github.com/uber/bazel-zig-cc/releases/download/{0}/{0}.tar.gz".format(BAZEL_ZIG_CC_VERSION),
|
2022-10-19 11:35:55 +03:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
load("@bazel-zig-cc//toolchain:defs.bzl", zig_toolchains = "toolchains")
|
|
|
|
|
2023-04-17 14:29:54 +03:00
|
|
|
ZIG_VERSION = "0.11.0-dev.2441+eb19f73af-dbgsafe"
|
|
|
|
ZIG_HASH = "fde61f641a557ec01784c99a62e5e7fde78d17c306280af851f469ff14c1e5a5"
|
|
|
|
|
|
|
|
#ZIG_VERSION = "0.11.0-dev.2441+eb19f73af"
|
|
|
|
#ZIG_HASH = "aa06f10bb1407d83eae790cba6be4721ec3e02e63aa209192a8919fc25db8544"
|
|
|
|
|
2022-12-15 22:12:43 +02:00
|
|
|
zig_toolchains(
|
|
|
|
host_platform_sha256 = {
|
2023-04-17 14:29:54 +03:00
|
|
|
"linux-aarch64": "",
|
|
|
|
"linux-x86_64": ZIG_HASH,
|
|
|
|
"macos-aarch64": "",
|
|
|
|
"macos-x86_64": "",
|
|
|
|
"windows-x86_64": "",
|
2022-12-15 22:12:43 +02:00
|
|
|
},
|
2023-04-17 14:29:54 +03:00
|
|
|
url_formats = ["https://dl.jakstys.lt/ntpad/zig/zig-{host_platform}-{version}.{_ext}"],
|
|
|
|
version = ZIG_VERSION,
|
|
|
|
#version = "0.11.0-dev.811+8ff9284c4",
|
2022-12-15 22:12:43 +02:00
|
|
|
)
|
2022-10-19 11:35:55 +03:00
|
|
|
|
|
|
|
register_toolchains(
|
|
|
|
# amd64 toolchains for libc-aware platforms:
|
|
|
|
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.19",
|
|
|
|
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.28",
|
|
|
|
"@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.31",
|
|
|
|
"@zig_sdk//libc_aware/toolchain:linux_amd64_musl",
|
|
|
|
# arm64 toolchains for libc-aware platforms:
|
|
|
|
"@zig_sdk//libc_aware/toolchain:linux_arm64_gnu.2.28",
|
|
|
|
"@zig_sdk//libc_aware/toolchain:linux_arm64_musl",
|
|
|
|
)
|