fuchsia_clang_repository

Loads a particular version of clang.

One of cipd_tag or local_archive must be set.

If cipd_tag is set, sha256 can optionally be set to verify the downloaded file and to allow Bazel to cache the file.

If cipd_tag is not set, local_archive must be set to the path of a core IDK archive file.

ATTRIBUTES

Name Description Type Mandatory Default
name A unique name for this repository. Name required -
repo_mapping In WORKSPACE context only: a dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

This attribute is not supported in MODULE.bazel context (when invoking a repository rule inside a module extension's implementation function).
String Dict optional -
cipd_tag CIPD tag for the version to load. String optional ""
sha256 Optional SHA-256 hash of the clang archive. Valid keys are mac and linux String Dict optional {}
local_archive local clang archive file. String optional ""
local_path local clang installation directory, relative to workspace root. String optional ""
from_workspace Any label to a bazel external workspace containing a clang installation. Label optional None
local_version_file Optional path to a workspace-relative path to a version file for this clang installation. Label optional None
sdk_root_label DEPRECATED - The fuchsia sdk root label. eg: @fuchsia_sdk Label optional "@fuchsia_sdk"
sysroot_paths sysroot paths by Bazel arch, relative to execroot String Dict optional {"aarch64": "external/fuchsia_sdk/arch/arm64/sysroot", "x86_64": "external/fuchsia_sdk/arch/x64/sysroot", "riscv64": "external/fuchsia_sdk/arch/riscv64/sysroot"}
sysroot_headers Sysroot headers filegroups by Bazel arch. These will be added to compiler files of cc_toolchain. Values should be labels pointing to filegroups covering all the headers that must appear in the sandbox of C++ compilation actions. See default value for example. String Dict optional {"aarch64": "@fuchsia_sdk//:fuchsia-sysroot-headers-aarch64", "x86_64": "@fuchsia_sdk//:fuchsia-sysroot-headers-x86_64", "riscv64": "@fuchsia_sdk//:fuchsia-sysroot-headers-riscv64"}
sysroot_libs Sysroot libraries filegroups by Bazel arch. These will be added to linker files of cc_toolchain. Values should be labels pointing to filegroups covering all the libraries that must appear in the sandbox of C++ linking actions. See default value for example. String Dict optional {"aarch64": "@fuchsia_sdk//:fuchsia-sysroot-libraries-aarch64", "x86_64": "@fuchsia_sdk//:fuchsia-sysroot-libraries-x86_64", "riscv64": "@fuchsia_sdk//:fuchsia-sysroot-libraries-riscv64"}
rules_fuchsia_root_label The fuchsia workspace rules root label. eg: @fuchsia_sdk Label optional "@fuchsia_sdk"
cipd_ensure_file A cipd ensure file to use to download clang. Label optional None
cipd_bin The cipd binary that will be used to download the sdk Label optional None

ENVIRONMENT VARIABLES

This repository rule depends on the following environment variables:

  • LOCAL_FUCHSIA_PLATFORM_BUILD* LOCAL_FUCHSIA_CLANG_VERSION_FILE