WORKSPACE (3196B) - Raw
1 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 2 3 ## LLVM 4 5 BAZEL_TOOLCHAIN_TAG = "0.7.2" 6 7 BAZEL_TOOLCHAIN_SHA = "f7aa8e59c9d3cafde6edb372d9bd25fb4ee7293ab20b916d867cd0baaa642529" 8 9 http_archive( 10 name = "com_grail_bazel_toolchain", 11 canonical_id = BAZEL_TOOLCHAIN_TAG, 12 sha256 = BAZEL_TOOLCHAIN_SHA, 13 strip_prefix = "bazel-toolchain-{tag}".format(tag = BAZEL_TOOLCHAIN_TAG), 14 url = "https://github.com/grailbio/bazel-toolchain/archive/{tag}.tar.gz".format(tag = BAZEL_TOOLCHAIN_TAG), 15 ) 16 17 load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies") 18 19 bazel_toolchain_dependencies() 20 21 load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain") 22 23 LLVM_VERSION = "14.0.0" 24 25 llvm_toolchain( 26 name = "llvm_toolchain", 27 llvm_version = LLVM_VERSION, 28 ) 29 30 # This sysroot is used by github.com/vsco/bazel-toolchains. 31 http_archive( 32 name = "org_chromium_sysroot_linux_x64", 33 build_file_content = """ 34 filegroup( 35 name = "sysroot", 36 srcs = glob(["*/**"]), 37 visibility = ["//visibility:public"], 38 ) 39 """, 40 sha256 = "84656a6df544ecef62169cfe3ab6e41bb4346a62d3ba2a045dc5a0a2ecea94a3", 41 urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_amd64_sysroot.tar.xz"], 42 ) 43 44 llvm_toolchain( 45 name = "llvm_toolchain_with_sysroot", 46 llvm_version = LLVM_VERSION, 47 sysroot = { 48 "linux-x86_64": "@org_chromium_sysroot_linux_x64//:sysroot", 49 }, 50 # We can share the downloaded LLVM distribution with the first configuration. 51 toolchain_roots = { 52 "": "@llvm_toolchain_llvm//", 53 }, 54 ) 55 56 load("@llvm_toolchain_with_sysroot//:toolchains.bzl", "llvm_register_toolchains") 57 58 #llvm_register_toolchains() 59 60 ### ZIG 61 62 HERMETIC_CC_TOOLCHAIN_VERSION = "v2.0.0-rc1" 63 64 http_archive( 65 name = "hermetic_cc_toolchain", 66 sha256 = "43a1b398f08109c4f03b9ba2b3914bd43d1fec0425f71b71f802bf3f78cee0c2", 67 urls = [ 68 "https://mirror.bazel.build/github.com/uber/hermetic_cc_toolchain/releases/download/{0}/{0}.tar.gz".format(HERMETIC_CC_TOOLCHAIN_VERSION), 69 "https://github.com/uber/hermetic_cc_toolchain/releases/download/{0}/{0}.tar.gz".format(HERMETIC_CC_TOOLCHAIN_VERSION), 70 ], 71 ) 72 73 load("@hermetic_cc_toolchain//toolchain:defs.bzl", zig_toolchains = "toolchains") 74 75 zig_toolchains( 76 #host_platform_sha256 = { 77 # "linux-aarch64": "", 78 # "linux-x86_64": "637d0f87b2cb409e1fad28e1f65a4f3645ecda467e4e2f96fe9c6959937f7c93", 79 # "macos-aarch64": "", 80 # "macos-x86_64": "", 81 # "windows-x86_64": "", 82 #}, 83 ## first "unofficial release" with multi-for syntax and still on llvm15 84 #version = "0.11.0-dev.2336+5b82b4004", 85 ) 86 87 88 register_toolchains( 89 # amd64 toolchains for libc-aware platforms: 90 "@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.19", 91 "@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.28", 92 "@zig_sdk//libc_aware/toolchain:linux_amd64_gnu.2.31", 93 "@zig_sdk//libc_aware/toolchain:linux_amd64_musl", 94 # arm64 toolchains for libc-aware platforms: 95 "@zig_sdk//libc_aware/toolchain:linux_arm64_gnu.2.28", 96 "@zig_sdk//libc_aware/toolchain:linux_arm64_musl", 97 )