Documentation

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, 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.

platform

platform(name, deprecation, distribs, features, licenses, 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",
    constraints = [
        ":arm64",
    ])
platform(
    name="devel",
    constraints = [
        ":k8",
    ])

Arguments

Attributes
name

Name; required

A unique name for this rule.