Documentation

Edit

Platform Rules

constraint_setting

constraint_setting(name, deprecation, distribs, features, licenses, tags, testonly, visibility)

This rule defines a type of constraint that can be used to define an execution platform.

Arguments

Attributes
name

Name; required

A unique name for this rule.

constraint_value

constraint_value(name, constraint_setting, deprecation, distribs, features, licenses, tags, testonly, visibility)

This rule defines a specific value of a constraint, which can be used to define execution platforms.

Arguments

Attributes
name

Name; required

A unique name for this rule.

constraint_setting

Label; required

The constraint_setting rule this value is applied to.

platform

platform(name, constraint_values, deprecation, distribs, features, licenses, remote_execution_properties, tags, testonly, visibility)

This rule defines a platform, as a collection of constraint_values.

Examples

This defines two possible platforms, each targeting a different CPU type.

constraint_setting(name="cpu")
constraint_value(
    name="arm64",
    constraint=":cpu")
constraint_value(
    name="k8",
    constraint=":cpu")
platform(
    name="mobile_device",
    constraint_values = [
        ":arm64",
    ])
platform(
    name="devel",
    constraint_values = [
        ":k8",
    ])

Arguments

Attributes
name

Name; required

A unique name for this rule.

constraint_values

List of labels; optional

The constraint_values that define this platform.
remote_execution_properties

Dictionary: String -> String; optional

A key/value dict of values that will be sent to a remote execution platform.

toolchain

toolchain(name, deprecation, distribs, exec_compatible_with, features, licenses, tags, target_compatible_with, testonly, toolchain, toolchain_type, visibility)

This rule declares a specific toolchain's type and constraints so that it can be selected during toolchain resolution.

Arguments

Attributes
name

Name; required

A unique name for this rule.

exec_compatible_with

List of labels; optional; nonconfigurable

The constraints, as defined by constraint_value() and constraint_setting(), that are required on the execution platform for this toolchain to be selected.
target_compatible_with

List of labels; optional; nonconfigurable

The constraints, as defined by constraint_value() and constraint_setting(), that are required on the target platform for this toolchain to be selected.
toolchain

Name; required; nonconfigurable

The label of the actual toolchain data to be used when this toolchain is selected.
toolchain_type

Name; required; nonconfigurable

The type of the toolchain, which should be the label of a toolchain_type() target.