[blaze-core-fixit] Update Bazel docs and examples links to main or HEAD. RELNOTES: None PiperOrigin-RevId: 379499545
diff --git a/CODEBASE.md b/CODEBASE.md index 3e73e3d..9cbee1d 100644 --- a/CODEBASE.md +++ b/CODEBASE.md
@@ -90,7 +90,7 @@ Bazel creates a somewhat complicated set of directories during a build. A full description is available -[here](https://docs.bazel.build/versions/master/output_directories.html). +[here](https://docs.bazel.build/versions/main/output_directories.html). The "workspace" is the source tree Bazel is run in. It usually corresponds to something you checked out from source control. @@ -194,7 +194,7 @@ 3. From `ConfiguredRuleClassProvider` (these are command line options related to individual programming languages) 4. Starlark rules can also define their own options (see - [here](https://docs.bazel.build/versions/master/skylark/config.html)) + [here](https://docs.bazel.build/versions/main/skylark/config.html)) Each option (excluding Starlark-defined options) is a member variable of a `FragmentOptions` subclass that has the `@Option` annotation, which specifies @@ -212,7 +212,7 @@ interpreting the source code. The totality of the source code Bazel operates on is called "the workspace" and it is structured into repositories, packages and rules. A description of these concepts for the users of Bazel is available -[here](https://docs.bazel.build/versions/master/build-ref.html). +[here](https://docs.bazel.build/versions/main/build-ref.html). ### Repositories @@ -428,10 +428,10 @@ The dialects available for BUILD and .bzl files are slightly different because they express different things. A list of differences is available -[here](https://docs.bazel.build/versions/master/skylark/language.html#differences-between-build-and-bzl-files). +[here](https://docs.bazel.build/versions/main/skylark/language.html#differences-between-build-and-bzl-files). More information about Starlark is available -[here](https://docs.bazel.build/versions/master/skylark/language.html). +[here](https://docs.bazel.build/versions/main/skylark/language.html). ## The loading/analysis phase @@ -535,7 +535,7 @@ _split transition._ Configuration transitions can also be implemented in Starlark (documentation -[here](https://docs.bazel.build/versions/master/skylark/config.html)) +[here](https://docs.bazel.build/versions/main/skylark/config.html)) ### Transitive info providers @@ -634,7 +634,7 @@ Aspects are a way to "propagate computation down the dependency graph". They are described for users of Bazel -[here](https://docs.bazel.build/versions/master/skylark/aspects.html). A good +[here](https://docs.bazel.build/versions/main/skylark/aspects.html). A good motivating example is protocol buffers: a `proto_library` rule should not know about any particular language, but building the implementation of a protocol buffer message (the “basic unit” of protocol buffers) in any programming @@ -685,7 +685,7 @@ multiple architectures where build actions run and multiple architectures for which code is built. These architectures are referred to as _platforms_ in Bazel parlance (full documentation -[here](https://docs.bazel.build/versions/master/platforms.html)) +[here](https://docs.bazel.build/versions/main/platforms.html)) A platform is described by a key-value mapping from _constraint settings_ (e.g. the concept of "CPU architecture") to _constraint values_ (e.g. a particular CPU @@ -698,7 +698,7 @@ specific OS and be able to target some other OSes. Bazel must determine the C++ compiler that is used based on the set execution and target platform (documentation for toolchains -[here](https://docs.bazel.build/versions/master/toolchains.html)). +[here](https://docs.bazel.build/versions/main/toolchains.html)). In order to do this, toolchains are annotated with the set of execution and target platform constraints they support. In order to do this, the definition of @@ -835,7 +835,7 @@ Bazel supports this by the mechanism called _visibility: _you can declare that a particular rule can only be depended on using the visibility attribute (documentation -[here](https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes)). +[here](https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes)). This attribute is a little special because unlike every other attribute, the set of dependencies it generates is not simply the set of labels listed (yes, this is a design flaw). @@ -1090,7 +1090,7 @@ Starlark actions can make use of the facility to declare some inputs as unused using the `unused_inputs_list=` argument of -<code>[ctx.actions.run()](https://docs.bazel.build/versions/master/skylark/lib/actions.html#run)</code>. +<code>[ctx.actions.run()](https://docs.bazel.build/versions/main/skylark/lib/actions.html#run)</code>. ### Various ways to run actions: Strategies/ActionContexts @@ -1254,7 +1254,7 @@ Tests are run according to an elaborate protocol that uses environment variables to tell tests what's expected from them. A detailed description of what Bazel expects from tests and what tests can expect from Bazel is available -[here](https://docs.bazel.build/versions/master/test-encyclopedia.html). At the +[here](https://docs.bazel.build/versions/main/test-encyclopedia.html). At the simplest, an exit code of 0 means success, anything else means failure. In addition to the cache status file, each test process emits a number of other @@ -1367,7 +1367,7 @@ ## The query engine Bazel has a -[little language](https://docs.bazel.build/versions/master/query-how-to.html) +[little language](https://docs.bazel.build/versions/main/query-how-to.html) used to ask it various things about various graphs. The following query kinds are provided: @@ -1425,7 +1425,7 @@ * A test was run (`TestAttempt`, `TestSummary`) Some of these events are represented outside of Bazel in the -[Build Event Protocol](https://docs.bazel.build/versions/master/build-event-protocol.html) +[Build Event Protocol](https://docs.bazel.build/versions/main/build-event-protocol.html) (they are `BuildEvent`s). This allows not only `BlazeModule`s, but also things outside the Bazel process to observe the build. They are accessible either as a file that contains protocol messages or Bazel can connect to a server (called
diff --git a/site/_includes/documentation-sidebar/0/sidebar.html b/site/_includes/documentation-sidebar/0/sidebar.html index 49c2e3d..e5a077d 100644 --- a/site/_includes/documentation-sidebar/0/sidebar.html +++ b/site/_includes/documentation-sidebar/0/sidebar.html
@@ -292,7 +292,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li><a href="/versions/{{ current_version }}/skylark/faq.html">FAQ</a></li> <li><a href="/versions/{{ current_version }}/skylark/language.html">Starlark language</a></li>
diff --git a/site/_includes/documentation-sidebar/1/sidebar.html b/site/_includes/documentation-sidebar/1/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/documentation-sidebar/1/sidebar.html +++ b/site/_includes/documentation-sidebar/1/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/documentation-sidebar/2/sidebar.html b/site/_includes/documentation-sidebar/2/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/documentation-sidebar/2/sidebar.html +++ b/site/_includes/documentation-sidebar/2/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/documentation-sidebar/3/sidebar.html b/site/_includes/documentation-sidebar/3/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/documentation-sidebar/3/sidebar.html +++ b/site/_includes/documentation-sidebar/3/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/documentation-sidebar/4/sidebar.html b/site/_includes/documentation-sidebar/4/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/documentation-sidebar/4/sidebar.html +++ b/site/_includes/documentation-sidebar/4/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/extending-sidebar/master/sidebar.html b/site/_includes/extending-sidebar/master/sidebar.html index d587db7..c1b5bd6 100644 --- a/site/_includes/extending-sidebar/master/sidebar.html +++ b/site/_includes/extending-sidebar/master/sidebar.html
@@ -24,7 +24,7 @@ <li><a href="/versions/{{ current_version }}/rules.html">Recommended & Native Rules</a></li> <li><a href="/versions/{{ current_version }}/skylark/rules-tutorial.html">Writing Rules</a></li> <li><a href="/versions/{{ current_version }}/skylark/windows_tips.html">Writing Rules on Windows</a></li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Example rules</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Example rules</a></li> <li><a href="/versions/{{ current_version }}/rule-challenges.html">Rules Challenges</a></li> </ul>
diff --git a/site/_includes/getting-started-sidebar/0/sidebar.html b/site/_includes/getting-started-sidebar/0/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/getting-started-sidebar/0/sidebar.html +++ b/site/_includes/getting-started-sidebar/0/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/getting-started-sidebar/1/sidebar.html b/site/_includes/getting-started-sidebar/1/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/getting-started-sidebar/1/sidebar.html +++ b/site/_includes/getting-started-sidebar/1/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/getting-started-sidebar/2/sidebar.html b/site/_includes/getting-started-sidebar/2/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/getting-started-sidebar/2/sidebar.html +++ b/site/_includes/getting-started-sidebar/2/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/getting-started-sidebar/3/sidebar.html b/site/_includes/getting-started-sidebar/3/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/getting-started-sidebar/3/sidebar.html +++ b/site/_includes/getting-started-sidebar/3/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/_includes/getting-started-sidebar/4/sidebar.html b/site/_includes/getting-started-sidebar/4/sidebar.html index 0cc4b85..2b70525 100644 --- a/site/_includes/getting-started-sidebar/4/sidebar.html +++ b/site/_includes/getting-started-sidebar/4/sidebar.html
@@ -207,7 +207,7 @@ </ul> </li> - <li><a href="https://github.com/bazelbuild/examples/tree/master/rules">Examples</a></li> + <li><a href="https://github.com/bazelbuild/examples/tree/HEAD/rules">Examples</a></li> <li><a href="/versions/{{ current_version }}/skylark/lib/skylark-overview.html">Extensions API</a></li> <li>
diff --git a/site/docs/android-ndk.md b/site/docs/android-ndk.md index 9dc82d3..437ce5c 100644 --- a/site/docs/android-ndk.md +++ b/site/docs/android-ndk.md
@@ -104,7 +104,7 @@ ## Example setup This example is available in the [Bazel examples -repository](https://github.com/bazelbuild/examples/tree/master/android/ndk). +repository](https://github.com/bazelbuild/examples/tree/HEAD/android/ndk). In the `BUILD.bazel` file, three targets are defined with the `android_binary`, `android_library`, and `cc_library` rules. @@ -246,8 +246,8 @@ ## Integration with platforms and toolchains Bazel's configuration model is moving towards -[platforms](https://docs.bazel.build/versions/master/platforms.html) and -[toolchains](https://docs.bazel.build/versions/master/toolchains.html). If your +[platforms](https://docs.bazel.build/versions/main/platforms.html) and +[toolchains](https://docs.bazel.build/versions/main/toolchains.html). If your build uses the `--platforms` flag to select for the architecture or operating system to build for, you will need to pass the `--extra_toolchains` flag to Bazel in order to use the NDK.
diff --git a/site/docs/aquery.html b/site/docs/aquery.html index cb150af..e87d4f9 100644 --- a/site/docs/aquery.html +++ b/site/docs/aquery.html
@@ -317,7 +317,7 @@ <h3 id="aspect-on-aspect">Aspect-on-aspect</h3> <p> - It is possible for <a href="https://docs.bazel.build/versions/master/skylark/aspects.html">Aspects</a> + It is possible for <a href="https://docs.bazel.build/versions/main/skylark/aspects.html">Aspects</a> to be applied on top of each other. The aquery output of the action generated by these Aspects would then include the <i>Aspect path</i>, which is the sequence of Aspects applied to the target which generated the action. </p> @@ -368,13 +368,13 @@ <code>AspectClass</code> could be the name of the Aspect class (for native Aspects) or <code>bzl_file%aspect_name</code> (for Starlark Aspects). <code>AspectDescriptor</code> are sorted in topological order of the - <a href="https://docs.bazel.build/versions/master/skylark/aspects.html#aspect-basics">dependency graph</a>. + <a href="https://docs.bazel.build/versions/main/skylark/aspects.html#aspect-basics">dependency graph</a>. </p> <h3 id="linking-json-profile">Linking with the JSON profile</h3> <p> While aquery provides information about the actions being run in a build (why they're being run, - their inputs/outputs), the <a href="https://docs.bazel.build/versions/master/skylark/performance.html#performance-profiling">JSON profile</a> + their inputs/outputs), the <a href="https://docs.bazel.build/versions/main/skylark/performance.html#performance-profiling">JSON profile</a> tells us the timing and duration of their execution. It is possible to combine these 2 sets of information via a common denominator: an action's primary output. </p>
diff --git a/site/docs/configurable-attributes.md b/site/docs/configurable-attributes.md index 8d3dbe1..3cfb941 100644 --- a/site/docs/configurable-attributes.md +++ b/site/docs/configurable-attributes.md
@@ -93,7 +93,7 @@ under a target. For example, `genrule`'s `tools` changes `--cpu` to the CPU of the machine running Bazel (which, thanks to cross-compilation, may be different than the CPU the target is built for). This is known as a -[configuration transition](https://docs.bazel.build/versions/master/glossary.html#transition). +[configuration transition](https://docs.bazel.build/versions/main/glossary.html#transition). Given @@ -212,7 +212,7 @@ ) ``` -Behavior is the same as for [built-in flags](#built-in-flags). See [here](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/select_on_build_setting) +Behavior is the same as for [built-in flags](#built-in-flags). See [here](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/select_on_build_setting) for a working example. [`--define`](command-line-reference.html#flag--define) @@ -634,10 +634,10 @@ ## <a name="query"></a>Bazel query and cquery Bazel [`query`](query-how-to.html) operates over Bazel's -[loading phase](https://docs.bazel.build/versions/master/glossary.html#loading-phase). +[loading phase](https://docs.bazel.build/versions/main/glossary.html#loading-phase). This means it doesn't know what command line flags a target uses since those flags aren't evaluated until later in the build (in the -[analysis phase](https://docs.bazel.build/versions/master/glossary.html#analysis-phase)). +[analysis phase](https://docs.bazel.build/versions/main/glossary.html#analysis-phase)). So it can't determine which `select()` branches are chosen. Bazel [`cquery`](cquery.html) operates after Bazel's analysis phase, so it has
diff --git a/site/docs/cquery.html b/site/docs/cquery.html index 3162a0c..69d60c2 100644 --- a/site/docs/cquery.html +++ b/site/docs/cquery.html
@@ -14,7 +14,7 @@ <p> It achieves this by running over the results of Bazel's - <a href="https://docs.bazel.build/versions/master/skylark/concepts.html#evaluation-model">analysis + <a href="https://docs.bazel.build/versions/main/skylark/concepts.html#evaluation-model">analysis phase</a>, which integrates these effects. <code>query</code>, by constrast, runs over the results of Bazel's loading phase, before options are evaluated. </p> @@ -100,7 +100,7 @@ <p> <code>cquery</code> requires a target to run through the - <a href="https://docs.bazel.build/versions/master/skylark/concepts.html#evaluation-model">loading + <a href="https://docs.bazel.build/versions/main/skylark/concepts.html#evaluation-model">loading and analysis</a> phases. Unless otherwise specified, <code>cquery</code> parses the target(s) listed in the query @@ -261,7 +261,7 @@ <p> Often, the dependencies of configured targets go through - <a href="https://docs.bazel.build/versions/master/skylark/rules.html#configurations">transitions</a>, + <a href="https://docs.bazel.build/versions/main/skylark/rules.html#configurations">transitions</a>, which causes their configuration to differ from their dependent. This flag allows you to query a target as if it were built as a dependency or a transitive dependency of another target. For example: @@ -283,7 +283,7 @@ <p> Genrules configure their tools in the - <a href="https://docs.bazel.build/versions/master/skylark/rules.html#configurations">host configuration</a> + <a href="https://docs.bazel.build/versions/main/skylark/rules.html#configurations">host configuration</a> so the following queries would produce the following outputs: </p> @@ -342,7 +342,7 @@ Setting this flag to false filters out all configured targets for which the path from the queried target to them crosses a transition between the target configuration and the - <a href="https://docs.bazel.build/versions/master/skylark/rules.html#configurations">non-target configurations</a>. + <a href="https://docs.bazel.build/versions/main/skylark/rules.html#configurations">non-target configurations</a>. If the queried target is in the target configuration, setting <code>--notool_deps</code> will only return targets that also are in the target configuration. If the queried target is in a non-target configuration, setting <code>--notool_deps</code> will only return @@ -353,7 +353,7 @@ <h4><code>--include_aspects</code> (boolean, default=False)</h4> <p> - <a href="https://docs.bazel.build/versions/master/skylark/aspects.html">Aspects</a> can add + <a href="https://docs.bazel.build/versions/main/skylark/aspects.html">Aspects</a> can add additional dependencies to a build. By default, <code>cquery</code> doesn't follow aspects because they make the queryable graph bigger, which uses more memory. But following them produces more accurate results. @@ -383,7 +383,7 @@ </pre> <p> - Configuration <a href="https://docs.bazel.build/versions/master/skylark/rules.html#configurations">transitions</a> + Configuration <a href="https://docs.bazel.build/versions/main/skylark/rules.html#configurations">transitions</a> are used to build targets underneath the top level targets in different configurations than the top level targets. </p> @@ -460,12 +460,12 @@ <p> This output format calls a - <a href="https://docs.bazel.build/versions/master/skylark/language.html">Starlark</a> + <a href="https://docs.bazel.build/versions/main/skylark/language.html">Starlark</a> function for each configured target in the query result, and prints the value returned by the call. The <code>--starlark:file</code> flag specifies the location of a Starlark file that defines a function named <code>format</code> with a single parameter, <code>target</code>. This function is called for each - <a href="https://docs.bazel.build/versions/master/skylark/lib/Target.html">Target</a> in the + <a href="https://docs.bazel.build/versions/main/skylark/lib/Target.html">Target</a> in the query result. Alternatively, for convenience, you may specify just the body of a function declared as <code>def format(target): return expr</code> by using the <code>--starlark:expr</code> flag. @@ -481,7 +481,7 @@ <h5 id='build_options'>build_options(target)</h5> <p> <code>build_options(target)</code> returns a map whose keys are build option identifiers (see - <a href="https://docs.bazel.build/versions/master/skylark/config.html">Configurations</a>) + <a href="https://docs.bazel.build/versions/main/skylark/config.html">Configurations</a>) and whose values are their Starlark values. Build options whose values are not legal Starlark values are omitted from this map. </p><p> @@ -491,7 +491,7 @@ <h5 id='providers'>providers(target)</h5> <p> <code>providers(target)</code> returns a map whose keys are names of - <a href="https://docs.bazel.build/versions/master/skylark/rules.html#providers">providers</a> + <a href="https://docs.bazel.build/versions/main/skylark/rules.html#providers">providers</a> (for example, <code>"DefaultInfo"</code>) and whose values are their Starlark values. Providers whose values are not legal Starlark values are omitted from this map. </p> @@ -693,7 +693,7 @@ previous commands and is therefore prone to picking up results from past queries. For example, <code>genquery</code> exerts a host transition on its <code>tools</code> attribute - that is, it configures its tools in the - <a href="https://docs.bazel.build/versions/master/skylark/rules.html#configurations">host + <a href="https://docs.bazel.build/versions/main/skylark/rules.html#configurations">host configuration</a>. </p>
diff --git a/site/docs/creating-workers.md b/site/docs/creating-workers.md index 3b2b537..6e8eaa2 100644 --- a/site/docs/creating-workers.md +++ b/site/docs/creating-workers.md
@@ -132,7 +132,7 @@ ## Making the rule that uses the worker You'll also need to create a rule that generates actions to be performed by the -worker. Making a Starlark rule that uses a worker is just like [creating any other rule](https://github.com/bazelbuild/examples/tree/master/rules). +worker. Making a Starlark rule that uses a worker is just like [creating any other rule](https://github.com/bazelbuild/examples/tree/HEAD/rules). In addition, the rule needs to contain a reference to the worker itself, and there are some requirements for the actions it produces.
diff --git a/site/docs/exec-groups.md b/site/docs/exec-groups.md index 2a45948..aac6455 100644 --- a/site/docs/exec-groups.md +++ b/site/docs/exec-groups.md
@@ -34,7 +34,7 @@ ## Defining execution groups During rule definition, rule authors can -[declare](https://docs.bazel.build/versions/master/skylark/lib/globals.html#exec_group) +[declare](https://docs.bazel.build/versions/main/skylark/lib/globals.html#exec_group) a set of execution groups. On each execution group, the rule author can specify everything needed to select an execution platform for that execution group, namely any constraints via `exec_compatible_with` and toolchain types via @@ -61,9 +61,9 @@ In the code snippet above, you can see that tool dependencies can also specify transition for an exec group using the -[`cfg`](https://docs.bazel.build/versions/master/skylark/lib/attr.html#label) +[`cfg`](https://docs.bazel.build/versions/main/skylark/lib/attr.html#label) attribute param and the -[`config`](https://docs.bazel.build/versions/master/skylark/lib/config.html) +[`config`](https://docs.bazel.build/versions/main/skylark/lib/config.html) module. The module exposes an `exec` function which takes a single string parameter which is the name of the exec group for which the dependency should be built. @@ -115,8 +115,8 @@ In the rule implementation, you can declare that actions should be run on the execution platform of an execution group. You can do this by using the `exec_group` param of action generating methods, specifically [`ctx.actions.run`] -(https://docs.bazel.build/versions/master/skylark/lib/actions.html#run) and -[`ctx.actions.run_shell`](https://docs.bazel.build/versions/master/skylark/lib/actions.html#run_shell). +(https://docs.bazel.build/versions/main/skylark/lib/actions.html#run) and +[`ctx.actions.run_shell`](https://docs.bazel.build/versions/main/skylark/lib/actions.html#run_shell). ```python # foo.bzl
diff --git a/site/docs/external.md b/site/docs/external.md index 246d851..cd35bbf 100644 --- a/site/docs/external.md +++ b/site/docs/external.md
@@ -132,9 +132,9 @@ By default, external dependencies are fetched as needed during `bazel build`. If you would like to prefetch the dependencies needed for a specific set of targets, use -[`bazel fetch`](https://docs.bazel.build/versions/master/command-line-reference.html#commands). +[`bazel fetch`](https://docs.bazel.build/versions/main/command-line-reference.html#commands). To unconditionally fetch all external dependencies, use -[`bazel sync`](https://docs.bazel.build/versions/master/command-line-reference.html#commands). +[`bazel sync`](https://docs.bazel.build/versions/main/command-line-reference.html#commands). As fetched repositories are [stored in the output base](#layout), fetching happens per workspace.
diff --git a/site/docs/guide.md b/site/docs/guide.md index 61cfef8..f10ea35 100644 --- a/site/docs/guide.md +++ b/site/docs/guide.md
@@ -349,7 +349,7 @@ preparation. Using the -[`--distdir=/path/to-directory`](https://docs.bazel.build/versions/master/command-line-reference.html#flag--distdir) +[`--distdir=/path/to-directory`](https://docs.bazel.build/versions/main/command-line-reference.html#flag--distdir) option, you can specify additional read-only directories to look for files instead of fetching them. A file is taken from such a directory if the file name is equal to the base name of the URL and additionally the hash of the file is @@ -376,7 +376,7 @@ transfer them to the airgapped environment with an offline approach. To prepare the [distribution directory](distribution-files-directories), use the -[`--distdir`](https://docs.bazel.build/versions/master/command-line-reference.html#flag--distdir) +[`--distdir`](https://docs.bazel.build/versions/main/command-line-reference.html#flag--distdir) flag. You will need to do this once for every new Bazel binary version, since the implicit dependencies can be different for every release.
diff --git a/site/docs/integrating-with-rules-cc.md b/site/docs/integrating-with-rules-cc.md index cf6a572e..0fccc1d 100644 --- a/site/docs/integrating-with-rules-cc.md +++ b/site/docs/integrating-with-rules-cc.md
@@ -11,20 +11,20 @@ Because of [ongoing migration of C++ rules](https://github.com/bazelbuild/bazel/issues/6516) -to [platforms](https://docs.bazel.build/versions/master/platforms.html) and -[toolchains](https://docs.bazel.build/versions/master/toolchains.html), you +to [platforms](https://docs.bazel.build/versions/main/platforms.html) and +[toolchains](https://docs.bazel.build/versions/main/toolchains.html), you should use the helper function available at [@bazel_tools//tools/cpp:toolchain_utils.bzl](https://source.bazel.build/bazel/+/master:tools/cpp/toolchain_utils.bzl;l=23), which works both when toolchains are disabled and enabled. To depend on a C++ toolchain in your rule, add a -[`Label`](https://docs.bazel.build/versions/master/skylark/lib/attr.html#label) +[`Label`](https://docs.bazel.build/versions/main/skylark/lib/attr.html#label) attribute named `_cc_toolchain` and point it to `@bazel_tools//tools/cpp:current_cc_toolchain` (an instance of `cc_toolchain_alias` rule, that points to the currently selected C++ toolchain). Then, in the rule implementation, use [`find_cpp_toolchain(ctx)`](https://source.bazel.build/bazel/+/master:tools/cpp/toolchain_utils.bzl;l=23) to get the -[`CcToolchainInfo`](https://docs.bazel.build/versions/master/skylark/lib/CcToolchainInfo.html). +[`CcToolchainInfo`](https://docs.bazel.build/versions/main/skylark/lib/CcToolchainInfo.html). A complete working example can be found [in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/master/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl). @@ -42,14 +42,14 @@ * `features` and `action_configs` - these come from the `CcToolchainConfigInfo` and encapsulated in `CcToolchainInfo` -* `FeatureConfiguration` - returned by [cc_common.configure_features](https://docs.bazel.build/versions/master/skylark/lib/cc_common.html#configure_features) +* `FeatureConfiguration` - returned by [cc_common.configure_features](https://docs.bazel.build/versions/main/skylark/lib/cc_common.html#configure_features) * cc toolchain config variables - returned by - [cc_common.create_compile_variables](https://docs.bazel.build/versions/master/skylark/lib/cc_common.html#create_compile_variables) + [cc_common.create_compile_variables](https://docs.bazel.build/versions/main/skylark/lib/cc_common.html#create_compile_variables) or - [cc_common.create_link_variables](https://docs.bazel.build/versions/master/skylark/lib/cc_common.html#create_link_variables). + [cc_common.create_link_variables](https://docs.bazel.build/versions/main/skylark/lib/cc_common.html#create_link_variables). There still are tool-specific getters, such as -[compiler_executable](https://docs.bazel.build/versions/master/skylark/lib/CcToolchainInfo.html#compiler_executable). +[compiler_executable](https://docs.bazel.build/versions/main/skylark/lib/CcToolchainInfo.html#compiler_executable). Prefer `get_tool_for_action` over these, as tool-specific getters will eventually be removed. @@ -59,10 +59,10 @@ ## Implementing Starlark rules that depend on C++ rules and/or that C++ rules can depend on Most C++ rules provide -[`CcInfo`](https://docs.bazel.build/versions/master/skylark/lib/CcInfo.html), -a provider containing [`CompilationContext`](https://docs.bazel.build/versions/master/skylark/lib/CompilationContext.html) +[`CcInfo`](https://docs.bazel.build/versions/main/skylark/lib/CcInfo.html), +a provider containing [`CompilationContext`](https://docs.bazel.build/versions/main/skylark/lib/CompilationContext.html) and -[`LinkingContext`](https://docs.bazel.build/versions/master/skylark/lib/LinkingContext.html). +[`LinkingContext`](https://docs.bazel.build/versions/main/skylark/lib/LinkingContext.html). Through these it is possible to access information such as all transitive headers or libraries to link. From `CcInfo` and from the `CcToolchainInfo` custom Starlark rules should be able to get all the information they need.
diff --git a/site/docs/persistent-workers.md b/site/docs/persistent-workers.md index e2bc7d8..c931629 100644 --- a/site/docs/persistent-workers.md +++ b/site/docs/persistent-workers.md
@@ -21,7 +21,7 @@ `<outputBase>/bazel-workers`. Using persistent workers is an -[execution strategy](https://docs.bazel.build/versions/master/user-manual.html#strategy-options) +[execution strategy](https://docs.bazel.build/versions/main/user-manual.html#strategy-options) that decreases start-up overhead, allows more JIT compilation, and enables caching of for example the abstract syntax trees in the action execution. This strategy achieves these improvements by sending multiple requests to a
diff --git a/site/docs/platforms-intro.md b/site/docs/platforms-intro.md index a048054..70deceb 100644 --- a/site/docs/platforms-intro.md +++ b/site/docs/platforms-intro.md
@@ -444,7 +444,7 @@ [C++ Rules]: /versions/master/bazel-and-cpp.html [Android Rules]: /versions/master/bazel-and-android.html [Common Platform Declarations]: https://github.com/bazelbuild/platforms#motivation -[select()]: https://docs.bazel.build/versions/master/configurable-attributes.html +[select()]: https://docs.bazel.build/versions/main/configurable-attributes.html [select() Platforms]: configurable-attributes.md#platforms [platform Rule]: be/platform.html#platform [constraint_value Rule]: be/platform.html#constraint_value
diff --git a/site/docs/remote-caching.md b/site/docs/remote-caching.md index eb1d9d1..e904bdf 100644 --- a/site/docs/remote-caching.md +++ b/site/docs/remote-caching.md
@@ -37,7 +37,7 @@ Note that the remote cache additionally stores the stdout and stderr for every action. Inspecting the stdout/stderr of Bazel thus is not a good signal for -[estimating cache hits](https://docs.bazel.build/versions/master/remote-caching-debug.html). +[estimating cache hits](https://docs.bazel.build/versions/main/remote-caching-debug.html). ### How a build uses remote caching @@ -321,9 +321,9 @@ An action definition contains environment variables. This can be a problem for sharing remote cache hits across machines. For example, environments with different `$PATH` variables won't share cache hits. Only environment variables -explicitly whitelisted via `--action_env` are included in an action +explicitly named via `--action_env` are included in an action definition. Bazel's Debian/Ubuntu package used to install `/etc/bazel.bazelrc` -with a whitelist of environment variables including `$PATH`. If you are getting +with a pre-defined list of environment variables including `$PATH`. If you are getting fewer cache hits than expected, check that your environment doesn't have an old `/etc/bazel.bazelrc` file. @@ -349,8 +349,8 @@ * **Faster Bazel builds with remote caching: a benchmark:** Nicolò Valigi wrote a [blog post](https://nicolovaligi.com/faster-bazel-remote-caching-benchmark.html) in which he benchmarks remote caching in Bazel. -[Adapting Rules for Remote Execution]: https://docs.bazel.build/versions/master/remote-execution-rules.html -[Troubleshooting Remote Execution]: https://docs.bazel.build/versions/master/remote-execution-sandbox.html +[Adapting Rules for Remote Execution]: https://docs.bazel.build/versions/main/remote-execution-rules.html +[Troubleshooting Remote Execution]: https://docs.bazel.build/versions/main/remote-execution-sandbox.html [WebDAV module]: http://nginx.org/en/docs/http/ngx_http_dav_module.html [docker image]: https://hub.docker.com/r/buchgr/bazel-remote-cache/ [bazel-remote]: https://github.com/buchgr/bazel-remote/
diff --git a/site/docs/rule-challenges.md b/site/docs/rule-challenges.md index 775848a..31dc405 100644 --- a/site/docs/rule-challenges.md +++ b/site/docs/rule-challenges.md
@@ -211,7 +211,7 @@ custom collection classes that effectively compress the information in memory by avoiding the copy at each step. Almost all of these data structures have set semantics, so we called it -[depset](https://docs.bazel.build/versions/master/skylark/lib/depset.html) +[depset](https://docs.bazel.build/versions/main/skylark/lib/depset.html) (also known as `NestedSet` in the internal implementation). The majority of changes to reduce Bazel's memory consumption over the past several years were changes to use depsets instead of whatever was previously used.
diff --git a/site/docs/skylark/bzl-style.md b/site/docs/skylark/bzl-style.md index df26c06..59c2883 100644 --- a/site/docs/skylark/bzl-style.md +++ b/site/docs/skylark/bzl-style.md
@@ -10,7 +10,7 @@ This page covers basic style guidelines for Starlark and also includes information on macros and rules. -[Starlark](https://docs.bazel.build/versions/master/skylark/language.html) is a +[Starlark](https://docs.bazel.build/versions/main/skylark/language.html) is a language that defines how software is built, and as such it is both a programming and a configuration language.
diff --git a/site/docs/skylark/concepts.md b/site/docs/skylark/concepts.md index 4aec57d..0cb8921 100644 --- a/site/docs/skylark/concepts.md +++ b/site/docs/skylark/concepts.md
@@ -86,7 +86,7 @@ * The [API reference](lib/skylark-overview.html) -* [Examples](https://github.com/bazelbuild/examples/tree/master/rules) +* [Examples](https://github.com/bazelbuild/examples/tree/HEAD/rules) ## Going further
diff --git a/site/docs/skylark/config.md b/site/docs/skylark/config.md index 0b2b84f..7e3dff4 100644 --- a/site/docs/skylark/config.md +++ b/site/docs/skylark/config.md
@@ -24,7 +24,7 @@ and more, all completely from .bzl files (no Bazel release required). See the `bazelbuild/examples` repo for -[examples](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations). +[examples](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations). <!-- [TOC] --> @@ -47,7 +47,7 @@ ### Defining build settings -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/basic_build_setting) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/basic_build_setting) #### The `build_setting` `rule()` parameter @@ -177,7 +177,7 @@ ### Predefined settings -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/use_skylib_build_setting) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/use_skylib_build_setting) The [Skylib](https://github.com/bazelbuild/bazel-skylib) @@ -317,7 +317,7 @@ ### Label-typed build settings -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/label_typed_build_setting) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/label_typed_build_setting) Unlike other build settings, label-typed settings cannot be defined using the `build_setting` rule parameter. Instead, bazel has two built-in rules: @@ -373,7 +373,7 @@ ### Build settings and select() -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/select_on_build_setting) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/select_on_build_setting) Users can configure attributes on build settings by using [`select()`](../be/functions.html#select). Build setting targets can be passed to the `flag_values` attribute of @@ -475,7 +475,7 @@ ### Defining 1:2+ transitions -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/multi_arch_binary) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/multi_arch_binary) [Outgoing edge transition](#outgoing-edge-transitions) can map a single input configuration to two or more output configurations. These are defined in @@ -500,7 +500,7 @@ ### Attaching transitions -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/attaching_transitions_to_rules) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/attaching_transitions_to_rules) Transitions can be attached in two places: incoming edges and outgoing edges. Effectively this means rules can transition their own configuration (incoming @@ -543,7 +543,7 @@ ### Transitions on native options -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/transition_on_native_flag) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/transition_on_native_flag) WARNING: Long term, the plan is to reimplement all native options as build settings. When that happens, this syntax will be deprecated. Currently other @@ -579,7 +579,7 @@ Two, `--config` can be used to set options that aren't part of the build configuration which cannot be set by transitions. An example of this is execution options like -[`--spawn_strategy`](https://docs.bazel.build/versions/master/user-manual.html#flag--spawn_strategy) +[`--spawn_strategy`](https://docs.bazel.build/versions/main/user-manual.html#flag--spawn_strategy) . A workaround is to manually expand the option in the starlark transition by setting the individual flags to their appropriate values. Unfortunately this requires maintaining the expansion in two places. Note that this workaround @@ -621,7 +621,7 @@ ### Accessing attributes with transitions -[End to end example](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations/read_attr_in_transition) +[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations/read_attr_in_transition) When [attaching a transition to an outgoing edge](#outgoing-edge-transitions) (regardless of whether the transition is a 1:1 or 1:2+ transition) access to @@ -724,4 +724,4 @@ * [Starlark Build Configuration](https://docs.google.com/document/d/1vc8v-kXjvgZOdQdnxPTaV0rrLxtP2XwnD2tAZlYJOqw/edit?usp=sharing) * [Bazel Configurability Roadmap](https://bazel.build/roadmaps/configuration.html) - * Full [set](https://github.com/bazelbuild/examples/tree/master/rules/starlark_configurations) of end to end examples + * Full [set](https://github.com/bazelbuild/examples/tree/HEAD/rules/starlark_configurations) of end to end examples
diff --git a/site/docs/skylark/deploying.md b/site/docs/skylark/deploying.md index 5f44ba3..018bac8 100644 --- a/site/docs/skylark/deploying.md +++ b/site/docs/skylark/deploying.md
@@ -130,7 +130,7 @@ ### Constraints If your rule defines -[toolchain](https://docs.bazel.build/versions/master/toolchains.html) rules, +[toolchain](https://docs.bazel.build/versions/main/toolchains.html) rules, it's possible that you'll need to define custom `constraint_setting`s and/or `constraint_value`s. Put these into a `//<LANG>/constraints` package. Your directory structure will look like this: @@ -150,7 +150,7 @@ consider contributing your constraints there if they are language independent. Be mindful of introducing custom constraints, all users of your rules will use them to perform platform specific logic in their `BUILD` files (for example, -using [selects](https://docs.bazel.build/versions/master/be/functions.html#select)). +using [selects](https://docs.bazel.build/versions/main/be/functions.html#select)). With custom constraints, you define a language that the whole Bazel ecosystem will speak.
diff --git a/site/docs/skylark/depsets.md b/site/docs/skylark/depsets.md index d33fcea..9f93d82 100644 --- a/site/docs/skylark/depsets.md +++ b/site/docs/skylark/depsets.md
@@ -36,7 +36,7 @@ This example is available at -[https://github.com/bazelbuild/examples/tree/master/rules/depsets](https://github.com/bazelbuild/examples/tree/master/rules/depsets). +[https://github.com/bazelbuild/examples/tree/HEAD/rules/depsets](https://github.com/bazelbuild/examples/tree/master/rules/depsets). Suppose there is a hypothetical interpreted language Foo. In order to build each `foo_binary` you need to know all the `*.foo` files that it directly or
diff --git a/site/docs/skylark/language.md b/site/docs/skylark/language.md index 4e8a3a5..8d7363e 100644 --- a/site/docs/skylark/language.md +++ b/site/docs/skylark/language.md
@@ -97,7 +97,7 @@ [Native functions](../be/functions.html) and [native rules]( ../be/overview.html#language-specific-native-rules) are global symbols in `BUILD` files. `bzl` files need to load them using the [`native` module]( -https://docs.bazel.build/versions/master/skylark/lib/native.html). +https://docs.bazel.build/versions/main/skylark/lib/native.html). There are two syntactic restrictions in `BUILD` files: 1) declaring functions is illegal, and 2) `*args` and `**kwargs` arguments are not allowed.
diff --git a/site/docs/skylark/rules-tutorial.md b/site/docs/skylark/rules-tutorial.md index 5452d93..722c4a1 100644 --- a/site/docs/skylark/rules-tutorial.md +++ b/site/docs/skylark/rules-tutorial.md
@@ -367,5 +367,5 @@ * Take a look at the [reference documentation for rules](rules.html#contents). * Get familiar with [depsets](depsets.html). -* Check out the [examples repository](https://github.com/bazelbuild/examples/tree/master/rules) +* Check out the [examples repository](https://github.com/bazelbuild/examples/tree/HEAD/rules) which includes additional examples of rules.
diff --git a/site/docs/tutorial/cc-toolchain-config.md b/site/docs/tutorial/cc-toolchain-config.md index 5502f2b..9029521 100644 --- a/site/docs/tutorial/cc-toolchain-config.md +++ b/site/docs/tutorial/cc-toolchain-config.md
@@ -8,7 +8,7 @@ This tutorial uses an example scenario to describe how to configure C++ toolchains for a project. It's based on an -[example C++ project](https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage1) +[example C++ project](https://github.com/bazelbuild/examples/tree/HEAD/cpp-tutorial/stage1) that builds error-free using `clang`. ## What you'll learn @@ -38,7 +38,7 @@ [download and install Bazel 0.23](../install-ubuntu.html) or later. 2. Download the - [example C++ project](https://github.com/bazelbuild/examples/tree/master/cpp-tutorial/stage1) + [example C++ project](https://github.com/bazelbuild/examples/tree/HEAD/cpp-tutorial/stage1) from GitHub and place it in an empty directory on your local machine.
diff --git a/site/docs/tutorial/ios-app.md b/site/docs/tutorial/ios-app.md index 838ce83..6bcf01f 100644 --- a/site/docs/tutorial/ios-app.md +++ b/site/docs/tutorial/ios-app.md
@@ -250,7 +250,7 @@ The built app is located in the `$WORKSPACE/bazel-bin` directory. Completed `WORKSPACE` and `BUILD` files for this tutorial are located in the -[master branch](https://github.com/bazelbuild/examples/tree/master/tutorial) +[master branch](https://github.com/bazelbuild/examples/tree/HEAD/tutorial) of the GitHub repo. You can compare your work to the completed files for additional help or troubleshooting. @@ -355,6 +355,6 @@ ## Further reading For more details, see -[master branch](https://github.com/bazelbuild/examples/tree/master/tutorial) +[master branch](https://github.com/bazelbuild/examples/tree/HEAD/tutorial) of the GitHub repo.
diff --git a/site/docs/updating-bazel.md b/site/docs/updating-bazel.md index de9be2e..ef6c732 100644 --- a/site/docs/updating-bazel.md +++ b/site/docs/updating-bazel.md
@@ -9,7 +9,7 @@ This page covers how to automatically update your Bazel version using Bazelisk. The Bazel project has a [backward compatibility -policy](https://docs.bazel.build/versions/master/backward-compatibility.html) +policy](https://docs.bazel.build/versions/main/backward-compatibility.html) (see [guidance for rolling out incompatible changes](https://www.bazel.build/maintaining/breaking-changes-guide.html) if you are the author of one). That page summarizes best practices on how to test and
diff --git a/site/docs/user-manual.html b/site/docs/user-manual.html index 9718ea8..559bd75 100644 --- a/site/docs/user-manual.html +++ b/site/docs/user-manual.html
@@ -7,7 +7,7 @@ This page covers the options that are available with various Bazel commands, such as <code>bazel build</code>, <code>bazel run</code>, and <code>bazel test</code>. This page is a companion to the -<a href="https://docs.bazel.build/versions/master/guide.html">Bazel user guide</a>, +<a href="https://docs.bazel.build/versions/main/guide.html">Bazel user guide</a>, which lists Bazel's commands. <h2 id='target-patterns'>Target syntax</h2> @@ -567,7 +567,7 @@ </h4> <p> <b>WARNING:</b> Extra actions are deprecated. Use - <a href="https://docs.bazel.build/versions/master/skylark/aspects.html">aspects</a> + <a href="https://docs.bazel.build/versions/main/skylark/aspects.html">aspects</a> instead. </p> <p> @@ -583,7 +583,7 @@ </h4> <p> <b>WARNING:</b> Extra actions are deprecated. Use - <a href="https://docs.bazel.build/versions/master/skylark/aspects.html">aspects</a> + <a href="https://docs.bazel.build/versions/main/skylark/aspects.html">aspects</a> instead. </p> <p> @@ -598,7 +598,7 @@ </h4> <p> <b>WARNING:</b> Extra actions are deprecated. Use - <a href="https://docs.bazel.build/versions/master/skylark/aspects.html">aspects</a> + <a href="https://docs.bazel.build/versions/main/skylark/aspects.html">aspects</a> instead. </p> <p> @@ -1673,7 +1673,7 @@ <p> A convenience flag used to bind longer Starlark build settings to a shorter name. For more details, see the - <a href=https://docs.bazel.build/versions/master/skylark/config.html#using-build-setting-aliases">Starlark Configurations</a>. + <a href=https://docs.bazel.build/versions/main/skylark/config.html#using-build-setting-aliases">Starlark Configurations</a>. </p> <h4 id='flag--symlink_prefix'><code class='flag'>--symlink_prefix=<var>string</var></code></h4>