bazel-contrib / toolchains_llvm

LLVM toolchain for bazel
Apache License 2.0
283 stars 206 forks source link

Allow explicitly specifying Linux distribution #327

Open illicitonion opened 2 months ago

illicitonion commented 2 months ago

Without this, if you want to do remote execution from a non-Linux (or different Linux) platform to a Linux platform, you need to explicitly fill in the URLs attribute.

With this, you can write something like:

llvm_toolchain(
    name = "llvm_toolchain_linux_x86_64",
    llvm_version = "14.0.0",
    exec_os = "linux",
    exec_arch = "x86_64",
    exec_linux_distribution = "ubuntu",
    exec_linux_distribution_version = "18.04",
    sysroot = {
        "linux-x86_64": "@org_chromium_sysroot_linux_x64//:sysroot",
    },
)

which will work when remote building from macOS, because it won't attempt to read the Linux distribution from /etc/os-release which doesn't exist on macOS.