tests with sysroot

This commit is contained in:
2022-12-11 15:55:21 +02:00
parent 68f1293511
commit a6083e555c
2 changed files with 50 additions and 16 deletions

View File

@@ -19,12 +19,41 @@ bazel_toolchain_dependencies()
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
LLVM_VERSION = "14.0.0"
llvm_toolchain(
name = "llvm_toolchain",
llvm_version = "14.0.0",
llvm_version = LLVM_VERSION,
)
load("@llvm_toolchain//:toolchains.bzl", "llvm_register_toolchains")
# 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"],
)
""",
sha256 = "84656a6df544ecef62169cfe3ab6e41bb4346a62d3ba2a045dc5a0a2ecea94a3",
urls = ["https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/2202c161310ffde63729f29d27fe7bb24a0bc540/debian_stretch_amd64_sysroot.tar.xz"],
)
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//",
},
)
load("@llvm_toolchain_with_sysroot//:toolchains.bzl", "llvm_register_toolchains")
#llvm_register_toolchains()