Back to Bazel

Repository Os

docs/versions/7.3.0/rules/lib/builtins/repository_os.mdx

9.1.01.9 KB
Original Source
<html devsite> <head> <meta name="project_path" value="/_project.yaml"> <meta name="book_path" value="/versions/7.3.0/_book.yaml"> </head> <body> <h1 class="page-title" id="modules.repository_os">repository_os</h1>

{% dynamic setvar source_file "src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkOS.java" %} {% dynamic setvar version "7.3.0" %} {% dynamic setvar original_path "/rules/lib/builtins/repository_os" %} {% include "_buttons.html" %}

<!-- {% raw %} -->

Various data about the current platform Bazel is running on.

<h2>Members</h2> <ul> <li> <a href="#arch">arch</a> </li> <li> <a href="#environ">environ</a> </li> <li> <a href="#name">name</a> </li> </ul>
  <h2 id="arch">arch</h2>
    <p><pre class="rule-signature"><a class="anchor" href="../core/string.html">string</a> repository_os.arch</pre></p>

A string identifying the architecture Bazel is running on (the value of the "os.arch" Java property converted to lower case).


    <h2 id="environ">environ</h2>
    <p><pre class="rule-signature"><a class="anchor" href="../core/dict.html">dict</a> repository_os.environ</pre></p>

The dictionary of environment variables.<p><b>NOTE</b>: Retrieving an environment variable from this dictionary does not establish a dependency from a repository rule or module extension to the environment variable.  To establish a dependency when looking up an environment variable, use either <code>repository_ctx.getenv</code> or <code>module_ctx.getenv</code> instead.


    <h2 id="name">name</h2>
    <p><pre class="rule-signature"><a class="anchor" href="../core/string.html">string</a> repository_os.name</pre></p>

A string identifying the operating system Bazel is running on (the value of the "os.name" Java property converted to lower case).
</body> </html> <!-- {% endraw %} -->