diff --git a/basics/dependencies.mdx b/basics/dependencies.mdx
index 79d73e45..1d3bf8f1 100644
--- a/basics/dependencies.mdx
+++ b/basics/dependencies.mdx
@@ -67,7 +67,8 @@ targets, we’ve made some strides in mitigating the downside by investing in
tooling to automatically manage `BUILD` files to avoid burdening developers.
Some of these tools, such as `buildifier` and `buildozer`, are available with
-Bazel in the [`buildtools` directory](https://github.com/bazelbuild/buildtools).
+Bazel in the [`buildtools`
+directory](https://github.com/bazelbuild/buildtools).
## Minimizing Module Visibility
@@ -107,7 +108,8 @@ transitive dependencies (Figure 1). Suppose target A depends on target B, which
depends on a common library target C. Should target A be able to use classes
defined in target C?
-[](/images/transitive-dependencies.png)
+[](/images/transitive-dependencies.png)
**Figure 1**. Transitive dependencies
@@ -141,7 +143,9 @@ dependencies and adding them to a `BUILD` files without any developer
intervention. But even without such tools, we’ve found the trade-off to be well
worth it as the codebase scales: explicitly adding a dependency to `BUILD` file
is a one-time cost, but dealing with implicit transitive dependencies can cause
-ongoing problems as long as the build target exists. Bazel [enforces strict transitive dependencies](https://blog.bazel.build/2017/06/28/sjd-unused_deps.html)
+ongoing problems as long as the build target exists. Bazel [enforces strict
+transitive
+dependencies](https://blog.bazel.build/2017/06/28/sjd-unused_deps.html)
on Java code by default.
### External dependencies
@@ -190,7 +194,8 @@ so in theory there’s no reason that different versions of the same external
dependency couldn’t both be declared in the build system under different names.
That way, each target could choose which version of the dependency it wanted to
use. This causes a lot of problems in practice, so Google enforces a strict
-[One-Version Rule](https://opensource.google/docs/thirdparty/oneversion/) for
+[One-Version
+Rule](https://opensource.google/docs/thirdparty/oneversion/) for
all third-party dependencies in our codebase.
The biggest problem with allowing multiple versions is the diamond dependency
@@ -229,7 +234,8 @@ Bazel did not use to automatically download transitive dependencies. It used to
employ a `WORKSPACE` file that required all transitive dependencies to be
listed, which led to a lot of pain when managing external dependencies. Bazel
has since added support for automatic transitive external dependency management
-in the form of the `MODULE.bazel` file. See [external dependency overview](/external/overview) for more details.
+in the form of the `MODULE.bazel` file. See [external dependency
+overview](/external/overview) for more details.
Yet again, the choice here is one between convenience and scalability. Small
projects might prefer not having to worry about managing transitive dependencies
diff --git a/community/sig.mdx b/community/sig.mdx
index 3b4d6635..ae5f9189 100644
--- a/community/sig.mdx
+++ b/community/sig.mdx
@@ -5,7 +5,8 @@ title: 'Bazel Special Interest Groups'
Bazel hosts Special Interest Groups (SIGs) to focus collaboration on particular
-areas and to support communication and coordination between [Bazel owners, maintainers, and contributors](/contribute/policy). This policy
+areas and to support communication and coordination between [Bazel owners,
+maintainers, and contributors](/contribute/policy). This policy
applies to [`bazelbuild`](http://github.com/bazelbuild).
SIGs do their work in public. The ideal scope for a SIG covers a well-defined
diff --git a/community/users.mdx b/community/users.mdx
index 227ee4bb..25835f3d 100644
--- a/community/users.mdx
+++ b/community/users.mdx
@@ -320,9 +320,11 @@ safety systems_.
Pigweed is an open-source solution for sustained, robust, and rapid embedded
product development for large teams. Pigweed has shipped in millions of
devices, including Google's suite of Pixel devices, Nest thermostats,
-[satellites](https://www.spinlaunch.com/), and [autonomous aerial drones](https://www.flyzipline.com/).
+[satellites](https://www.spinlaunch.com/), and [autonomous aerial
+drones](https://www.flyzipline.com/).
-Pigweed [uses Bazel as its primary build system](https://pigweed.dev/seed/0111-build-systems.html). The [Bazel for
+Pigweed [uses Bazel as its primary build
+system](https://pigweed.dev/seed/0111-build-systems.html). The [Bazel for
Embedded][pw-bazel-great] blog post discusses why we think it's a great build
system for embedded projects!
diff --git a/concepts/build-files.mdx b/concepts/build-files.mdx
index b85f472c..ec87f4db 100644
--- a/concepts/build-files.mdx
+++ b/concepts/build-files.mdx
@@ -132,6 +132,23 @@ for anyone to create new rules.
and binaries and tests can depend on libraries, with the expected
separate-compilation behavior.
+
+
## File encoding
`BUILD` and `.bzl` files should be encoded in UTF-8, of which ASCII is a valid
diff --git a/concepts/build-ref.mdx b/concepts/build-ref.mdx
index ee67bcc6..0af78970 100644
--- a/concepts/build-ref.mdx
+++ b/concepts/build-ref.mdx
@@ -19,7 +19,8 @@ its root; such a boundary marker file could be `MODULE.bazel`, `REPO.bazel`, or
in legacy contexts, `WORKSPACE` or `WORKSPACE.bazel`.
The repo in which the current Bazel command is being run is called the _main
-repo_. Other, (external) repos are defined by _repo rules_; see [external dependencies overview](/external/overview) for more information.
+repo_. Other, (external) repos are defined by _repo rules_; see [external
+dependencies overview](/external/overview) for more information.
## Workspace {#workspace}
@@ -96,4 +97,9 @@ have three properties: the list of packages they contain, their name, and other
package groups they include. The only allowed ways to refer to them are from the
`visibility` attribute of rules or from the `default_visibility` attribute of
the `package` function; they do not generate or consume files. For more
-information, refer to the [`package_group` documentation](/reference/be/functions#package_group).
+information, refer to the [`package_group`
+documentation](/reference/be/functions#package_group).
+
+
+ Labelsarrow_forward
+
diff --git a/concepts/dependencies.mdx b/concepts/dependencies.mdx
index e03c1af7..39fef86e 100644
--- a/concepts/dependencies.mdx
+++ b/concepts/dependencies.mdx
@@ -366,3 +366,21 @@ filegroup(
```
You can then reference the label `my_data` as the data dependency in your test.
+
+
+
diff --git a/concepts/labels.mdx b/concepts/labels.mdx
index 3f14e001..5b0b1c6a 100644
--- a/concepts/labels.mdx
+++ b/concepts/labels.mdx
@@ -12,7 +12,8 @@ form looks like:
```
The first part of the label is the repository name, `@@myrepo`. The double-`@`
-syntax signifies that this is a [*canonical* repo name](/external/overview#canonical-repo-name), which is unique within
+syntax signifies that this is a [*canonical* repo
+name](/external/overview#canonical-repo-name), which is unique within
the workspace. Labels with canonical repo names unambiguously identify a target
no matter which context they appear in.
@@ -240,3 +241,20 @@ the build.
This directed acyclic graph over targets is called the _target graph_ or
_build dependency graph_, and is the domain over which the
[Bazel Query tool](/query/guide) operates.
+
+
diff --git a/concepts/platforms.mdx b/concepts/platforms.mdx
index 09cede52..591ef313 100644
--- a/concepts/platforms.mdx
+++ b/concepts/platforms.mdx
@@ -79,7 +79,8 @@ To test your Android project with platforms, see
for support.
You can still use platform APIs with Apple builds (for example, when building
-with a mixture of Apple rules and pure C++) with [platform mappings](#platform-mappings).
+with a mixture of Apple rules and pure C++) with [platform
+mappings](#platform-mappings).
### Other languages {#other-languages}
@@ -243,7 +244,8 @@ sets `--cpu`, `--crossstool_top`, or other legacy flags, rules that read
When migrating your project to platforms, you must either convert changes like
`return { "//command_line_option:cpu": "arm" }` to `return {
-"//command_line_option:platforms": "//:my_arm_platform" }` or use [platform mappings](#platform-mappings) to support both styles during migration.
+"//command_line_option:platforms": "//:my_arm_platform" }` or use [platform
+mappings](#platform-mappings) to support both styles during migration.
window.
## Migrating your rule set {#migrating-your-rule-set}
@@ -362,8 +364,10 @@ attributes declare a language's tools (like `compiler =
this information to rules that need to build with these tools.
Toolchains declare the `constraint_value`s of machines they can
-[target][target_compatible_with Attribute](`target_compatible_with = ["@platforms//os:linux"]`) and machines their tools can
-[run on][exec_compatible_with Attribute](`exec_compatible_with = ["@platforms//os:mac"]`).
+[target][target_compatible_with Attribute]
+(`target_compatible_with = ["@platforms//os:linux"]`) and machines their tools can
+[run on][exec_compatible_with Attribute]
+(`exec_compatible_with = ["@platforms//os:mac"]`).
When building `$ bazel build //:myproject --platforms=//:myplatform`, Bazel
automatically selects a toolchain that can run on the build machine and
diff --git a/configure/attributes.mdx b/configure/attributes.mdx
index 4f03c453..7f4936bb 100644
--- a/configure/attributes.mdx
+++ b/configure/attributes.mdx
@@ -4,7 +4,8 @@ title: 'Configurable Build Attributes'
-**_Configurable attributes_**, commonly known as [`select()`](/reference/be/functions#select), is a Bazel feature that lets users toggle the values
+**_Configurable attributes_**, commonly known as [`select()`](
+/reference/be/functions#select), is a Bazel feature that lets users toggle the values
of build rule attributes at the command line.
This can be used, for example, for a multiplatform library that automatically
@@ -408,7 +409,8 @@ sh_library(
)
```
-If you need a `select` to match when multiple conditions match, consider [AND chaining](#and-chaining).
+If you need a `select` to match when multiple conditions match, consider [AND
+chaining](#and-chaining).
## OR chaining {#or-chaining}
diff --git a/configure/integrate-cpp.mdx b/configure/integrate-cpp.mdx
index 599fbd8f..b9ba8840 100644
--- a/configure/integrate-cpp.mdx
+++ b/configure/integrate-cpp.mdx
@@ -14,7 +14,8 @@ To depend on a C++ toolchain in your rule, set the `toolchains` parameter to
`use_cc_toolchain()`. Then, in the rule implementation, use
`find_cpp_toolchain(ctx)` to get the
[`CcToolchainInfo`](/rules/lib/providers/CcToolchainInfo). A complete working
-example can be found [in the rules_cc examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl).
+example can be found [in the rules_cc
+examples](https://github.com/bazelbuild/rules_cc/blob/main/examples/write_cc_toolchain_cpu/write_cc_toolchain_cpu.bzl).
## Generating command lines and environment variables using the C++ toolchain {#generate-command-lines-toolchain}
@@ -24,7 +25,8 @@ This is because when writing our own actions, they must behave
consistently with the C++ toolchain - for example, passing C++ command line
flags to a tool that invokes the C++ compiler behind the scenes.
-C++ rules use a special way of constructing command lines based on [feature configuration](/docs/cc-toolchain-config-reference). To construct a command line,
+C++ rules use a special way of constructing command lines based on [feature
+configuration](/docs/cc-toolchain-config-reference). To construct a command line,
you need the following:
* `features` and `action_configs` - these come from the `CcToolchainConfigInfo`
diff --git a/configure/windows.mdx b/configure/windows.mdx
index 573f660d..46e6073b 100644
--- a/configure/windows.mdx
+++ b/configure/windows.mdx
@@ -162,7 +162,8 @@ To build C++ targets with MSVC, you need:
set BAZEL_VC=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC
```
-* The [Windows SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk).
+* The [Windows
+ SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk).
The Windows SDK contains header files and libraries you need when building
Windows applications, including Bazel itself. By default, the latest Windows SDK installed will
@@ -181,7 +182,8 @@ To build C++ targets with MSVC, you need:
If everything is set up, you can build a C++ target now!
-Try building a target from one of our [sample projects](https://github.com/bazelbuild/bazel/tree/master/examples):
+Try building a target from one of our [sample
+projects](https://github.com/bazelbuild/bazel/tree/master/examples):
```
` is a common overload of `void accept(Bar value)`,
-so doing this often leads to violations of the [Overloads: never split](https://google.github.io/styleguide/javaguide.html#s3.4.2-ordering-class-contents)
+so doing this often leads to violations of the [Overloads: never
+split](https://google.github.io/styleguide/javaguide.html#s3.4.2-ordering-class-contents)
style-guide rule.
Tip: Using a custom `ResultSink` type instead of a generic one from
@@ -772,11 +776,14 @@ pattern after accepting output from either a subtask or SkyValue lookup.
Note that the implementation of `acceptBarError` eagerly forwards the result to
the `Caller.ResultSink`, as required by [Error bubbling](#error-bubbling).
-Alternatives for top-level `StateMachine`s are described in [`Driver`s and bridging to SkyFunctions](#drivers-and-bridging).
+Alternatives for top-level `StateMachine`s are described in [`Driver`s and
+bridging to SkyFunctions](#drivers-and-bridging).
### Error handling {#error-handling}
-There's a couple of examples of error handling already in [`Tasks.lookUp` callbacks](#tasks-lookup-callbacks) and [Propagating values between `StateMachines`](#propagating-values). Exceptions, other than
+There's a couple of examples of error handling already in [`Tasks.lookUp`
+callbacks](#tasks-lookup-callbacks) and [Propagating values between
+`StateMachines`](#propagating-values). Exceptions, other than
`InterruptedException` are not thrown, but instead passed around through
callbacks as values. Such callbacks often have exclusive-or semantics, with
exactly one of a value or error being passed.
@@ -1179,7 +1186,8 @@ states. Where it is possible, local stack `step` variables are young generation
variables and efficiently GC'd.
For `StateMachine` variables, breaking things down into subtasks and following
-the recommended pattern for [Propagating values between `StateMachine`s](#propagating-values) is also helpful. Observe that when
+the recommended pattern for [Propagating values between
+`StateMachine`s](#propagating-values) is also helpful. Observe that when
following the pattern, only child `StateMachine`s have references to parent
`StateMachine`s and not vice versa. This means that as children complete and
update the parents using result callbacks, the children naturally fall out of
@@ -1201,7 +1209,8 @@ potentially reflecting local behavior.
### Concurrency tree diagram {#concurrency-tree-diagram}
-The following is an alternative view of the diagram in [Structured concurrency](#structured-concurrency) that better depicts the tree structure.
+The following is an alternative view of the diagram in [Structured
+concurrency](#structured-concurrency) that better depicts the tree structure.
The blocks form a small tree.

diff --git a/docs/android-instrumentation-test.mdx b/docs/android-instrumentation-test.mdx
index e7be4e54..82fb7b1e 100644
--- a/docs/android-instrumentation-test.mdx
+++ b/docs/android-instrumentation-test.mdx
@@ -4,7 +4,8 @@ title: 'Android Instrumentation Tests'
-_If you're new to Bazel, start with the [Building Android with Bazel](/start/android-app) tutorial._
+_If you're new to Bazel, start with the [Building Android with
+Bazel](/start/android-app ) tutorial._

@@ -19,7 +20,9 @@ emulators in a sandbox, ensuring that tests always run from a clean state. Each
test gets an isolated emulator instance, allowing tests to run in parallel
without passing states between them.
-For more information on Android instrumentation tests, check out the [Android developer documentation](https://developer.android.com/training/testing/unit-testing/instrumented-unit-tests.html).
+For more information on Android instrumentation tests, check out the [Android
+developer
+documentation](https://developer.android.com/training/testing/unit-testing/instrumented-unit-tests.html).
Please file issues in the [GitHub issue tracker](https://github.com/bazelbuild/bazel/issues).
@@ -57,7 +60,8 @@ This results in output similar to the following:
release 4.1.0
```
-- **KVM**. Bazel requires emulators to have [hardware acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#accel-check)
+- **KVM**. Bazel requires emulators to have [hardware
+ acceleration](https://developer.android.com/studio/run/emulator-acceleration.html#accel-check)
with KVM on Linux. You can follow these
[installation instructions](https://help.ubuntu.com/community/KVM/Installation)
for Ubuntu.
@@ -172,9 +176,11 @@ The main attributes of the rule `android_instrumentation_test` are:
- `target_device`: An `android_device` target. This target describes the
specifications of the Android emulator which Bazel uses to create, launch and
- run the tests. See the [section on choosing an Android device](#android-device-target) for more information.
+ run the tests. See the [section on choosing an Android
+ device](#android-device-target) for more information.
-The test app's `AndroidManifest.xml` must include [an `` tag](https://developer.android.com/studio/test/#configure_instrumentation_manifest_settings).
+The test app's `AndroidManifest.xml` must include [an ``
+tag](https://developer.android.com/studio/test/#configure_instrumentation_manifest_settings).
This tag must specify the attributes for the **package of the target app** and
the **fully qualified class name of the instrumentation test runner**,
`androidx.test.runner.AndroidJUnitRunner`.
@@ -211,7 +217,8 @@ repositories:
- `@androidsdk`: The Android SDK. Download this through Android Studio.
- `@android_test_support`: Hosts the test runner, emulator launcher, and
- `android_device` targets. You can find the [latest release here](https://github.com/android/android-test/releases).
+ `android_device` targets. You can find the [latest release
+ here](https://github.com/android/android-test/releases).
Enable these dependencies by adding the following lines to your `WORKSPACE`
file:
@@ -237,7 +244,8 @@ android_test_repositories()
## Maven dependencies {#maven-dependencies}
-For managing dependencies on Maven artifacts from repositories, such as [Google Maven](https://maven.google.com) or [Maven Central](https://central.maven.org),
+For managing dependencies on Maven artifacts from repositories, such as [Google
+Maven](https://maven.google.com) or [Maven Central](https://central.maven.org),
you should use a Maven resolver, such as
[`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external).
@@ -366,7 +374,8 @@ the device/emulator listed in `adb devices`.
## Sample projects {#sample-projects}
-If you are looking for canonical project samples, see the [Android testing samples](https://github.com/googlesamples/android-testing#experimental-bazel-support)
+If you are looking for canonical project samples, see the [Android testing
+samples](https://github.com/googlesamples/android-testing#experimental-bazel-support)
for projects using Espresso and UIAutomator.
## Espresso setup {#espresso-setup}
@@ -555,7 +564,8 @@ API_LEVELS = [
## Known issues {#known-issues}
-- [Forked adb server processes are not terminated after tests](https://github.com/bazelbuild/bazel/issues/4853)
+- [Forked adb server processes are not terminated after
+ tests](https://github.com/bazelbuild/bazel/issues/4853)
- While APK building works on all platforms (Linux, macOS, Windows), testing
only works on Linux.
- Even with `--config=local_adb`, users still need to specify
diff --git a/docs/android-ndk.mdx b/docs/android-ndk.mdx
index abd76409..363b3620 100644
--- a/docs/android-ndk.mdx
+++ b/docs/android-ndk.mdx
@@ -4,7 +4,8 @@ title: 'Using the Android Native Development Kit with Bazel'
-_If you're new to Bazel, please start with the [Building Android with Bazel](/start/android-app) tutorial._
+_If you're new to Bazel, please start with the [Building Android with
+Bazel](/start/android-app ) tutorial._
## Overview {#overview}
@@ -156,7 +157,8 @@ more details.
## Example setup {#example-setup}
-This example is available in the [Bazel examples repository](https://github.com/bazelbuild/examples/tree/master/android/ndk).
+This example is available in the [Bazel examples
+repository](https://github.com/bazelbuild/examples/tree/master/android/ndk).
In the `BUILD.bazel` file, three targets are defined with the `android_binary`,
`android_library`, and `cc_library` rules.
diff --git a/docs/bazel-and-android.mdx b/docs/bazel-and-android.mdx
index d447f3f9..fcb65e56 100644
--- a/docs/bazel-and-android.mdx
+++ b/docs/bazel-and-android.mdx
@@ -12,7 +12,7 @@ Android projects with Bazel.
The following resources will help you work with Bazel on Android projects:
-* [Tutorial: Building an Android app](/start/android-app). This
+* [Tutorial: Building an Android app](/start/android-app ). This
tutorial is a good place to start learning about Bazel commands and concepts,
and how to build Android apps with Bazel.
* [Codelab: Building Android Apps with Bazel](https://developer.android.com/codelabs/bazel-android-intro#0).
diff --git a/docs/configurable-attributes.mdx b/docs/configurable-attributes.mdx
index 8048f3a6..075431b7 100644
--- a/docs/configurable-attributes.mdx
+++ b/docs/configurable-attributes.mdx
@@ -4,7 +4,8 @@ title: 'Configurable Build Attributes'
-**_Configurable attributes_**, commonly known as [`select()`](/reference/be/functions#select), is a Bazel feature that lets users toggle the values
+**_Configurable attributes_**, commonly known as [`select()`](
+/reference/be/functions#select), is a Bazel feature that lets users toggle the values
of build rule attributes at the command line.
This can be used, for example, for a multiplatform library that automatically
@@ -409,7 +410,8 @@ sh_library(
)
```
-If you need a `select` to match when multiple conditions match, consider [AND chaining](#and-chaining).
+If you need a `select` to match when multiple conditions match, consider [AND
+chaining](#and-chaining).
## OR chaining {#or-chaining}
diff --git a/docs/sandboxing.mdx b/docs/sandboxing.mdx
index aaadcd79..e5d006fe 100644
--- a/docs/sandboxing.mdx
+++ b/docs/sandboxing.mdx
@@ -50,7 +50,7 @@ containers on Linux and `sandbox-exec` on macOS, to constrain the action within
## What sandbox strategy to use {#sandboxing-strategies}
You can choose which kind of sandboxing to use, if any, with the
-[strategy flags](/docs/user-manual#strategy-options). Using the `sandboxed`
+[strategy flags](user-manual.html#strategy-options). Using the `sandboxed`
strategy makes Bazel pick one of the sandbox implementations listed below,
preferring an OS-specific sandbox to the less hermetic generic one.
[Persistent workers](/remote/persistent) run in a generic sandbox if you pass
diff --git a/docs/user-manual.mdx b/docs/user-manual.mdx
index e901366a..95e95954 100644
--- a/docs/user-manual.mdx
+++ b/docs/user-manual.mdx
@@ -1147,12 +1147,12 @@ during execution can be examined.
This option causes Bazel's execution phase to print the full command line
for each command prior to executing it.
-```
- >>>> # //examples/cpp:hello-world [action 'Linking examples/cpp/hello-world']
+
Where possible, commands are printed in a Bourne shell compatible syntax,
so that they can be easily copied and pasted to a shell command prompt.
diff --git a/extending/auto-exec-groups.mdx b/extending/auto-exec-groups.mdx
index 48100b71..36bcab48 100644
--- a/extending/auto-exec-groups.mdx
+++ b/extending/auto-exec-groups.mdx
@@ -29,7 +29,9 @@ doesn't detect that ([the error](#first-error-message) is raised), you can set
If you need to use multiple toolchains on a single execution platform (an action
uses executable or tools from two or more toolchains), you need to manually
-define [exec_groups][exec_groups](check [When should I use a custom exec_group?][multiple_toolchains_exec_groups] section).
+define [exec_groups][exec_groups] (check
+[When should I use a custom exec_group?][multiple_toolchains_exec_groups]
+section).
## History {#history}
@@ -42,7 +44,8 @@ my_rule = rule(
)
```
-Rule `my_rule` registers two toolchain types. This means that the [Toolchain Resolution](https://bazel.build/extending/toolchains#toolchain-resolution) used
+Rule `my_rule` registers two toolchain types. This means that the [Toolchain
+Resolution](https://bazel.build/extending/toolchains#toolchain-resolution) used
to find an execution platform which supports both toolchain types. The selected
execution platform was used for each registered action inside the rule, unless
specified differently with [exec_groups][exec_groups].
diff --git a/extending/concepts.mdx b/extending/concepts.mdx
index 988538fa..3864fc88 100644
--- a/extending/concepts.mdx
+++ b/extending/concepts.mdx
@@ -22,14 +22,16 @@ Before learning the more advanced concepts, first:
## Macros and rules {#macros-and-rules}
A macro is a function that instantiates rules. Macros come in two flavors:
-[symbolic macros](/extending/macros) (new in Bazel 8) and [legacy macros](/extending/legacy-macros). The two flavors of macros are defined
+[symbolic macros](/extending/macros) (new in Bazel 8) and [legacy
+macros](/extending/legacy-macros). The two flavors of macros are defined
differently, but behave almost the same from the point of view of a user. A
macro is useful when a `BUILD` file is getting too repetitive or too complex, as
it lets you reuse some code. The function is evaluated as soon as the `BUILD`
file is read. After the evaluation of the `BUILD` file, Bazel has little
information about macros. If your macro generates a `genrule`, Bazel will
behave *almost* as if you declared that `genrule` in the `BUILD` file. (The one
-exception is that targets declared in a symbolic macro have [special visibility semantics](/extending/macros#visibility): a symbolic macro can hide its internal
+exception is that targets declared in a symbolic macro have [special visibility
+semantics](/extending/macros#visibility): a symbolic macro can hide its internal
targets from the rest of the package.)
A [rule](/extending/rules) is more powerful than a macro. It can access Bazel
@@ -76,7 +78,8 @@ they will not be executed.
## Creating extensions
* [Create your first macro](/rules/macro-tutorial) in order to reuse some code.
- Then [learn more about macros](/extending/macros) and [using them to create "custom verbs"](/rules/verbs-tutorial).
+ Then [learn more about macros](/extending/macros) and [using them to create
+ "custom verbs"](/rules/verbs-tutorial).
* [Follow the rules tutorial](/rules/rules-tutorial) to get started with rules.
Next, you can read more about the [rules concepts](/extending/rules).
@@ -91,7 +94,8 @@ them within reach:
## Going further
In addition to [macros](/extending/macros) and [rules](/extending/rules), you
-may want to write [aspects](/extending/aspects) and [repository rules](/external/repo).
+may want to write [aspects](/extending/aspects) and [repository
+rules](/external/repo).
* Use [Buildifier](https://github.com/bazelbuild/buildtools)
consistently to format and lint your code.
diff --git a/extending/config.mdx b/extending/config.mdx
index 2e1331c0..436397ab 100644
--- a/extending/config.mdx
+++ b/extending/config.mdx
@@ -45,9 +45,6 @@ set via [user-defined transitions](#user-defined-transitions).
[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/configurations/basic_build_setting)
-Note: Before defining your own build setting, check if one of the [predefined
-settings](#predefined-settings) is suitable.
-
#### The `build_setting` `rule()` parameter {#rule-parameter}
Build settings are rules like any other rule and are differentiated using the
@@ -174,22 +171,6 @@ flavor(
)
```
-#### Scope
-
-Build settings are by default only applied to the `target` [configuration]
-(/extending/rules#configurations), and won't be applied to the `exec`
-configuration. To have the build setting applied to both the `target` and `exec`
-configurations set the `scope` attribute to `"universal"`.
-
-```python
-# example/BUILD
-load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
-bool_flag(
- name = "use_this_for_compiler_and_sources",
- scope = "universal"
-)
-```
-
### Predefined settings {#predefined-settings}
[End to end example](https://github.com/bazelbuild/examples/tree/HEAD/configurations/use_skylib_build_setting)
diff --git a/extending/depsets.mdx b/extending/depsets.mdx
index 8f0f31b0..4e84d3f2 100644
--- a/extending/depsets.mdx
+++ b/extending/depsets.mdx
@@ -113,7 +113,8 @@ need to ensure that if `B` depends on `A`, then `A.o` comes before `B.o` on the
linker’s command line. Other tools might have the opposite requirement.
Three traversal orders are supported: `postorder`, `preorder`, and
-`topological`. The first two work exactly like [tree traversals](https://en.wikipedia.org/wiki/Tree_traversal#Depth-first_search)
+`topological`. The first two work exactly like [tree
+traversals](https://en.wikipedia.org/wiki/Tree_traversal#Depth-first_search)
except that they operate on DAGs and skip already visited nodes. The third order
works as a topological sort from root to leaves, essentially the same as
preorder except that shared children are listed only after all of their parents.
diff --git a/extending/exec-groups.mdx b/extending/exec-groups.mdx
index 68003af0..bd2e6db1 100644
--- a/extending/exec-groups.mdx
+++ b/extending/exec-groups.mdx
@@ -72,7 +72,8 @@ test rules.
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`](/rules/lib/builtins/actions#run) and
+param of action generating methods, specifically [`ctx.actions.run`]
+(/rules/lib/builtins/actions#run) and
[`ctx.actions.run_shell`](/rules/lib/builtins/actions#run_shell).
```python
diff --git a/extending/legacy-macros.mdx b/extending/legacy-macros.mdx
index 564f1211..6827a07c 100644
--- a/extending/legacy-macros.mdx
+++ b/extending/legacy-macros.mdx
@@ -11,7 +11,7 @@ anymore, and Bazel sees only the concrete set of instantiated rules.
## Why you shouldn't use legacy macros (and should use Symbolic macros instead) {#no-legacy-macros}
-Where possible you should use [symbolic macros](/extending/macros#macros).
+Where possible you should use [symbolic macros](macros.md#macros).
Symbolic macros
@@ -20,7 +20,7 @@ Symbolic macros
* Take typed attributes, which in turn means automatic label and select
conversion.
* Are more readable
-* Will soon have [lazy evaluation](/extending/macros#laziness)
+* Will soon have [lazy evaluation](macros.md#laziness)
## Usage {#usage}
@@ -154,7 +154,7 @@ the macro), use the function
## Label resolution in macros {#label-resolution}
Since legacy macros are evaluated in the
-[loading phase](/extending/concepts#evaluation-model), label strings such as
+[loading phase](concepts.md#evaluation-model), label strings such as
`"//foo:bar"` that occur in a legacy macro are interpreted relative to the
`BUILD` file in which the macro is used rather than relative to the `.bzl` file
in which it is defined. This behavior is generally undesirable for macros that
diff --git a/extending/macros.mdx b/extending/macros.mdx
index 44b7faae..7920d7c6 100644
--- a/extending/macros.mdx
+++ b/extending/macros.mdx
@@ -12,7 +12,7 @@ Macros are mainly used for encapsulation and code reuse of existing rules and
other macros.
Macros come in two flavors: symbolic macros, which are described on this page,
-and [legacy macros](/extending/legacy-macros). Where possible, we recommend using
+and [legacy macros](legacy-macros.md). Where possible, we recommend using
symbolic macros for code clarity.
Symbolic macros offer typed arguments (string to label conversion, relative to
@@ -33,7 +33,8 @@ two required parameters: `attrs` and `implementation`.
### Attributes {#attributes}
-`attrs` accepts a dictionary of attribute name to [attribute types](https://bazel.build/rules/lib/toplevel/attr#members), which represents
+`attrs` accepts a dictionary of attribute name to [attribute
+types](https://bazel.build/rules/lib/toplevel/attr#members), which represents
the arguments to the macro. Two common attributes – `name` and `visibility` –
are implicitly added to all macros and are not included in the dictionary passed
to `attrs`.
@@ -67,7 +68,9 @@ To support this pattern, a macro can *inherit attributes* from a rule or another
macro by passing the [rule](https://bazel.build/rules/lib/builtins/rule) or
[macro symbol](https://bazel.build/rules/lib/builtins/macro) to `macro()`'s
`inherit_attrs` argument. (You can also use the special string `"common"`
-instead of a rule or macro symbol to inherit the [common attributes defined for all Starlark build rules](https://bazel.build/reference/be/common-definitions#common-attributes).)
+instead of a rule or macro symbol to inherit the [common attributes defined for
+all Starlark build
+rules](https://bazel.build/reference/be/common-definitions#common-attributes).)
Only public attributes get inherited, and the attributes in the macro's own
`attrs` dictionary override inherited attributes with the same name. You can
also *remove* inherited attributes by using `None` as a value in the `attrs`
diff --git a/extending/platforms.mdx b/extending/platforms.mdx
index f95f5e6a..7009de11 100644
--- a/extending/platforms.mdx
+++ b/extending/platforms.mdx
@@ -256,7 +256,8 @@ cc_library(
You can use the
[`IncompatiblePlatformProvider`](/rules/lib/providers/IncompatiblePlatformProvider)
-in `bazel cquery`'s [Starlark output format](/query/cquery#output-format-definition) to distinguish
+in `bazel cquery`'s [Starlark output
+format](/query/cquery#output-format-definition) to distinguish
incompatible targets from compatible ones.
This can be used to filter out incompatible targets. The example below will
@@ -277,4 +278,5 @@ $ bazel cquery //... --output=starlark --starlark:file=example.cquery
### Known Issues
-Incompatible targets [ignore visibility restrictions](https://github.com/bazelbuild/bazel/issues/16044).
+Incompatible targets [ignore visibility
+restrictions](https://github.com/bazelbuild/bazel/issues/16044).
diff --git a/extending/rules.mdx b/extending/rules.mdx
index 8a4efe20..07515c96 100644
--- a/extending/rules.mdx
+++ b/extending/rules.mdx
@@ -451,7 +451,8 @@ def _example_library_impl(ctx):
If `DefaultInfo` is not returned by a rule implementation or the `files`
parameter is not specified, `DefaultInfo.files` defaults to all
-*predeclared outputs* (generally, those created by [output attributes](#output_attributes)).
+*predeclared outputs* (generally, those created by [output
+attributes](#output_attributes)).
Rules that perform actions should provide default outputs, even if those outputs
are not expected to be directly used. Actions that are not in the graph of the
@@ -542,7 +543,7 @@ provider instances satisfy certain invariants, or to give users a cleaner API fo
obtaining an instance.
This is done by passing an `init` callback to the
-[`provider`](/rules/lib/globals/bzl#provider) function. If this callback is given, the
+[`provider`](/rules/lib/globals/bzl.html#provider) function. If this callback is given, the
return type of `provider()` changes to be a tuple of two values: the provider
symbol that is the ordinary return value when `init` is not used, and a "raw
constructor".
@@ -994,7 +995,8 @@ By using `configuration_field`, the dependency on the Java LCOV merger tool can
be avoided as long as coverage is not requested.
When the test is run, it should emit coverage information in the form of one or
-more [LCOV files](https://manpages.debian.org/unstable/lcov/geninfo.1.en.html#TRACEFILE_FORMAT)
+more [LCOV files]
+(https://manpages.debian.org/unstable/lcov/geninfo.1.en.html#TRACEFILE_FORMAT)
with unique names into the directory specified by the `COVERAGE_DIR` environment
variable. Bazel will then merge these files into a single LCOV file using the
`_lcov_merger` tool. If present, it will also collect C/C++ coverage using the
diff --git a/extending/toolchains.mdx b/extending/toolchains.mdx
index 33f8bac9..9534774d 100644
--- a/extending/toolchains.mdx
+++ b/extending/toolchains.mdx
@@ -583,7 +583,8 @@ The set of available toolchains, in priority order, is created from
4. Toolchains registered in the "WORKSPACE suffix"; this is only used by
certain native rules bundled with the Bazel installation.
-**NOTE:** [Pseudo-targets like `:all`, `:*`, and `/...`](/run/build#specifying-build-targets) are ordered by Bazel's package
+**NOTE:** [Pseudo-targets like `:all`, `:*`, and
+`/...`](/run/build#specifying-build-targets) are ordered by Bazel's package
loading mechanism, which uses a lexicographic ordering.
The resolution steps are as follows.
diff --git a/external/extension.mdx b/external/extension.mdx
index 9a8dae94..15a1961d 100644
--- a/external/extension.mdx
+++ b/external/extension.mdx
@@ -6,7 +6,8 @@ title: 'Module extensions'
Module extensions allow users to extend the module system by reading input data
from modules across the dependency graph, performing necessary logic to resolve
-dependencies, and finally creating repos by calling [repo rules](/external/repo). These extensions have capabilities similar to repo
+dependencies, and finally creating repos by calling [repo
+rules](/external/repo). These extensions have capabilities similar to repo
rules, which enables them to perform file I/O, send network requests, and so on.
Among other things, they allow Bazel to interact with other package management
systems while also respecting the dependency graph built out of Bazel modules.
diff --git a/external/faq.mdx b/external/faq.mdx
index 7b1a31e8..817040a4 100644
--- a/external/faq.mdx
+++ b/external/faq.mdx
@@ -76,7 +76,7 @@ failures provide clear error messages and actionable migration paths.
**Legacy documentation:**
-The [`compatibility_level`](/external/module#compatibility_level) of a Bazel module
+The [`compatibility_level`](module.md#compatibility_level) of a Bazel module
should be incremented _in the same commit_ that introduces a backwards
incompatible ("breaking") change.
@@ -114,7 +114,7 @@ generally interested in, and they can be solved without `load`s:
`load`s in MODULE.bazel files, `include` cannot be used in non-root modules.
* Users of the old WORKSPACE system might remember declaring a repo, and then
immediately `load`ing from that repo to perform complex logic. This
- capability has been replaced by [module extensions](/external/extension).
+ capability has been replaced by [module extensions](extension).
### Can I specify a SemVer range for a `bazel_dep`? {#can-i-specify-a-semver-range-for-a-bazel-dep}
@@ -123,18 +123,20 @@ support version ranges (implicitly or explicitly), and this often requires a
constraint solver (making the output harder to predict for users) and makes
version resolution nonreproducible without a lockfile.
-Bazel instead uses [Minimal Version Selection](/external/module#version-selection) like
+Bazel instead uses [Minimal Version Selection](module#version-selection) like
Go, which in contrast makes the output easy to predict and guarantees
reproducibility. This is a tradeoff that matches Bazel's design goals.
-Furthermore, Bazel module versions are [a superset of SemVer](/external/module#version-format), so what makes sense in a strict SemVer
+Furthermore, Bazel module versions are [a superset of
+SemVer](module#version-format), so what makes sense in a strict SemVer
environment doesn't always carry over to Bazel module versions.
### Can I automatically get the latest version for a `bazel_dep`? {#can-i-automatically-get-the-latest-version-for-a-bazel-dep}
Some users occasionally ask for the ability to specify `bazel_dep(name = "foo",
version = "latest")` to automatically get the latest version of a dep. This is
-similar to [the question about SemVer ranges](#can-i-specify-a-semver-range-for-a-bazel-dep), and the answer is also
+similar to [the question about SemVer
+ranges](#can-i-specify-a-semver-range-for-a-bazel-dep), and the answer is also
no.
The recommended solution here is to have automation take care of this. For
@@ -192,7 +194,8 @@ wonder which system is consulted first. The short answer is that MODULE.bazel
The long answer is that "which evaluates first" is not the right question to
ask; rather, the right question to ask is: in the context of the repo with
-[canonical name](/external/overview#canonical-repo-name) `@@foo`, what does the [apparent repo name](/external/overview#apparent-repo-name) `@bar` resolve to? Alternatively, what
+[canonical name](overview#canonical-repo-name) `@@foo`, what does the [apparent
+repo name](overview#apparent-repo-name) `@bar` resolve to? Alternatively, what
is the repo mapping of `@@base`?
Labels with apparent repo names (a single leading `@`) can refer to different
@@ -201,7 +204,8 @@ things based on the context they're resolved from. When you see a label
what the context repo is: for example, if the label is in a BUILD file located
in the repo `@@foo`, then the context repo is `@@foo`.
-Then, depending on what the context repo is, the ["repository visibility" table](/external/migration#repository-visibility) in the migration guide can
+Then, depending on what the context repo is, the ["repository
+visibility" table](migration#repository-visibility) in the migration guide can
be used to find out which repo an apparent name actually resolves to.
* If the context repo is the main repo (`@@`):
@@ -253,7 +257,8 @@ as the context repo.
Use the `bazel fetch` command to prefetch repos. You can use the `--repo` flag
(like `bazel fetch --repo @foo`) to fetch only the repo `@foo` (resolved in the
-context of the main repo, see [question above](#which-is-evaluated-first-module-bazel-or-workspace)), or use a target
+context of the main repo, see [question
+above](#which-is-evaluated-first-module-bazel-or-workspace)), or use a target
pattern (like `bazel fetch @foo//:bar`) to fetch all transitive dependencies of
`@foo//:bar` (this is equivalent to `bazel build --nobuild @foo//:bar`).
@@ -261,7 +266,7 @@ To make sure no fetches happen during a build, use `--nofetch`. More precisely,
this makes any attempt to run a non-local repository rule fail.
If you want to fetch repos _and_ modify them to test locally, consider using
-the [`bazel vendor`](/external/vendor) command.
+the [`bazel vendor`](vendor) command.
### How do I insulate my builds from the Internet? {#how-do-i-insulate-my-builds-from-the-internet}
@@ -303,17 +308,21 @@ preferring IPv4 if enabled. In some situations, for example when the IPv4
network cannot resolve/reach external addresses, this can cause `Network
unreachable` exceptions and build failures. In these cases, you can override
Bazel's behavior to prefer IPv6 by using the
-[`java.net.preferIPv6Addresses=true` system property](https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html).
+[`java.net.preferIPv6Addresses=true` system
+property](https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html).
Specifically:
-* Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` [startup option](/docs/user-manual#startup-options), for example by adding the
+* Use `--host_jvm_args=-Djava.net.preferIPv6Addresses=true` [startup
+ option](/docs/user-manual#startup-options), for example by adding the
following line in your [`.bazelrc` file](/run/bazelrc):
`startup --host_jvm_args=-Djava.net.preferIPv6Addresses=true`
* When running Java build targets that need to connect to the internet (such
as for integration tests), use the
- `--jvmopt=-Djava.net.preferIPv6Addresses=true` [tool flag](/docs/user-manual#jvmopt). For example, include in your [`.bazelrc` file](/run/bazelrc):
+ `--jvmopt=-Djava.net.preferIPv6Addresses=true` [tool
+ flag](/docs/user-manual#jvmopt). For example, include in your [`.bazelrc`
+ file](/run/bazelrc):
`build --jvmopt=-Djava.net.preferIPv6Addresses`
@@ -321,7 +330,8 @@ Specifically:
[`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external) for
dependency version resolution, also add
`-Djava.net.preferIPv6Addresses=true` to the `COURSIER_OPTS` environment
- variable to [provide JVM options for Coursier](https://github.com/bazelbuild/rules_jvm_external#provide-jvm-options-for-coursier-with-coursier_opts).
+ variable to [provide JVM options for
+ Coursier](https://github.com/bazelbuild/rules_jvm_external#provide-jvm-options-for-coursier-with-coursier_opts).
### Can repo rules be run remotely with remote execution? {#can-repo-rules-be-run-remotely-with-remote-execution}
@@ -346,7 +356,9 @@ build rules, which would naturally allow them to be run remotely, but conversely
raise new architectural concerns (for example, the `query` commands would
potentially need to run actions, complicating their design).
-For more previous discussion on this topic, see [A way to support repositories that need Bazel for being fetched](https://github.com/bazelbuild/bazel/discussions/20464).
+For more previous discussion on this topic, see [A way to support repositories
+that need Bazel for being
+fetched](https://github.com/bazelbuild/bazel/discussions/20464).
[npm-semver]: https://docs.npmjs.com/about-semantic-versioning
[cargo-semver]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#version-requirement-syntax
diff --git a/external/migration.mdx b/external/migration.mdx
index c3030533..38e049fd 100644
--- a/external/migration.mdx
+++ b/external/migration.mdx
@@ -4,14 +4,15 @@ title: 'Bzlmod Migration Guide'
-Due to the [shortcomings of WORKSPACE](/external/overview#workspace-shortcomings), Bzlmod is replacing the
+Due to the [shortcomings of
+WORKSPACE](/external/overview#workspace-shortcomings), Bzlmod is replacing the
legacy WORKSPACE system. The WORKSPACE file is already disabled in Bazel 8 (late
2024) and will be removed in Bazel 9 (late 2025). This guide helps you migrate
your project to Bzlmod and drop WORKSPACE for managing external dependencies.
## Why migrate to Bzlmod? {#why-migrate-to-bzlmod}
-* There are many [advantages](/external/overview#benefits) compared to the legacy
+* There are many [advantages](overview#benefits) compared to the legacy
WORKSPACE system, which helps to ensure a healthy growth of the Bazel
ecosystem.
@@ -30,7 +31,8 @@ Recommended migration process:
streamline the migration process as much as possible.
2. If there are errors left after using the migration tool, resolve them
manually. For understanding the main differences between concepts inside
- `WORKSPACE` and `MODULE.bazel` files, check [WORKSPACE versus Bzlmod](#workspace-vs-bzlmod) section.
+ `WORKSPACE` and `MODULE.bazel` files, check [WORKSPACE versus
+ Bzlmod](#workspace-vs-bzlmod) section.
## WORKSPACE vs Bzlmod {#workspace-vs-bzlmod}
@@ -140,7 +142,9 @@ Bazel module when it also adopts Bzlmod.
* **Bzlmod**
- With Bzlmod, as long as your dependency is available in [Bazel Central Registry](https://registry.bazel.build) or your custom [Bazel registry](/external/registry), you can simply depend on it with a
+ With Bzlmod, as long as your dependency is available in [Bazel Central
+ Registry](https://registry.bazel.build) or your custom [Bazel
+ registry](/external/registry), you can simply depend on it with a
[`bazel_dep`](/rules/lib/globals/module#bazel_dep) directive.
```python
@@ -171,7 +175,8 @@ repository.
If your dependency is not a Bazel project or not yet available in any Bazel
registry, you can introduce it using
-[`use_repo_rule`](/external/module#use_repo_rule) or [module extensions](/external/extension).
+[`use_repo_rule`](/external/module#use_repo_rule) or [module
+extensions](/external/extension).
* **WORKSPACE**
@@ -612,7 +617,8 @@ flag after fetching all repos needed for a build.
## Manual migration {#manual-migration}
This section provides useful information and guidance for your **manual** Bzlmod
-migration process. For more automatized migration process, check [recommended migration process](#how-migrate-to-bzlmod) section.
+migration process. For more automatized migration process, check [recommended
+migration process](#how-migrate-to-bzlmod) section.
### Know your dependencies in WORKSPACE {#know-deps-in-workspace}
@@ -626,7 +632,8 @@ macros.
Fortunately, the flag
[`--experimental_repository_resolved_file`][resolved_file_flag]
can help. This flag essentially generates a "lock file" of all fetched external
-dependencies in your last Bazel command. You can find more details in this [blog post](https://blog.bazel.build/2018/07/09/bazel-sync-and-resolved-file.html).
+dependencies in your last Bazel command. You can find more details in this [blog
+post](https://blog.bazel.build/2018/07/09/bazel-sync-and-resolved-file.html).
[resolved_file_flag]: /reference/command-line-reference#flag--experimental_repository_resolved_file
@@ -667,9 +674,11 @@ You may also know `bazel query` can be used for inspecting repository rules with
bazel query --output=build //external:
```
-While it is more convenient and much faster, [bazel query can lie about external dependency version](https://github.com/bazelbuild/bazel/issues/12947),
+While it is more convenient and much faster, [bazel query can lie about
+external dependency version](https://github.com/bazelbuild/bazel/issues/12947),
so be careful using it! Querying and inspecting external
-dependencies with Bzlmod is going to achieved by a [new subcommand](https://github.com/bazelbuild/bazel/issues/15365).
+dependencies with Bzlmod is going to achieved by a [new
+subcommand](https://github.com/bazelbuild/bazel/issues/15365).
#### Built-in default dependencies {#builtin-default-deps}
@@ -716,7 +725,8 @@ Using the WORKSPACE.bzlmod file can make the migration easier because:
#### Repository visibility {#repository-visibility}
Bzlmod is able to control which other repositories are visible from a given
-repository, check [repository names and strict deps](/external/module#repository_names_and_strict_deps) for more details.
+repository, check [repository names and strict
+deps](/external/module#repository_names_and_strict_deps) for more details.
Here is a summary of repository visibilities from different types of
repositories when also taking WORKSPACE into consideration.
@@ -729,7 +739,8 @@ repositories when also taking WORKSPACE into consideration.
| WORKSPACE Repos | All visible | Not visible | Not visible | All visible |
Note: For the root module, if a repository `@foo` is defined in WORKSPACE and
-`@foo` is also used as an [apparent repository name](/external/overview#apparent-repo-name) in MODULE.bazel, then `@foo`
+`@foo` is also used as an [apparent repository
+name](/external/overview#apparent-repo-name) in MODULE.bazel, then `@foo`
refers to the one introduced in MODULE.bazel.
Note: For a module extension generated repository `@bar`, if `@foo` is used as
@@ -774,7 +785,9 @@ the project. Take note of a few things when creating the source archive:
GitHub isn't going to guarantee the checksum of source archives generated on
demand. In short, URLs in the form of
`https://github.com///releases/download/...` is considered stable
- while `https://github.com///archive/...` is not. Check [GitHub Archive Checksum Outage](https://blog.bazel.build/2023/02/15/github-archive-checksum.html)
+ while `https://github.com///archive/...` is not. Check [GitHub
+ Archive Checksum
+ Outage](https://blog.bazel.build/2023/02/15/github-archive-checksum.html)
for more context.
* **Make sure the source tree follows the layout of the original repository.**
@@ -803,7 +816,8 @@ Pull Request.
[bcr_contrib_guide]: https://github.com/bazelbuild/bazel-central-registry/tree/main/docs#contribute-a-bazel-module
-It is **highly recommended** to set up the [Publish to BCR](https://github.com/bazel-contrib/publish-to-bcr) GitHub App for your
+It is **highly recommended** to set up the [Publish to
+BCR](https://github.com/bazel-contrib/publish-to-bcr) GitHub App for your
repository to automate the process of submitting your module to the BCR.
## Best practices {#best-practices}
diff --git a/external/migration_tool.mdx b/external/migration_tool.mdx
index cf59c153..e9435ced 100644
--- a/external/migration_tool.mdx
+++ b/external/migration_tool.mdx
@@ -102,7 +102,8 @@ migrate2bzlmod -t <targets>
script.
* `extension_for_XXX` - A file containing a module extension
definition. The migration tool generates these files for dependencies that
- are not standard Bazel modules but can be managed using Bzlmod's [module extensions](/external/extension).
+ are not standard Bazel modules but can be managed using Bzlmod's [module
+ extensions](/external/extension).
### Flags {#migration-script-flags}
@@ -299,7 +300,8 @@ def my_custom_macro(name):
The end goal is to have `MODULE.bazel` file and delete the `WORKSPACE` file,
without impacting the user experience.
-The first step is to follow [How to Use the Migration Tool](#migration-tool-how-to-use), which mostly is checking the bazel version
+The first step is to follow [How to Use the Migration
+Tool](#migration-tool-how-to-use), which mostly is checking the bazel version
(it must be Bazel 7) and adding an alias to the migration script.
Then, running `migrate2bzlmod -t=//...` outputs:
@@ -632,7 +634,8 @@ may arise during the Bzlmod migration.
### Migration Report Generation {#migration-tool-report-generation}
This file is updated with each run of the migration script or it's generated
-from scratch if it's the first run or if the [`--i` flag](#migration-script-flags) is used. The report contains:
+from scratch if it's the first run or if the [`--i`
+flag](#migration-script-flags) is used. The report contains:
* Command for local testing.
* List of direct dependencies (at least the ones which are directly used in
diff --git a/external/mod-command.mdx b/external/mod-command.mdx
index 9eea1572..69a3cd8c 100644
--- a/external/mod-command.mdx
+++ b/external/mod-command.mdx
@@ -64,9 +64,11 @@ The available subcommands and their respective required arguments are:
* ``: All present versions of the module ``.
-* `@`: The repo with the given [apparent name](/external/overview#apparent-repo-name) in the context of the `--base_module`.
+* `@`: The repo with the given [apparent
+ name](overview#apparent-repo-name) in the context of the `--base_module`.
-* `@@`: The repo with the given [canonical name](/external/overview#canonical-repo-name).
+* `@@`: The repo with the given [canonical
+ name](overview#canonical-repo-name).
In a context requiring specifying modules, ``s referring to repos that
correspond to modules (as opposed to extension-generated repos) can also be
@@ -90,7 +92,8 @@ The following options only affect the subcommands that print graphs (`graph`,
information about the version resolution of each module. If the module
version changed during resolution, show either which version replaced it or
what was the original version, the reason it was replaced, and which modules
- requested the new version if the reason was [Minimal Version Selection](/external/module#version-selection).
+ requested the new version if the reason was [Minimal Version
+ Selection](module#version-selection).
* `--include_unused` *default: "false"*: Include in the output graph the
modules which were originally present in the dependency graph, but became
@@ -210,7 +213,7 @@ use_repo(toolchains, my_jdk="remotejdk17_linux")
-
+ Graph After Resolution
{/* digraph mygraph {
diff --git a/external/module.mdx b/external/module.mdx
index f4fe31a4..e3fe9137 100644
--- a/external/module.mdx
+++ b/external/module.mdx
@@ -56,7 +56,8 @@ Any valid SemVer version is a valid Bazel module version. Additionally, two
SemVer versions `a` and `b` compare `a < b` if and only if the same holds when
they're compared as Bazel module versions.
-Finally, to learn more about module versioning, [see the `MODULE.bazel` FAQ](/external/faq#module-versioning-best-practices).
+Finally, to learn more about module versioning, [see the `MODULE.bazel`
+FAQ](faq#module-versioning-best-practices).
## Version selection {#version-selection}
@@ -110,7 +111,8 @@ serves multiple purposes:
version, regardless of which versions of the dependency are requested in the
dependency graph.
* With the `registry` attribute, you can force this dependency to come from a
- specific registry, instead of following the normal [registry selection](/external/registry#selecting_registries) process.
+ specific registry, instead of following the normal [registry
+ selection](/external/registry#selecting_registries) process.
* With the `patch*` attributes, you can specify a set of patches to apply to
the downloaded module.
@@ -151,7 +153,8 @@ Bazel supports the following non-registry overrides:
Note that setting a version value in the source archive `MODULE.bazel` can have
downsides when the module is being overridden with a non-registry override. To
-learn more about this [see the `MODULE.bazel` FAQ](/external/faq#module-versioning-best-practices).
+learn more about this [see the `MODULE.bazel`
+FAQ](faq#module-versioning-best-practices).
## Define repos that don't represent Bazel modules {#use_repo_rule}
@@ -159,11 +162,13 @@ With `bazel_dep`, you can define repos that represent other Bazel modules.
Sometimes there is a need to define a repo that does _not_ represent a Bazel
module; for example, one that contains a plain JSON file to be read as data.
-In this case, you could use the [`use_repo_rule` directive](/rules/lib/globals/module#use_repo_rule) to directly define a repo
+In this case, you could use the [`use_repo_rule`
+directive](/rules/lib/globals/module#use_repo_rule) to directly define a repo
by invoking a repo rule. This repo will only be visible to the module it's
defined in.
-Under the hood, this is implemented using the same mechanism as [module extensions](/external/extension), which lets you define repos with more
+Under the hood, this is implemented using the same mechanism as [module
+extensions](/external/extension), which lets you define repos with more
flexibility.
## Repository names and strict deps
diff --git a/external/overview.mdx b/external/overview.mdx
index ed819f7e..c6a24ec4 100644
--- a/external/overview.mdx
+++ b/external/overview.mdx
@@ -15,7 +15,8 @@ concepts in more detail.
## Overview of the system {#overview}
-Bazel's external dependency system works on the basis of [*Bazel modules*](#module), each of which is a versioned Bazel project, and
+Bazel's external dependency system works on the basis of [*Bazel
+modules*](#module), each of which is a versioned Bazel project, and
[*repositories*](#repository) (or repos), which are directory trees containing
source files.
@@ -32,7 +33,8 @@ bazel_dep(name = "platforms", version = "0.0.11")
```
From there, Bazel looks up all transitive dependency modules in a
-[*Bazel registry*](/external/registry) — by default, the [Bazel Central Registry](https://bcr.bazel.build/). The registry provides the
+[*Bazel registry*](registry) — by default, the [Bazel Central
+Registry](https://bcr.bazel.build/). The registry provides the
dependencies' `MODULE.bazel` files, which allows Bazel to discover the entire
transitive dependency graph before performing version resolution.
@@ -42,7 +44,7 @@ Bazel consults the registry again to learn how to define a repo for each module
of the time, these are just archives downloaded from the internet and extracted.
Modules can also specify customized pieces of data called *tags*, which are
-consumed by [*module extensions*](/external/extension) after module resolution
+consumed by [*module extensions*](extension) after module resolution
to define additional repos. These extensions can perform actions like file I/O
and sending network requests. Among other things, they allow Bazel to interact
with other package management systems while also respecting the dependency graph
@@ -61,12 +63,12 @@ Bazel's external dependency system offers a wide range of benefits.
### Automatic Dependency Resolution {#automatic-dependency-resolution}
- **Deterministic Version Resolution**: Bazel adopts the deterministic
- [MVS](/external/module#version-selection) version resolution algorithm,
+ [MVS](module#version-selection) version resolution algorithm,
minimizing conflicts and addressing diamond dependency issues.
- **Simplified Dependency Management**: `MODULE.bazel` declares only direct
dependencies, while transitive dependencies are automatically resolved,
providing a clearer overview of the project's dependencies.
-- **[Strict Dependency visibility](/external/module#repository_names_and_strict_deps)**:
+- **[Strict Dependency visibility](module#repository_names_and_strict_deps)**:
Only direct dependencies are visible, ensuring correctness and
predictability.
@@ -93,18 +95,19 @@ Bazel's external dependency system offers a wide range of benefits.
### Advanced Features {#advanced-features}
-- **[Module Extensions](/external/extension)**: The
+- **[Module Extensions](extension)**: The
[`use_repo_rule`](/rules/lib/globals/module#use_repo_rule) and module
extension features allow flexible use of custom repository rules and
resolution logic to introduce any non-Bazel dependencies.
-- **[`bazel mod` Command](/external/mod-command)**: The sub-command offers
+- **[`bazel mod` Command](mod-command)**: The sub-command offers
powerful ways to inspect external dependencies. You know exactly how an
external dependency is defined and where it comes from.
-- **[Vendor Mode](/external/vendor)**: Pre-fetch the exact external dependencies you
+- **[Vendor Mode](vendor)**: Pre-fetch the exact external dependencies you
need to facilitate offline builds.
-- **[Lockfile](/external/lockfile)**: The lockfile improves build reproducibility and
+- **[Lockfile](lockfile)**: The lockfile improves build reproducibility and
accelerates dependency resolution.
-- **(Upcoming) [BCR Provenance Attestations](https://github.com/bazelbuild/bazel-central-registry/discussions/2721)**:
+- **(Upcoming) [BCR Provenance
+ Attestations](https://github.com/bazelbuild/bazel-central-registry/discussions/2721)**:
Strengthen supply chain security by ensuring verified provenance of
dependencies.
@@ -119,7 +122,7 @@ dependencies on other modules.
In a local Bazel workspace, a module is represented by a repository.
-For more details, see [Bazel modules](/external/module).
+For more details, see [Bazel modules](module).
### Repository {#repository}
@@ -177,7 +180,7 @@ and extract it", or "fetch a certain Maven artifact and make it available as a
`java_import` target", or simply "symlink a local directory". Every repo is
**defined** by calling a repo rule with an appropriate number of arguments.
-See [Repository rules](/external/repo) for more information about how to write
+See [Repository rules](repo) for more information about how to write
your own repository rules.
The most common repo rules by far are
@@ -228,7 +231,8 @@ contain anything to serve as a repo boundary file; however, it can also be used
to specify some common attributes for all build targets inside the repo.
The syntax of a `REPO.bazel` file is similar to `BUILD` files, except that no
-`load` statements are supported. The `repo()` function takes the same arguments as the [`package()` function](/reference/be/functions#package) in `BUILD` files; whereas `package()`
+`load` statements are supported. The `repo()` function takes the same arguments as the [`package()`
+function](/reference/be/functions#package) in `BUILD` files; whereas `package()`
specifies common attributes for all build targets inside the package, `repo()`
analogously does so for all build targets inside the repo.
@@ -289,7 +293,7 @@ pain points, including:
Due to the shortcomings of WORKSPACE, the new module-based system (codenamed
"Bzlmod") gradually replaced the legacy WORKSPACE system between Bazel 6 and 9.
-Read the [Bzlmod migration guide](/external/migration) on how to migrate
+Read the [Bzlmod migration guide](migration) on how to migrate
to Bzlmod.
### External links on Bzlmod {#external-links}
diff --git a/external/registry.mdx b/external/registry.mdx
index 2bd0c114..1d441581 100644
--- a/external/registry.mdx
+++ b/external/registry.mdx
@@ -21,15 +21,17 @@ An index registry must have the following format:
* `/modules`: A directory containing a subdirectory for each module in this
registry
* `/modules/$MODULE`: A directory containing a subdirectory for each version
- of the module named `$MODULE`, as well as the [`metadata.json` file](#metadata-json) containing metadata for this module.
+ of the module named `$MODULE`, as well as the [`metadata.json`
+ file](#metadata-json) containing metadata for this module.
* `/modules/$MODULE/$VERSION`: A directory containing the following files:
* `MODULE.bazel`: The `MODULE.bazel` file of this module version. Note
that this is the `MODULE.bazel` file read during Bazel's external
dependency resolution, _not_ the one from the source archive (unless
- there's a [non-registry override](/external/module#non-registry_overrides)). Also note that it's
+ there's a [non-registry
+ override](/external/module#non-registry_overrides)). Also note that it's
best to use this file to set the version of a release and avoid doing so
in the source archive `MODULE.bazel` file. To learn more about module
- versioning, [see the FAQ](/external/faq#module-versioning-best-practices).
+ versioning, [see the FAQ](faq.md#module-versioning-best-practices).
* [`source.json`](#source-json): A JSON file containing information on how
to fetch the source of this module version
* `patches/`: An optional directory containing patch files, only used when
@@ -63,7 +65,8 @@ module, with the following fields:
* `versions`: An array of strings, each denoting a version of the module
available in this registry. This array should match the children of the
module directory.
-* `yanked_versions`: A JSON object specifying the [*yanked* versions](/external/module#yanked_versions) of this module. The keys
+* `yanked_versions`: A JSON object specifying the [*yanked*
+ versions](/external/module#yanked_versions) of this module. The keys
should be versions to yank, and the values should be descriptions of
why the version is yanked, ideally containing a link to more
information.
diff --git a/external/repo.mdx b/external/repo.mdx
index 958d403e..b878f030 100644
--- a/external/repo.mdx
+++ b/external/repo.mdx
@@ -76,7 +76,8 @@ specified.
The input parameter `repository_ctx` can be used to access attribute values, and
non-hermetic functions (finding a binary, executing a binary, creating a file in
-the repository or downloading a file from the Internet). See [the API docs](/rules/lib/builtins/repository_ctx) for more context. Example:
+the repository or downloading a file from the Internet). See [the API
+docs](/rules/lib/builtins/repository_ctx) for more context. Example:
```python
def _impl(repository_ctx):
@@ -145,7 +146,8 @@ definition has the `configure` attribute set, use `bazel fetch --force
## Examples
-- [C++ auto-configured toolchain](https://cs.opensource.google/bazel/bazel/+/master:tools/cpp/cc_configure.bzl;drc=644b7d41748e09eff9e47cbab2be2263bb71f29a;l=176):
+- [C++ auto-configured
+ toolchain](https://cs.opensource.google/bazel/bazel/+/master:tools/cpp/cc_configure.bzl;drc=644b7d41748e09eff9e47cbab2be2263bb71f29a;l=176):
it uses a repo rule to automatically create the C++ configuration files for
Bazel by looking for the local C++ compiler, the environment and the flags
the C++ compiler supports.
diff --git a/external/vendor.mdx b/external/vendor.mdx
index ab82c46c..2c850def 100644
--- a/external/vendor.mdx
+++ b/external/vendor.mdx
@@ -25,7 +25,9 @@ absolute path.
## Vendor a specific external repository {#vendor-specific-repository}
You can use the `vendor` command with the `--repo` flag to specify which repo
-to vendor, it accepts both [canonical repo name](/external/overview#canonical-repo-name) and [apparent repo name](/external/overview#apparent-repo-name).
+to vendor, it accepts both [canonical repo
+name](/external/overview#canonical-repo-name) and [apparent repo
+name](/external/overview#apparent-repo-name).
For example, running:
diff --git a/help.mdx b/help.mdx
index e6a1d79e..6226c6e5 100644
--- a/help.mdx
+++ b/help.mdx
@@ -51,4 +51,5 @@ what level of support Bazel provides.
## File a bug {#file-bug}
-If you encounter a bug or want to request a feature, file a [GitHub Issue](https://github.com/bazelbuild/bazel/issues).
+If you encounter a bug or want to request a feature, file a [GitHub
+Issue](https://github.com/bazelbuild/bazel/issues).
diff --git a/install/bazelisk.mdx b/install/bazelisk.mdx
index 3acb1147..6c0d5cc1 100644
--- a/install/bazelisk.mdx
+++ b/install/bazelisk.mdx
@@ -18,7 +18,8 @@ For more details, see
## Updating Bazel
Bazel has a [backward compatibility policy](/release/backward-compatibility)
-(see [guidance for rolling out incompatible changes](/contribute/breaking-changes) if you
+(see [guidance for rolling out incompatible
+changes](/contribute/breaking-changes) if you
are the author of one). That page summarizes best practices on how to test and
migrate your project with upcoming incompatible changes and how to provide
feedback to the incompatible change authors.
diff --git a/install/compile-source.mdx b/install/compile-source.mdx
index 9479e0cb..c2fb5afd 100644
--- a/install/compile-source.mdx
+++ b/install/compile-source.mdx
@@ -55,7 +55,8 @@ it by typing `bazel` in a terminal.
**Reason**: To build Bazel from a GitHub source tree, you need a pre-existing
Bazel binary. You can install one from a package manager or download one from
-GitHub. See [Installing Bazel](/install). (Or you can [build from scratch (bootstrap)](#bootstrap-bazel).)
+GitHub. See [Installing Bazel](/install). (Or you can [build from
+scratch (bootstrap)](#bootstrap-bazel).)
**Troubleshooting**:
@@ -247,7 +248,8 @@ For instructions for Unix-like systems, see
```
* **The Visual C++ compiler.** Install the Visual C++ compiler either as part
- of Visual Studio 2015 or newer, or by installing the latest [Build Tools for Visual Studio 2017](https://aka.ms/BuildTools).
+ of Visual Studio 2015 or newer, or by installing the latest [Build Tools
+ for Visual Studio 2017](https://aka.ms/BuildTools).
* **JDK.** Version 21 is required.
diff --git a/install/ide.mdx b/install/ide.mdx
index d43d0696..22ee969f 100644
--- a/install/ide.mdx
+++ b/install/ide.mdx
@@ -23,8 +23,10 @@ a discussion on [GitHub](https://github.com/bazelbuild/bazel/discussions).
Official Bazel plugins exist for many of the JetBrains-associated IDEs.
Full documentation is linked from the listings on the JetBrains Marketplace:
-* [IntelliJ plugin](https://plugins.jetbrains.com/plugin/22977-bazel)
-* [Android Studio plugin](https://plugins.jetbrains.com/plugin/9185-android-studio-with-bazel)
+* [IntelliJ
+ plugin](https://plugins.jetbrains.com/plugin/22977-bazel)
+* [Android Studio
+ plugin](https://plugins.jetbrains.com/plugin/9185-android-studio-with-bazel)
* [CLion plugin](https://plugins.jetbrains.com/plugin/9554-clion-with-bazel)
Features:
@@ -60,7 +62,8 @@ Features:
* Starlark debugger for `.bzl` files during a build (set breakpoints, step
through code, inspect variables, and so on)
-Find [the plugin on the Visual Studio marketplace](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel)
+Find [the plugin on the Visual Studio
+marketplace](https://marketplace.visualstudio.com/items?itemName=BazelBuild.vscode-bazel)
or the [OpenVSX marketplace](https://open-vsx.org/extension/BazelBuild/vscode-bazel).
The plugin is [open source](https://github.com/bazelbuild/vscode-bazel).
@@ -81,7 +84,8 @@ See also: [Autocomplete for Source Code](#autocomplete-for-source-code)
### Emacs {#emacs}
-See [`bazelbuild/bazel-emacs-mode` on GitHub](https://github.com/bazelbuild/emacs-bazel-mode)
+See [`bazelbuild/bazel-emacs-mode` on
+GitHub](https://github.com/bazelbuild/emacs-bazel-mode)
See also: [Autocomplete for Source Code](#autocomplete-for-source-code)
@@ -119,5 +123,6 @@ tool for building Bazel targets when source files change.
## Building your own IDE plugin {#build-own-plugin}
-Read the [**IDE support** blog post](https://blog.bazel.build/2016/06/10/ide-support.html) to learn more about
+Read the [**IDE support** blog
+post](https://blog.bazel.build/2016/06/10/ide-support.html) to learn more about
the Bazel APIs to use when building an IDE plugin.
diff --git a/install/index.mdx b/install/index.mdx
index 912ac212..dc1e6d28 100644
--- a/install/index.mdx
+++ b/install/index.mdx
@@ -22,7 +22,7 @@ officially support them. Contact the package maintainers for support.
* [Fedora](https://copr.fedorainfracloud.org/coprs/lihaohong/bazel)
* [FreeBSD](https://www.freshports.org/devel/bazel)
* [Homebrew](https://formulae.brew.sh/formula/bazel)
-* [mise](/install/mise)
+* [mise](install/mise)
* [Nixpkgs](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/build-managers/bazel)
* [openSUSE](/install/suse)
* [Scoop](https://github.com/scoopinstaller/scoop-main/blob/master/bucket/bazel.json)
diff --git a/install/windows.mdx b/install/windows.mdx
index dc2edb0a..9b0b07de 100644
--- a/install/windows.mdx
+++ b/install/windows.mdx
@@ -34,7 +34,8 @@ To check your Windows version:
Alternatively you can:
-* [Download the Bazel binary (`bazel-version-windows-x86_64.exe`) from GitHub](https://github.com/bazelbuild/bazel/releases).
+* [Download the Bazel binary (`bazel-version-windows-x86_64.exe`) from
+ GitHub](https://github.com/bazelbuild/bazel/releases).
* [Install Bazel from Chocolatey](#chocolately)
* [Install Bazel from Scoop](#scoop)
* [Build Bazel from source](/install/compile-source)
@@ -210,7 +211,8 @@ If that doesn't help:
its dependencies, such as the MSYS2 shell. This will not install Visual C++
though.
-See [Chocolatey installation and package maintenance guide](/contribute/windows-chocolatey-maintenance) for more
+See [Chocolatey installation and package maintenance
+guide](/contribute/windows-chocolatey-maintenance) for more
information about the Chocolatey package.
### Using Scoop {#scoop}
@@ -227,7 +229,8 @@ information about the Chocolatey package.
scoop install bazel
```
-See [Scoop installation and package maintenance guide](/contribute/windows-scoop-maintenance) for more
+See [Scoop installation and package maintenance
+guide](/contribute/windows-scoop-maintenance) for more
information about the Scoop package.
### Build from source {#build-from-source}
diff --git a/migrate/maven.mdx b/migrate/maven.mdx
index 3b564450..ac8a042f 100644
--- a/migrate/maven.mdx
+++ b/migrate/maven.mdx
@@ -19,7 +19,8 @@ directly run by Bazel since there's no Maven compatibility layer.
## Before you begin {#before-you-begin}
* [Install Bazel](/install) if it's not yet installed.
-* If you're new to Bazel, go through the tutorial [Introduction to Bazel: Build Java](/start/java) before you start migrating. The tutorial explains
+* If you're new to Bazel, go through the tutorial [Introduction to Bazel:
+ Build Java](/start/java) before you start migrating. The tutorial explains
Bazel's concepts, structure, and label syntax.
## Differences between Maven and Bazel {#dif-maven-bazel}
@@ -43,7 +44,8 @@ The steps below describe how to migrate your project to Bazel:
3. [Create more BUILD files](#3-build)
4. [Build using Bazel](#4-build)
-Examples below come from a migration of the [Guava project](https://github.com/google/guava) from Maven to Bazel. The
+Examples below come from a migration of the [Guava
+project](https://github.com/google/guava) from Maven to Bazel. The
Guava project used is release `v31.1`. The examples using Guava do not walk
through each step in the migration, but they do show the files and contents that
are generated or added manually for the migration.
@@ -61,12 +63,14 @@ has no external dependencies, this file can be empty.
If your project depends on files or packages that are not in one of the
project's directories, specify these external dependencies in the MODULE.bazel
file. You can use `rules_jvm_external` to manage dependencies from Maven. For
-instructions about using this ruleset, see [the README](https://github.com/bazelbuild/rules_jvm_external/#rules_jvm_external)
+instructions about using this ruleset, see [the
+README](https://github.com/bazelbuild/rules_jvm_external/#rules_jvm_external)
.
#### Guava project example: external dependencies {#guava-1}
-You can list the external dependencies of the [Guava project](https://github.com/google/guava) with the
+You can list the external dependencies of the [Guava
+project](https://github.com/google/guava) with the
[`rules_jvm_external`](https://github.com/bazelbuild/rules_jvm_external)
ruleset.
@@ -160,7 +164,8 @@ your build by adding more `BUILD` files with more granular targets.
* `resources`: Use globbing to list all resources in your project.
* `deps`: You need to determine which external dependencies your
project needs.
- * Take a look at the [example below of this top-level BUILD file](#guava-2) from the migration of the Guava project.
+ * Take a look at the [example below of this top-level BUILD
+ file](#guava-2) from the migration of the Guava project.
3. Now that you have a `BUILD` file at the root of your project, build your
project to ensure that it works. On the command line, from your workspace
diff --git a/migrate/xcode.mdx b/migrate/xcode.mdx
index 5f6a05a2..84e52f86 100644
--- a/migrate/xcode.mdx
+++ b/migrate/xcode.mdx
@@ -32,7 +32,8 @@ Before you begin, do the following:
1. [Install Bazel](/install) if you have not already done so.
-2. If you're not familiar with Bazel and its concepts, complete the [iOS app tutorial](/start/ios-app)). You should understand the Bazel workspace,
+2. If you're not familiar with Bazel and its concepts, complete the [iOS app
+ tutorial](/start/ios-app)). You should understand the Bazel workspace,
including the `MODULE.bazel` and `BUILD` files, as well as the concepts of
targets, build rules, and Bazel packages.
@@ -43,7 +44,8 @@ Before you begin, do the following:
Unlike Xcode, Bazel requires you to explicitly declare all dependencies for
every target in the `BUILD` file.
-For more information on external dependencies, see [Working with external dependencies](/docs/external).
+For more information on external dependencies, see [Working with external
+dependencies](/docs/external).
## Build or test an Xcode project with Bazel {#build-xcode-project}
@@ -82,7 +84,8 @@ Note: Place the project source code within the directory tree containing the
To integrate SwiftPM dependencies into the Bazel workspace with
[swift_bazel](https://github.com/cgrindel/swift_bazel), you must
-convert them into Bazel packages as described in the [following tutorial](https://chuckgrindel.com/swift-packages-in-bazel-using-swift_bazel/)
+convert them into Bazel packages as described in the [following
+tutorial](https://chuckgrindel.com/swift-packages-in-bazel-using-swift_bazel/)
.
Note: SwiftPM support is a manual process with many variables. SwiftPM
@@ -100,7 +103,8 @@ initial build of the project as follows:
* [Step 3b: (Optional) Add the test target(s)](#step-3b-optional-add-the-test-target-s)
* [Step 3c: Add the library target(s)](#step-3c-add-the-library-target-s)
-**Tip:** To learn more about packages and other Bazel concepts, see [Workspaces, packages, and targets](/concepts/build-ref).
+**Tip:** To learn more about packages and other Bazel concepts, see [Workspaces,
+packages, and targets](/concepts/build-ref).
#### Step 3a: Add the application target {#add-app-target}
@@ -128,7 +132,8 @@ In the target, specify the following at the minimum:
#### Step 3b: (Optional) Add the test target(s) {#add-test-target}
-Bazel's [Apple build rules](https://github.com/bazelbuild/rules_apple) support running
+Bazel's [Apple build
+rules](https://github.com/bazelbuild/rules_apple) support running
unit and UI tests on all Apple platforms. Add test targets as follows:
* [`macos_unit_test`](https://github.com/bazelbuild/rules_apple/blob/master/doc/rules-macos.md#macos_unit_test)
@@ -176,7 +181,8 @@ all sources and/or headers of a certain type. Use it carefully as it might
include files you do not want Bazel to build.
You can browse existing examples for various types of applications directly in
-the [rules_apple examples directory](https://github.com/bazelbuild/rules_apple/tree/master/examples/). For
+the [rules_apple examples
+directory](https://github.com/bazelbuild/rules_apple/tree/master/examples/). For
example:
* [macOS application targets](https://github.com/bazelbuild/rules_apple/tree/master/examples/macos)
@@ -185,7 +191,8 @@ example:
* [Multi platform applications (macOS, iOS, watchOS, tvOS)](https://github.com/bazelbuild/rules_apple/tree/master/examples/multi_platform)
-For more information on build rules, see [Apple Rules for Bazel](https://github.com/bazelbuild/rules_apple).
+For more information on build rules, see [Apple Rules for
+Bazel](https://github.com/bazelbuild/rules_apple).
At this point, it is a good idea to test the build:
diff --git a/navigation.json b/navigation.json
index a3d046ca..59780a3c 100644
--- a/navigation.json
+++ b/navigation.json
@@ -8,14 +8,6 @@
}
]
},
- {
- "version": "9.1",
- "languages": [
- {
- "$ref": "./navigation/9.1.en.json"
- }
- ]
- },
{
"version": "9.0",
"languages": [
diff --git a/query/cquery.mdx b/query/cquery.mdx
index f7195d40..e734f231 100644
--- a/query/cquery.mdx
+++ b/query/cquery.mdx
@@ -8,7 +8,8 @@ title: 'Configurable Query (cquery)'
[`select()`](/docs/configurable-attributes) and build options' effects on the
build graph.
-It achieves this by running over the results of Bazel's [analysis phase](/extending/concepts#evaluation-model),
+It achieves this by running over the results of Bazel's [analysis
+phase](/extending/concepts#evaluation-model),
which integrates these effects. `query`, by contrast, runs over the results of
Bazel's loading phase, before options are evaluated.
@@ -139,7 +140,8 @@ $ bazel cquery //foo --universe_scope=//foo,//genrule_with_foo_as_tool
If you want to precisely declare which instance to query over, use
the [`config`](#config) function.
-See `query`'s [target pattern documentation](/query/language#target-patterns) for more information on target
+See `query`'s [target pattern
+documentation](/query/language#target-patterns) for more information on target
patterns.
## Functions {#functions}
@@ -541,7 +543,8 @@ different niches. Consider the following to decide which is right for you:
It's therefore prone to picking up results from past queries.
For example, `genrule` exerts an exec transition on its `tools` attribute -
-that is, it configures its tools in the [exec configuration](https://bazel.build/rules/rules#configurations).
+that is, it configures its tools in the [exec configuration]
+(https://bazel.build/rules/rules#configurations).
You can see the lingering effects of that transition below.
diff --git a/query/language.mdx b/query/language.mdx
index ee539b29..53e11e57 100644
--- a/query/language.mdx
+++ b/query/language.mdx
@@ -1145,7 +1145,8 @@ is being used.
### On the ordering of results {#results-ordering}
-Although query expressions always follow the "[law of conservation of graph order](#graph-order)", _presenting_ the results may be done
+Although query expressions always follow the "[law of
+conservation of graph order](#graph-order)", _presenting_ the results may be done
in either a dependency-ordered or unordered manner. This does **not**
influence the targets in the result set or how the query is computed. It only
affects how the results are printed to stdout. Moreover, nodes that are
@@ -1291,7 +1292,8 @@ and `maxrank` output formats print the labels of each
target in the resulting graph, but instead of appearing in
topological order, they appear in rank order, preceded by their
rank number. These are unaffected by the result ordering
-`--[no]order_results` flag (see [notes on the ordering of results](#result-order)).
+`--[no]order_results` flag (see [notes on
+the ordering of results](#result-order)).
There are two variants of this format: `minrank` ranks
each node by the length of the shortest path from a root node to it.
diff --git a/query/quickstart.mdx b/query/quickstart.mdx
index d2085b8b..eebcec98 100644
--- a/query/quickstart.mdx
+++ b/query/quickstart.mdx
@@ -205,7 +205,7 @@ dot -Tpng < graph.in > graph.png
```
If you open up `graph.png`, you should see something like this. The graph below has been simplified to make the essential path details clearer in this guide.
-
+
This helps when you want to see the outputs of the different query functions throughout this guide.
@@ -421,7 +421,7 @@ bazel query --noimplicit_deps 'deps(:runner)' --output graph > graph2.in
dot -Tpng < graph2.in > graph2.png
```
-[](/query/images/query_graph2.png)
+[](images/query_graph2.png)
Looking at `graph2.png`, you can see that `Smoothie` has no shared dependencies with other dishes but is just another target that the `Chef` relies on.
@@ -465,7 +465,7 @@ bazel query "allpaths(//src/main/java/com/example/restaurant/..., //src/main/jav
//src/main/java/com/example/restaurant:chef
```
-
+
The output of `allpaths()` is a little harder to read as it is a flattened list of the dependencies. Visualizing this graph using Graphviz makes the relationship clearer to understand.
diff --git a/reference/be/c-cpp.mdx b/reference/be/c-cpp.mdx
index 84b19d3e..234c8f98 100644
--- a/reference/be/c-cpp.mdx
+++ b/reference/be/c-cpp.mdx
@@ -626,7 +626,7 @@ dependency or make sure that the `exports_filter` doesn't catch this target.
| `roots` | List of [labels](/concepts/labels); default is `[]` |
| `shared_lib_name` | String; default is `""` By default cc_shared_library will use a name for the shared library output file based on the target's name and the platform. This includes an extension and sometimes a prefix. Sometimes you may not want the default name, for example, when loading C++ shared libraries for Python the default lib\* prefix is often not desired, in which case you can use this attribute to choose a custom name. |
| `static_deps` | List of strings; default is `[]` |
-| `user_link_flags` | List of strings; default is `[]` Any additional flags that you may want to pass to the linker. For example, to make the linker aware of a linker script passed via additional_linker_inputs you can use the following: ``` cc_shared_library( name = "foo_shared", additional_linker_inputs = select({ "//src/conditions:linux": [ ":foo.lds", ":additional_script.txt", ], "//conditions:default": []}), user_link_flags = select({ "//src/conditions:linux": [ "-Wl,-rpath,kittens", "-Wl,--version-script=$(location :foo.lds)", "-Wl,--script=$(location :additional_script.txt)", ], "//conditions:default": []}), ... ) ``` |
+| `user_link_flags` | List of strings; default is `[]` Any additional flags that you may want to pass to the linker. For example, to make the linker aware of a linker script passed via additional_linker_inputs you can use the following: ``` cc_shared_library( name = "foo_shared", additional_linker_inputs = select({ "//src/conditions:linux": [ ":foo.lds", ":additional_script.txt", ], "//conditions:default": []}), user_link_flags = select({ "//src/conditions:linux": [ "-Wl,-rpath,kittens", "-Wl,--version-script=$(location :foo.lds)", "-Wl,--script=$(location :additional_script.txt)", ], "//conditions:default": []}), ... ) ``` |
| `win_def_file` | [Label](/concepts/labels); default is `None` The Windows DEF file to be passed to linker. This attribute should only be used when Windows is the target platform. It can be used to [export symbols](https://msdn.microsoft.com/en-us/library/d91k01sh.aspx) during linking a shared library. |
## cc_static_library
diff --git a/reference/be/common-definitions.mdx b/reference/be/common-definitions.mdx
index 6ae7a79a..478d3b91 100644
--- a/reference/be/common-definitions.mdx
+++ b/reference/be/common-definitions.mdx
@@ -59,7 +59,7 @@ but not all.
| Attribute | Description |
| --- | --- |
-| `data` | List of [labels](/concepts/labels); default is `[]` Files needed by this rule at runtime. May list file or rule targets. Generally allows any target. The `runfiles` of targets in the `data` attribute appear in the `*.runfiles` area of any executable which is output by or has a runtime dependency on this target. This may include data files or binaries used when this target's [`srcs`](#typical.srcs) are executed. Typically, this includes the targets' default outputs and their transitive runfiles, but this depends on the implementation of the rules for those targets; most rules include their default outputs in their `runfiles`. See the [data dependencies](/concepts/dependencies#data-dependencies) section for more information about how to depend on and use data files. New rules should define a `data` attribute if they process inputs which might use other inputs at runtime. Rules' implementation functions must also [populate the target's runfiles](https://bazel.build/rules/rules#runfiles) from the outputs and runfiles of any `data` attribute, as well as runfiles from any dependency attribute which provides either source code or runtime dependencies. |
+| `data` | List of [labels](/concepts/labels); default is `[]` Files needed by this rule at runtime. May list file or rule targets. Generally allows any target. The default outputs and runfiles of targets in the `data` attribute should appear in the `*.runfiles` area of any executable which is output by or has a runtime dependency on this target. This may include data files or binaries used when this target's [`srcs`](#typical.srcs) are executed. See the [data dependencies](/concepts/dependencies#data-dependencies) section for more information about how to depend on and use data files. New rules should define a `data` attribute if they process inputs which might use other inputs at runtime. Rules' implementation functions must also [populate the target's runfiles](https://bazel.build/rules/rules#runfiles) from the outputs and runfiles of any `data` attribute, as well as runfiles from any dependency attribute which provides either source code or runtime dependencies. |
| `deps` | List of [labels](/concepts/labels); default is `[]` Dependencies for this target. Generally should only list rule targets. (Though some rules permit files to be listed directly in `deps`, this should be avoided when possible.) Language-specific rules generally limit the listed targets to those with specific [providers](https://bazel.build/extending/rules#providers). The precise semantics of what it means for a target to depend on another using `deps` are specific to the kind of rule, and the rule-specific documentation goes into more detail. For rules which process source code, `deps` generally specifies code dependencies used by the code in [`srcs`](#typical.srcs). Most often, a `deps` dependency is used to allow one module to use symbols defined in another module written in the same programming language and separately compiled. Cross-language dependencies are also permitted in many cases: For example, a `java_library` target may depend on C++ code in a `cc_library` target, by listing the latter in the `deps` attribute. See the definition of [dependencies](/concepts/build-ref#deps) for more information. |
| `licenses` | List of strings; [nonconfigurable](#configurable-attributes); default is `["none"]` A list of license-type strings to be used for this particular target. This is part of a deprecated licensing API that Bazel no longer uses. Don't use this. |
| `srcs` | List of [labels](/concepts/labels); default is `[]` Files processed or included by this rule. Generally lists files directly, but may list rule targets (like `filegroup` or `genrule`) to include their default outputs. Language-specific rules often require that the listed files have particular file extensions. |
@@ -75,8 +75,8 @@ rules.
| `compatible_with` | List of [labels](/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The list of environments this target can be built for, in addition to default-supported environments. This is part of Bazel's constraint system, which lets users declare which targets can and cannot depend on each other. For example, externally deployable binaries shouldn't depend on libraries with company-secret code. See [ConstraintSemantics](https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/analysis/constraints/ConstraintSemantics.java#L46) for details. |
| `deprecation` | String; [nonconfigurable](#configurable-attributes); default is `None` An explanatory warning message associated with this target. Typically this is used to notify users that a target has become obsolete, or has become superseded by another rule, is private to a package, or is perhaps considered harmful for some reason. It is a good idea to include some reference (like a webpage, a bug number or example migration CLs) so that one can easily find out what changes are required to avoid the message. If there is a new target that can be used as a drop in replacement, it is a good idea to just migrate all users of the old target. This attribute has no effect on the way things are built, but it may affect a build tool's diagnostic output. The build tool issues a warning when a rule with a `deprecation` attribute is depended upon by a target in another package. Intra-package dependencies are exempt from this warning, so that, for example, building the tests of a deprecated rule does not encounter a warning. If a deprecated target depends on another deprecated target, no warning message is issued. Once people have stopped using it, the target can be removed. |
| `exec_compatible_with` | List of [labels](/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` A list of `constraint_values` that must be present in the execution platform of this target's default exec group. This is in addition to any constraints already set by the rule type. Constraints are used to restrict the list of available execution platforms. For more details, see the description of [toolchain resolution](/docs/toolchains#toolchain-resolution). and [exec groups](/extending/exec-groups) |
-| `exec_group_compatible_with` | Dictionary of strings to lists of [labels](/concepts/labels); [nonconfigurable](#configurable-attributes); default is `{}` A dictionary of exec group names to lists of `constraint_values` that must be present in the execution platform for the given exec group. This is in addition to any constraints already set on the exec group's definition. Constraints are used to restrict the list of available execution platforms. For more details, see the description of [toolchain resolution](/docs/toolchains#toolchain-resolution). and [exec groups](/extending/exec-groups) |
-| `exec_properties` | Dictionary of strings; default is `{}` A dictionary of strings that will be added to the `exec_properties` of a platform selected for this target. See `exec_properties` of the [platform](platforms-and-toolchains#platform) rule. If a key is present in both the platform and target-level properties, the value will be taken from the target. Keys can be prefixed with the name of an execution group followed by a `.` to apply them only to that particular exec group. |
+| `exec_group_compatible_with` | Dictionary of strings to lists of [labels](/concepts/labels); [nonconfigurable](#configurable-attributes); default is `{}` A dictionary of exec group names to lists of `constraint_values` that must be present in the execution platform for the given exec group. This is in addition to any constraints already set on the exec group's definition. Constraints are used to restrict the list of available execution platforms. For more details, see the description of [toolchain resolution](/docs/toolchains#toolchain-resolution). and [exec groups](/extending/exec-groups) |
+| `exec_properties` | Dictionary of strings; default is `{}` A dictionary of strings that will be added to the `exec_properties` of a platform selected for this target. See `exec_properties` of the [platform](platforms-and-toolchains#platform) rule. If a key is present in both the platform and target-level properties, the value will be taken from the target. Keys can be prefixed with the name of an execution group followed by a `.` to apply them only to that particular exec group. |
| `features` | List of *feature* strings; default is `[]` A feature is string tag that can be enabled or disabled on a target. The meaning of a feature depends on the rule itself. This `features` attribute is combined with the [package](/reference/be/functions#package) level `features` attribute. For example, if the features ["a", "b"] are enabled on the package level, and a target's `features` attribute contains ["-a", "c"], the features enabled for the rule will be "b" and "c". [See example](https://github.com/bazelbuild/examples/blob/main/rules/features/BUILD). |
| `package_metadata` | List of [labels](/concepts/labels); [nonconfigurable](#configurable-attributes); default is the package's `default_package_metadata` A list of labels that are associated metadata about this target. Typically, the labels are simple rules that return a provider of constant values. Rules and aspects may use these labels to perform some additional analysis on the build graph. The canonical use case is that of [rules_license](https://github.com/bazelbuild/rules_license). For that use case, `package_metadata` and `default_package_metadata` is used to attach information about a package's licence or version to targets. An aspect applied to a top-level binary can be used to gather those and produce compliance reports. |
| `restricted_to` | List of [labels](/concepts/labels); [nonconfigurable](#configurable-attributes); default is `[]` The list of environments this target can be built for, *instead* of default-supported environments. This is part of Bazel's constraint system. See `compatible_with` for details. |
@@ -93,9 +93,9 @@ This section describes attributes that are common to all test rules.
| Attribute | Description |
| --- | --- |
| `args` | List of strings; subject to [$(location)](/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/reference/be/make-variables) substitution, and [Bourne shell tokenization](#sh-tokenization); default is `[]` Command line arguments that Bazel passes to the target when it is executed with `bazel test`. These arguments are passed before any `--test_arg` values specified on the `bazel test` command line. |
-| `env` | Dictionary of strings; values are subject to [$(location)](/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/reference/be/make-variables) substitution; default is `{}` Specifies additional environment variables to set when the test is executed by `bazel test`. This attribute only applies to native rules, like `cc_test`, `py_test`, and `sh_test`. It does not apply to Starlark-defined test rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a [RunEnvironmentInfo](/rules/lib/providers/RunEnvironmentInfo) Provider. [TestEnvironment](/rules/lib/toplevel/testing#TestEnvironment) Provider. |
+| `env` | Dictionary of strings; values are subject to [$(location)](/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/reference/be/make-variables) substitution; default is `{}` Specifies additional environment variables to set when the test is executed by `bazel test`. This attribute only applies to native rules, like `cc_test`, `py_test`, and `sh_test`. It does not apply to Starlark-defined test rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a [RunEnvironmentInfo](/rules/lib/providers/RunEnvironmentInfo) Provider. [TestEnvironment](/rules/lib/toplevel/testing#TestEnvironment) Provider. |
| `env_inherit` | List of strings; default is `[]` Specifies additional environment variables to inherit from the external environment when the test is executed by `bazel test`. This attribute only applies to native rules, like `cc_test`, `py_test`, and `sh_test`. It does not apply to Starlark-defined test rules. |
-| `size` | String `"enormous"`, `"large"`, `"medium"`, or `"small"`; [nonconfigurable](#configurable-attributes); default is `"medium"` Specifies a test target's "heaviness": how much time/resources it needs to run. Unit tests are considered "small", integration tests "medium", and end-to-end tests "large" or "enormous". Bazel uses the size to determine a default timeout, which can be overridden using the `timeout` attribute. The timeout is for all tests in the BUILD target, not for each individual test. When the test is run locally, the `size` is additionally used for scheduling purposes: Bazel tries to respect `--local_{ram,cpu}_resources` and not overwhelm the local machine by running lots of heavy tests at the same time. Test sizes correspond to the following default timeouts and assumed peak local resource usages: | Size | RAM (in MB) | CPU (in CPU cores) | Default timeout | | --- | --- | --- | --- | | small | 20 | 1 | short (1 minute) | | medium | 100 | 1 | moderate (5 minutes) | | large | 300 | 1 | long (15 minutes) | | enormous | 800 | 1 | eternal (60 minutes) | The environment variable `TEST_SIZE` will be set to the value of this attribute when spawning the test. |
+| `size` | String `"enormous"`, `"large"`, `"medium"`, or `"small"`; [nonconfigurable](#configurable-attributes); default is `"medium"` Specifies a test target's "heaviness": how much time/resources it needs to run. Unit tests are considered "small", integration tests "medium", and end-to-end tests "large" or "enormous". Bazel uses the size to determine a default timeout, which can be overridden using the `timeout` attribute. The timeout is for all tests in the BUILD target, not for each individual test. When the test is run locally, the `size` is additionally used for scheduling purposes: Bazel tries to respect `--local_{ram,cpu}_resources` and not overwhelm the local machine by running lots of heavy tests at the same time. Test sizes correspond to the following default timeouts and assumed peak local resource usages: | Size | RAM (in MB) | CPU (in CPU cores) | Default timeout | | --- | --- | --- | --- | | small | 20 | 1 | short (1 minute) | | medium | 100 | 1 | moderate (5 minutes) | | large | 300 | 1 | long (15 minutes) | | enormous | 800 | 1 | eternal (60 minutes) | The environment variable `TEST_SIZE` will be set to the value of this attribute when spawning the test. |
| `timeout` | String `"short"`, `"moderate"`, `"long"`, or `"eternal"`; [nonconfigurable](#configurable-attributes); default is derived from the test's `size` attribute How long the test is expected to run before returning. While a test's size attribute controls resource estimation, a test's timeout may be set independently. If not explicitly specified, the timeout is based on the [test's size](#test.size). The test timeout can be overridden with the `--test_timeout` flag, e.g. for running under certain conditions which are known to be slow. Test timeout values correspond to the following time periods: | Timeout Value | Time Period | | --- | --- | | short | 1 minute | | moderate | 5 minutes | | long | 15 minutes | | eternal | 60 minutes | For times other than the above, the test timeout can be overridden with the `--test_timeout` bazel flag, e.g. for manually running under conditions which are known to be slow. The `--test_timeout` values are in seconds. For example `--test_timeout=120` will set the test timeout to two minutes. The environment variable `TEST_TIMEOUT` will be set to the test timeout (in seconds) when spawning the test. |
| `flaky` | Boolean; [nonconfigurable](#configurable-attributes); default is `False` Marks test as flaky. If set, executes the test up to three times, marking it as failed only if it fails each time. By default, this attribute is set to False and the test is executed only once. Note, that use of this attribute is generally discouraged - tests should pass reliably when their assertions are upheld. |
| `shard_count` | Non-negative integer less than or equal to 50; default is `-1` Specifies the number of parallel shards to use to run the test. If set, this value will override any heuristics used to determine the number of parallel shards with which to run the test. Note that for some test rules, this parameter may be required to enable sharding in the first place. Also see `--test_sharding_strategy`. If test sharding is enabled, the environment variable `TEST_TOTAL_SHARDS` will be set to this value when spawning the test. Sharding requires the test runner to support the test sharding protocol. If it does not, then it will most likely run every test in every shard, which is not what you want. See [Test Sharding](/reference/test-encyclopedia#test-sharding) in the Test Encyclopedia for details on sharding. |
@@ -108,7 +108,7 @@ This section describes attributes that are common to all binary rules.
| Attribute | Description |
| --- | --- |
| `args` | List of strings; subject to [$(location)](/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/reference/be/make-variables) substitution, and [Bourne shell tokenization](#sh-tokenization); [nonconfigurable](#configurable-attributes); default is `[]` Command line arguments that Bazel will pass to the target when it is executed either by the `run` command or as a test. These arguments are passed before the ones that are specified on the `bazel run` or `bazel test` command line. *NOTE: The arguments are not passed when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* |
-| `env` | Dictionary of strings; values are subject to [$(location)](/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/reference/be/make-variables) substitution; default is `{}` Specifies additional environment variables to set when the target is executed by `bazel run`. This attribute only applies to native rules, like `cc_binary`, `py_binary`, and `sh_binary`. It does not apply to Starlark-defined executable rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a [RunEnvironmentInfo](/rules/lib/providers/RunEnvironmentInfo) Provider. *NOTE: The environment variables are not set when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* |
+| `env` | Dictionary of strings; values are subject to [$(location)](/reference/be/make-variables#predefined_label_variables) and ["Make variable"](/reference/be/make-variables) substitution; default is `{}` Specifies additional environment variables to set when the target is executed by `bazel run`. This attribute only applies to native rules, like `cc_binary`, `py_binary`, and `sh_binary`. It does not apply to Starlark-defined executable rules. For your own Starlark rules, you can add an "env" attribute and use it to populate a [RunEnvironmentInfo](/rules/lib/providers/RunEnvironmentInfo) Provider. *NOTE: The environment variables are not set when you run the target outside of Bazel (for example, by manually executing the binary in `bazel-bin/`).* |
| `output_licenses` | List of strings; default is `[]` The licenses of the output files that this binary generates. This is part of a deprecated licensing API that Bazel no longer uses. Don't use this. |
## Configurable attributes
diff --git a/reference/be/extra-actions.mdx b/reference/be/extra-actions.mdx
index 7e6e92cf..0a01cc2f 100644
--- a/reference/be/extra-actions.mdx
+++ b/reference/be/extra-actions.mdx
@@ -27,7 +27,7 @@ by providing a mapping from action to [`extra_action`](/reference/be/extra-actio
This rule's arguments map action mnemonics to
[`extra_action`](/reference/be/extra-actions#extra_action) rules.
-By specifying the option [`--experimental_action_listener=