<html devsite>
<head>
  <meta name="project_path" value="/_project.yaml">
  <meta name="book_path" value="/versions/7.2.0/_book.yaml">
</head>
<body>

<h1 class="page-title" id="modules.attr">attr</h1>

{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/starlarkbuildapi/StarlarkAttrModuleApi.java" %}
{% dynamic setvar version "7.2.0" %}
{% dynamic setvar original_path "/rules/lib/toplevel/attr" %}
{% include "_buttons.html" %}
<!-- {% raw %} -->

This is a top-level module for defining the attribute schemas of a rule or aspect. Each function returns an object representing the schema of a single attribute. These objects are used as the values of the <code>attrs</code> dictionary argument of <a href="../globals/bzl.html#rule"><code>rule()</code></a> and <a href="../globals/bzl.html#aspect"><code>aspect()</code></a>.<p>See the Rules page for more on <a href='https://bazel.build/versions/7.2.0/extending/rules#attributes'>defining</a> and <a href='https://bazel.build/versions/7.2.0/extending/rules#implementation_function'>using</a> attributes.

<h2>Members</h2>
<ul>
    <li>
    <a href="#bool">bool</a>
  </li>
      <li>
    <a href="#int">int</a>
  </li>
      <li>
    <a href="#int_list">int_list</a>
  </li>
      <li>
    <a href="#label">label</a>
  </li>
      <li>
    <a href="#label_keyed_string_dict">label_keyed_string_dict</a>
  </li>
      <li>
    <a href="#label_list">label_list</a>
  </li>
      <li>
    <a href="#output">output</a>
  </li>
      <li>
    <a href="#output_list">output_list</a>
  </li>
      <li>
    <a href="#string">string</a>
  </li>
      <li>
    <a href="#string_dict">string_dict</a>
  </li>
      <li>
    <a href="#string_list">string_list</a>
  </li>
      <li>
    <a href="#string_list_dict">string_list_dict</a>
  </li>
  </ul>

      <h2 id="bool">bool</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.bool(default=False, doc=None, mandatory=False)</pre></p>

    Creates a schema for a boolean attribute. The corresponding <a href='../builtins/ctx.html#attr'><code>ctx.attr</code></a> attribute will be of type <a href='../core/bool.html'><code>bool</code></a>.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="bool.default">
              <code>default</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="bool.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="bool.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="int">int</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.int(default=0, doc=None, mandatory=False, values=[])</pre></p>

    Creates a schema for an integer attribute. The value must be in the signed 32-bit range. The corresponding <a href='../builtins/ctx.html#attr'><code>ctx.attr</code></a> attribute will be of type <a href='../core/int.html'><code>int</code></a>.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="int.default">
              <code>default</code>
            </td>
            <td>
                                     default is <code>0</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="int.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="int.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="int.values">
              <code>values</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/int.html">int</a>s;
                                     default is <code>[]</code><br/>
                          The list of allowed values for the attribute. An error is raised if any other value is given.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="int_list">int_list</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.int_list(mandatory=False, allow_empty=True, *, default=[], doc=None)</pre></p>

    Creates a schema for a list-of-integers attribute. Each element must be in the signed 32-bit range.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="int_list.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="int_list.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="int_list.default">
              <code>default</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/int.html">int</a>s;
                                     default is <code>[]</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="int_list.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="label">label</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.label(default=None, doc=None, executable=False, allow_files=None, allow_single_file=None, mandatory=False, providers=[], allow_rules=None, cfg=None, aspects=[])</pre></p>

    <p>Creates a schema for a label attribute. This is a dependency attribute.</p><p>This attribute contains unique <a href='../builtins/Label.html'><code>Label</code></a> values. If a string is supplied in place of a <code>Label</code>, it will be converted using the <a href='../builtins/Label.html#Label'>label constructor</a>. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package.<p>At analysis time (within the rule's implementation function), when retrieving the attribute value from <code>ctx.attr</code>, labels are replaced by the corresponding <a href='../builtins/Target.html'><code>Target</code></a>s. This allows you to access the providers of the current target's dependencies.<p>In addition to ordinary source files, this kind of attribute is often used to refer to a tool -- for example, a compiler. Such tools are considered to be dependencies, just like source files. To avoid requiring users to specify the tool's label every time they use the rule in their BUILD files, you can hard-code the label of a canonical tool as the <code>default</code> value of this attribute. If you also want to prevent users from overriding this default, you can make the attribute private by giving it a name that starts with an underscore. See the <a href='https://bazel.build/versions/7.2.0/extending/rules#private-attributes'>Rules</a> page for more information.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="label.default">
              <code>default</code>
            </td>
            <td>
                          <a class="anchor" href="../builtins/Label.html">Label</a>; or <a class="anchor" href="../core/string.html">string</a>; or <a class="anchor" href="../builtins/LateBoundDefault.html">LateBoundDefault</a>; or NativeComputedDefault; or <a class="anchor" href="../core/function.html">function</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.Use a string or the <a href="../builtins/Label.html#Label"><code>Label</code></a> function to specify a default value, for example, <code>attr.label(default = "//a:b")</code>.
            </td>
          </tr>
                  <tr>
            <td id="label.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="label.executable">
              <code>executable</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          True if the dependency has to be executable. This means the label must refer to an executable file, or to a rule that outputs an executable file. Access the label with <code>ctx.executable.&lt;attribute_name&gt;</code>.
            </td>
          </tr>
                  <tr>
            <td id="label.allow_files">
              <code>allow_files</code>
            </td>
            <td>
                          <a class="anchor" href="../core/bool.html">bool</a>; or <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
                                     default is <code>None</code><br/>
                          Whether <code>File</code> targets are allowed. Can be <code>True</code>, <code>False</code> (default), or a list of file extensions that are allowed (for example, <code>[".cc", ".cpp"]</code>).
            </td>
          </tr>
                  <tr>
            <td id="label.allow_single_file">
              <code>allow_single_file</code>
            </td>
            <td>
                                     default is <code>None</code><br/>
                          This is similar to <code>allow_files</code>, with the restriction that the label must correspond to a single <a href="../builtins/File.html">File</a>. Access it through <code>ctx.file.&lt;attribute_name&gt;</code>.
            </td>
          </tr>
                  <tr>
            <td id="label.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="label.providers">
              <code>providers</code>
            </td>
            <td>
                                     default is <code>[]</code><br/>
                          The providers that must be given by any dependency appearing in this attribute.<p>The format of this argument is a list of lists of providers -- <code>*Info</code> objects returned by <a href='../globals/bzl.html#provider'><code>provider()</code></a> (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its <code>provides</code> parameter, however, it is considered best practice.
            </td>
          </tr>
                  <tr>
            <td id="label.allow_rules">
              <code>allow_rules</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
                                     default is <code>None</code><br/>
                          Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead.
            </td>
          </tr>
                  <tr>
            <td id="label.cfg">
              <code>cfg</code>
            </td>
            <td>
                                     default is <code>None</code><br/>
                          <a href="https://bazel.build/versions/7.2.0/extending/rules#configurations">Configuration</a> of the attribute. It can be either <code>"exec"</code>, which indicates that the dependency is built for the <code>execution platform</code>, or <code>"target"</code>, which indicates that the dependency is build for the <code>target platform</code>. A typical example of the difference is when building mobile apps, where the <code>target platform</code> is <code>Android</code> or <code>iOS</code> while the <code>execution platform</code> is <code>Linux</code>, <code>macOS</code>, or <code>Windows</code>. This parameter is required if <code>executable</code> is True to guard against accidentally building host tools in the target configuration. <code>"target"</code> has no semantic effect, so don't set it when <code>executable</code> is False unless it really helps clarify your intentions.
            </td>
          </tr>
                  <tr>
            <td id="label.aspects">
              <code>aspects</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../builtins/Aspect.html">Aspect</a>s;
                                     default is <code>[]</code><br/>
                          Aspects that should be applied to the dependency or dependencies specified by this attribute.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="label_keyed_string_dict">label_keyed_string_dict</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.label_keyed_string_dict(allow_empty=True, *, default={}, doc=None, allow_files=None, allow_rules=None, providers=[], flags=[], mandatory=False, cfg=None, aspects=[])</pre></p>

    <p>Creates a schema for an attribute holding a dictionary, where the keys are labels and the values are strings. This is a dependency attribute.</p><p>This attribute contains unique <a href='../builtins/Label.html'><code>Label</code></a> values. If a string is supplied in place of a <code>Label</code>, it will be converted using the <a href='../builtins/Label.html#Label'>label constructor</a>. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package.<p>At analysis time (within the rule's implementation function), when retrieving the attribute value from <code>ctx.attr</code>, labels are replaced by the corresponding <a href='../builtins/Target.html'><code>Target</code></a>s. This allows you to access the providers of the current target's dependencies.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="label_keyed_string_dict.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.default">
              <code>default</code>
            </td>
            <td>
                          <a class="anchor" href="../core/dict.html">dict</a>; or <a class="anchor" href="../core/function.html">function</a>;
                                     default is <code>{}</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the <a href="../builtins/Label.html#Label"><code>Label</code></a> function to specify default values, for example, <code>attr.label_keyed_string_dict(default = {"//a:b": "value", "//a:c": "string"})</code>.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.allow_files">
              <code>allow_files</code>
            </td>
            <td>
                          <a class="anchor" href="../core/bool.html">bool</a>; or <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
                                     default is <code>None</code><br/>
                          Whether <code>File</code> targets are allowed. Can be <code>True</code>, <code>False</code> (default), or a list of file extensions that are allowed (for example, <code>[".cc", ".cpp"]</code>).
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.allow_rules">
              <code>allow_rules</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
                                     default is <code>None</code><br/>
                          Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.providers">
              <code>providers</code>
            </td>
            <td>
                                     default is <code>[]</code><br/>
                          The providers that must be given by any dependency appearing in this attribute.<p>The format of this argument is a list of lists of providers -- <code>*Info</code> objects returned by <a href='../globals/bzl.html#provider'><code>provider()</code></a> (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its <code>provides</code> parameter, however, it is considered best practice.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.flags">
              <code>flags</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s;
                                     default is <code>[]</code><br/>
                          Deprecated, will be removed.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.cfg">
              <code>cfg</code>
            </td>
            <td>
                                     default is <code>None</code><br/>
                          <a href="https://bazel.build/versions/7.2.0/extending/rules#configurations">Configuration</a> of the attribute. It can be either <code>"exec"</code>, which indicates that the dependency is built for the <code>execution platform</code>, or <code>"target"</code>, which indicates that the dependency is build for the <code>target platform</code>. A typical example of the difference is when building mobile apps, where the <code>target platform</code> is <code>Android</code> or <code>iOS</code> while the <code>execution platform</code> is <code>Linux</code>, <code>macOS</code>, or <code>Windows</code>.
            </td>
          </tr>
                  <tr>
            <td id="label_keyed_string_dict.aspects">
              <code>aspects</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../builtins/Aspect.html">Aspect</a>s;
                                     default is <code>[]</code><br/>
                          Aspects that should be applied to the dependency or dependencies specified by this attribute.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="label_list">label_list</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.label_list(allow_empty=True, *, default=[], doc=None, allow_files=None, allow_rules=None, providers=[], flags=[], mandatory=False, cfg=None, aspects=[])</pre></p>

    <p>Creates a schema for a list-of-labels attribute. This is a dependency attribute. The corresponding <a href='../builtins/ctx.html#attr'><code>ctx.attr</code></a> attribute will be of type <a href='../core/list.html'>list</a> of <a href='../builtins/Target.html'><code>Target</code>s</a>.</p><p>This attribute contains unique <a href='../builtins/Label.html'><code>Label</code></a> values. If a string is supplied in place of a <code>Label</code>, it will be converted using the <a href='../builtins/Label.html#Label'>label constructor</a>. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package.<p>At analysis time (within the rule's implementation function), when retrieving the attribute value from <code>ctx.attr</code>, labels are replaced by the corresponding <a href='../builtins/Target.html'><code>Target</code></a>s. This allows you to access the providers of the current target's dependencies.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="label_list.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="label_list.default">
              <code>default</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../builtins/Label.html">Label</a>s; or <a class="anchor" href="../core/function.html">function</a>;
                                     default is <code>[]</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.Use strings or the <a href="../builtins/Label.html#Label"><code>Label</code></a> function to specify default values, for example, <code>attr.label_list(default = ["//a:b", "//a:c"])</code>.
            </td>
          </tr>
                  <tr>
            <td id="label_list.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="label_list.allow_files">
              <code>allow_files</code>
            </td>
            <td>
                          <a class="anchor" href="../core/bool.html">bool</a>; or <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
                                     default is <code>None</code><br/>
                          Whether <code>File</code> targets are allowed. Can be <code>True</code>, <code>False</code> (default), or a list of file extensions that are allowed (for example, <code>[".cc", ".cpp"]</code>).
            </td>
          </tr>
                  <tr>
            <td id="label_list.allow_rules">
              <code>allow_rules</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or <code>None</code>;
                                     default is <code>None</code><br/>
                          Which rule targets (name of the classes) are allowed. This is deprecated (kept only for compatibility), use providers instead.
            </td>
          </tr>
                  <tr>
            <td id="label_list.providers">
              <code>providers</code>
            </td>
            <td>
                                     default is <code>[]</code><br/>
                          The providers that must be given by any dependency appearing in this attribute.<p>The format of this argument is a list of lists of providers -- <code>*Info</code> objects returned by <a href='../globals/bzl.html#provider'><code>provider()</code></a> (or in the case of a legacy provider, its string name). The dependency must return ALL providers mentioned in at least ONE of the inner lists. As a convenience, this argument may also be a single-level list of providers, in which case it is wrapped in an outer list with one element. It is NOT required that the rule of the dependency advertises those providers in its <code>provides</code> parameter, however, it is considered best practice.
            </td>
          </tr>
                  <tr>
            <td id="label_list.flags">
              <code>flags</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s;
                                     default is <code>[]</code><br/>
                          Deprecated, will be removed.
            </td>
          </tr>
                  <tr>
            <td id="label_list.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="label_list.cfg">
              <code>cfg</code>
            </td>
            <td>
                                     default is <code>None</code><br/>
                          <a href="https://bazel.build/versions/7.2.0/extending/rules#configurations">Configuration</a> of the attribute. It can be either <code>"exec"</code>, which indicates that the dependency is built for the <code>execution platform</code>, or <code>"target"</code>, which indicates that the dependency is build for the <code>target platform</code>. A typical example of the difference is when building mobile apps, where the <code>target platform</code> is <code>Android</code> or <code>iOS</code> while the <code>execution platform</code> is <code>Linux</code>, <code>macOS</code>, or <code>Windows</code>.
            </td>
          </tr>
                  <tr>
            <td id="label_list.aspects">
              <code>aspects</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../builtins/Aspect.html">Aspect</a>s;
                                     default is <code>[]</code><br/>
                          Aspects that should be applied to the dependency or dependencies specified by this attribute.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="output">output</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.output(doc=None, mandatory=False)</pre></p>

    <p>Creates a schema for an output (label) attribute.</p><p>This attribute contains unique <a href='../builtins/Label.html'><code>Label</code></a> values. If a string is supplied in place of a <code>Label</code>, it will be converted using the <a href='../builtins/Label.html#Label'>label constructor</a>. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package.<p>At analysis time, the corresponding <a href='../builtins/File.html'><code>File</code></a> can be retrieved using <a href='../builtins/ctx.html#outputs'><code>ctx.outputs</code></a>.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="output.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="output.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="output_list">output_list</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.output_list(allow_empty=True, *, doc=None, mandatory=False)</pre></p>

    Creates a schema for a list-of-outputs attribute.<p>This attribute contains unique <a href='../builtins/Label.html'><code>Label</code></a> values. If a string is supplied in place of a <code>Label</code>, it will be converted using the <a href='../builtins/Label.html#Label'>label constructor</a>. The relative parts of the label path, including the (possibly renamed) repository, are resolved with respect to the instantiated target's package.<p>At analysis time, the corresponding <a href='../builtins/File.html'><code>File</code></a> can be retrieved using <a href='../builtins/ctx.html#outputs'><code>ctx.outputs</code></a>.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="output_list.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="output_list.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="output_list.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="string">string</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.string(default='', doc=None, mandatory=False, values=[])</pre></p>

    Creates a schema for a <a href='../core/string.html#attr'>string</a> attribute.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="string.default">
              <code>default</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or NativeComputedDefault;
                                     default is <code>''</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="string.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="string.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="string.values">
              <code>values</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s;
                                     default is <code>[]</code><br/>
                          The list of allowed values for the attribute. An error is raised if any other value is given.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="string_dict">string_dict</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.string_dict(allow_empty=True, *, default={}, doc=None, mandatory=False)</pre></p>

    Creates a schema for an attribute holding a dictionary, where the keys and values are strings.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="string_dict.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="string_dict.default">
              <code>default</code>
            </td>
            <td>
                                     default is <code>{}</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="string_dict.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="string_dict.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="string_list">string_list</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.string_list(mandatory=False, allow_empty=True, *, default=[], doc=None)</pre></p>

    Creates a schema for a list-of-strings attribute.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="string_list.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                  <tr>
            <td id="string_list.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="string_list.default">
              <code>default</code>
            </td>
            <td>
                          <a class="anchor" href="../core/list.html">sequence</a> of <a class="anchor" href="../core/string.html">string</a>s; or NativeComputedDefault;
                                     default is <code>[]</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="string_list.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                </tbody>
      </table>

        <h2 id="string_list_dict">string_list_dict</h2>
        <p><pre class="rule-signature"><a class="anchor" href="../builtins/Attribute.html">Attribute</a> attr.string_list_dict(allow_empty=True, *, default={}, doc=None, mandatory=False)</pre></p>

    Creates a schema for an attribute holding a dictionary, where the keys are strings and the values are lists of strings.

          <!-- hide-from-toc is a class used by DevSite for the public Bazel site
      (https://developers.google.com/devsite/reference/styles/headings#hide_headings_from_the_toc) -->
      <h3 class="hide-from-toc">Parameters</h3>
      <table class="table table-bordered table-condensed table-params">
        <colgroup>
          <col class="col-param">
          <col class="param-description">
        </colgroup>
        <thead>
          <tr>
            <th>Parameter</th>
            <th>Description</th>
          </tr>
        </thead>
        <tbody>
                  <tr>
            <td id="string_list_dict.allow_empty">
              <code>allow_empty</code>
            </td>
            <td>
                                     default is <code>True</code><br/>
                          True if the attribute can be empty.
            </td>
          </tr>
                  <tr>
            <td id="string_list_dict.default">
              <code>default</code>
            </td>
            <td>
                                     default is <code>{}</code><br/>
                          A default value to use if no value for this attribute is given when instantiating the rule.
            </td>
          </tr>
                  <tr>
            <td id="string_list_dict.doc">
              <code>doc</code>
            </td>
            <td>
                          <a class="anchor" href="../core/string.html">string</a>; or <code>None</code>;
                                     default is <code>None</code><br/>
                          A description of the attribute that can be extracted by documentation generating tools.
            </td>
          </tr>
                  <tr>
            <td id="string_list_dict.mandatory">
              <code>mandatory</code>
            </td>
            <td>
                                     default is <code>False</code><br/>
                          If true, the value must be specified explicitly (even if it has a <code>default</code>).
            </td>
          </tr>
                </tbody>
      </table>


</body>
</html>

<!-- {% endraw %} -->
