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

null; optional

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