Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions extending/rules.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -515,10 +515,6 @@ ExampleInfo = provider(
)
```

The `fields` parameter to `provider` is optional, but strongly recommended.
Specifying `fields` creates a *schemaful provider*, which allows Bazel to store
provider instances more compactly.

Rule implementation functions can then construct and return provider instances:

```python
Expand Down
8 changes: 0 additions & 8 deletions external/extension.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -278,14 +278,6 @@ version. The first time the extension is evaluated, it can fetch this mapping
from the network, but on later evaluations it can use the mapping from `facts`
to avoid the network requests.

If you need to make a backwards-incompatible change to the schema of the values
your extension stores in `facts`, set the
[`facts_version`](/rules/lib/globals/bzl#module_extension.facts_version)
parameter on `module_extension` to a higher integer than its previous value.
Bazel persists `facts_version` in the lockfile alongside the facts and discards
any persisted facts when the recorded version differs from the current one,
making sure your extension only ever observes facts produced by the same schema.

### Specify dependence on operating system and architecture

If your extension relies on the operating system or its architecture type,
Expand Down
2 changes: 1 addition & 1 deletion external/vendor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Note that vendoring all dependencies has a few **disadvantages**:

Therefore, consider vendoring for specific targets first.

### Vendor tools for Bazel subcommands {#vendor-tools-for-subcommands}
### Vendor tools for Bazel subcommands {:#vendor-tools-for-subcommands}

Some Bazel subcommands (such as `bazel mod tidy`) have implicit tool
dependencies that are not reachable from user build targets, so they are
Expand Down
30 changes: 12 additions & 18 deletions reference/command-line-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -601,12 +601,6 @@ This option affects semantics of the Starlark language or the build API accessib
Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`experimental`](#metadata_tag_EXPERIMENTAL)

`--[no]experimental_repository_ctx_wasm_compilation` default: "false"
: If true enables compilation of WebAssembly modules.

Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`experimental`](#metadata_tag_EXPERIMENTAL)

`--[no]experimental_sibling_repository_layout` default: "false"
: If set to true, non-main repositories are planted as symlinks to the main repository in the execution root. That is, all repositories are direct children of the $output_base/execution_root directory. This has the side effect of freeing up $output_base/execution_root/**main**/external for the real top-level 'external' directory.

Expand Down Expand Up @@ -1810,14 +1804,14 @@ Miscellaneous options, not otherwise categorized.:
`--[no]show_timestamps` default: "false"
: Include timestamps in messages

`--tls_certificate=<a string; empty to unset>` default: see description
: Specify a path to a TLS certificate that is trusted to sign server certificates. An empty value resets the flag to its default.
`--tls_certificate=<a string>` default: see description
: Specify a path to a TLS certificate that is trusted to sign server certificates.

`--tls_client_certificate=<a string; empty to unset>` default: see description
: Specify the TLS client certificate to use; you also need to provide a client key to enable client authentication. An empty value resets the flag to its default.
`--tls_client_certificate=<a string>` default: see description
: Specify the TLS client certificate to use; you also need to provide a client key to enable client authentication.

`--tls_client_key=<a string; empty to unset>` default: see description
: Specify the TLS client key to use; you also need to provide a client certificate to enable client authentication. An empty value resets the flag to its default.
`--tls_client_key=<a string>` default: see description
: Specify the TLS client key to use; you also need to provide a client certificate to enable client authentication.

`--ui_actions_shown=<an integer>` default: "8"
: Number of concurrent actions shown in the detailed progress bar; each action is shown on a separate line. The progress bar always shows at least one one, all numbers less than 1 are mapped to 1.
Expand Down Expand Up @@ -4307,6 +4301,12 @@ Options that affect the verbosity, format or location of logging:
Tags:
[`affects_outputs`](#effect_tag_AFFECTS_OUTPUTS)

`--remote_analysis_json_log=<a string>` default: see description
: If set, a JSON file is written to this location that contains a detailed log of the behavior of remote analysis caching. It's interpreted as a path relative to the current working directory.

Tags:
[`bazel_monitoring`](#effect_tag_BAZEL_MONITORING)

`--remote_print_execution_messages=<failure, success or all>` default: "failure"
: Choose when to print remote execution messages. Valid values are `failure`, to print only on failures, `success` to print only on successes and `all` to print always.

Expand Down Expand Up @@ -4587,12 +4587,6 @@ Remote caching and execution options:
`--[no]remote_verify_downloads` default: "true"
: If set to true, Bazel will compute the hash sum of all remote downloads and discard the remotely cached values if they don't match the expected value.

`--[no]rewind_lost_inputs` default: "false"
: Whether to use action rewinding to recover from lost inputs.

Tags:
[`execution`](#effect_tag_EXECUTION)

Miscellaneous options, not otherwise categorized.:

`--[no]allow_analysis_cache_discard` default: "true"
Expand Down
2 changes: 1 addition & 1 deletion release/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ information about Bazel's release model.
| ----------- | ------------- | -------------- | -------------- |
| Bazel 10 | Rolling| [Check rolling release page](/release/rolling) | N/A |
| Bazel 9 | Active| [9.1.0](https://github.com/bazelbuild/bazel/releases/tag/9.1.0) | Dec 2028 |
| Bazel 8 | Maintenance| [8.7.0](https://github.com/bazelbuild/bazel/releases/tag/8.7.0) | Dec 2027 |
| Bazel 8 | Maintenance| [8.6.0](https://github.com/bazelbuild/bazel/releases/tag/8.6.0) | Dec 2027 |
| Bazel 7 | Maintenance| [7.7.1](https://github.com/bazelbuild/bazel/releases/tag/7.7.1) | Dec 2026 |
| Bazel 6 | Deprecated | [6.6.0](https://github.com/bazelbuild/bazel/releases/tag/6.6.0) | Dec 2025 |
| Bazel 5 | Deprecated | [5.4.1](https://github.com/bazelbuild/bazel/releases/tag/5.4.1) | Jan 2025 |
Expand Down
14 changes: 1 addition & 13 deletions rules/lib/builtins/ToolchainContext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,4 @@
title: 'ToolchainContext'
---

Holds toolchains available for a particular exec group. Toolchain targets are accessed by indexing with the toolchain type, as in `ctx.toolchains["//pkg:my_toolchain_type"]`. If the toolchain was optional and no toolchain was resolved, this will return `None`. Accessing toolchains of an aspect or rule via `ctx.toolchains` returns the indexed toolchain as a `ToolchainInfo` provider. While when using aspects, `ToolchainContext` is also used to hold the toolchains of the base target. It can be accessed by `ctx.rule.toolchains["//pkg:my_toolchain_type"]` and it returns the list of providers resulted from applying the aspects on these toolchain targets.

## Members

* [toolchain_types](#toolchain_types)

## toolchain_types

```
sequence ToolchainContext.toolchain_types()
```

Returns the resolved toolchain type labels.
Holds toolchains available for a particular exec group. Toolchain targets are accessed by indexing with the toolchain type, as in `ctx.toolchains["//pkg:my_toolchain_type"]`. If the toolchain was optional and no toolchain was resolved, this will return `None`. Accessing toolchains of an aspect or rule via `ctx.toolchains` returns the indexed toolchain as a `ToolchainInfo` provider. While when using aspects, `ToolchainContext` is also used to hold the toolchains of the base target. It can be accessed by `ctx.rule.toolchains["//pkg:my_toolchain_type"]` and it returns the list of providers resulted from applying the aspects on these toolchain targets.
3 changes: 1 addition & 2 deletions rules/lib/builtins/repository_ctx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ Note that attempting to watch paths inside the repo currently being fetched, or
## watch_tree

```
None repository_ctx.watch_tree(path, *, exclude=[])
None repository_ctx.watch_tree(path)
```

Tells Bazel to watch for changes to any files or directories transitively under the given path. Any changes to the contents of files, the existence of files or directories, file names or directory names, will cause this repo to be refetched.
Expand All @@ -354,7 +354,6 @@ Note that attempting to watch paths inside the repo currently being fetched will
| Parameter | Description |
| --- | --- |
| `path` | [string](../core/string); or [Label](../builtins/Label); or [path](../builtins/path); required Path of the directory tree to watch. |
| `exclude` | [sequence](../core/list) of [string](../core/string)s; default is `[]` Glob patterns to exclude from watching. The patterns provided here will be joined with `path` to create the full glob pattern that will be matched against. Eg. if `path` was `/example/path` and `exclude` was `[".ignore/**", "scratchFile"]`, then the glob pattern that would be excluded would be: `/example/path/.ignore/**` and `/example/patch/scratchFile`. |

## which

Expand Down
5 changes: 2 additions & 3 deletions rules/lib/globals/bzl.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Materializer targets are used to dynamically select dependencies at analysis tim
## module_extension

```
unknown module_extension(implementation, *, tag_classes={}, doc=None, environ=[], os_dependent=False, arch_dependent=False, facts_version=0)
unknown module_extension(implementation, *, tag_classes={}, doc=None, environ=[], os_dependent=False, arch_dependent=False)
```

Creates a new module extension. Store it in a global value, so that it can be exported and used in a MODULE.bazel file with `use_extension`.
Expand All @@ -217,7 +217,6 @@ Creates a new module extension. Store it in a global value, so that it can be ex
| `environ` | [sequence](../core/list) of [string](../core/string)s; default is `[]` **Deprecated**. This parameter has been deprecated. Migrate to `module_ctx.getenv` instead. Provides a list of environment variable that this module extension depends on. If an environment variable in that list changes, the extension will be re-evaluated. See also `--experimental_strict_repo_env`. |
| `os_dependent` | [bool](../core/bool); default is `False` Indicates whether this extension is OS-dependent or not |
| `arch_dependent` | [bool](../core/bool); default is `False` Indicates whether this extension is architecture-dependent or not |
| `facts_version` | [int](../core/int); default is `0` The schema version of the `facts` dict returned by this extension's implementation function via `extension_metadata`. The version is persisted in the lockfile alongside the facts and compared against the current value before the extension runs: if they differ, the persisted facts are discarded and the extension is invoked with an empty `module_ctx.facts`. Increment this value whenever the extension changes the schema of the facts in a backwards-incompatible way so that older facts are not interpreted with the new schema. |

## provider

Expand Down Expand Up @@ -249,7 +248,7 @@ If `init` is specified, returns a tuple of 2 elements: a [`Provider`](../builtin
| Parameter | Description |
| --- | --- |
| `doc` | [string](../core/string); or `None`; default is `None` |
| `fields` | [sequence](../core/list) of [string](../core/string)s; or [dict](../core/dict); or `None`; default is `None` If specified, restricts the set of allowed fields. Possible values are: * list of fields: ``` provider(fields = ['a', 'b']) ``` * dictionary field name -&gt; documentation: ``` provider( fields = { 'a' : 'Documentation for a', 'b' : 'Documentation for b' }) ``` All fields are optional. It is *strongly recommended* to specify this parameter, as defining a field schema allows Bazel to store provider instances more compactly. |
| `fields` | [sequence](../core/list) of [string](../core/string)s; or [dict](../core/dict); or `None`; default is `None` If specified, restricts the set of allowed fields. Possible values are: * list of fields: ``` provider(fields = ['a', 'b']) ``` * dictionary field name -&gt; documentation: ``` provider( fields = { 'a' : 'Documentation for a', 'b' : 'Documentation for b' }) ``` All fields are optional. |
| `init` | callable; or `None`; default is `None` |

## repository_rule
Expand Down
4 changes: 1 addition & 3 deletions rules/lib/toplevel/cc_common.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ The key used to retrieve the provider that contains information about the C++ to
## compile

```
tuple cc_common.compile(*, actions, feature_configuration, cc_toolchain, srcs=[], public_hdrs=[], private_hdrs=[], includes=[], local_includes=[], quote_includes=[], system_includes=[], framework_includes=[], defines=[], local_defines=[], include_prefix='', strip_include_prefix='', user_compile_flags=[], conly_flags=[], cxx_flags=[], compilation_contexts=[], progress_message_prefix, name, disallow_pic_outputs=False, disallow_nopic_outputs=False, additional_inputs=[], module_interfaces=unbound)
tuple cc_common.compile(*, actions, feature_configuration, cc_toolchain, srcs=[], public_hdrs=[], private_hdrs=[], includes=[], quote_includes=[], system_includes=[], framework_includes=[], defines=[], local_defines=[], include_prefix='', strip_include_prefix='', user_compile_flags=[], conly_flags=[], cxx_flags=[], compilation_contexts=[], name, disallow_pic_outputs=False, disallow_nopic_outputs=False, additional_inputs=[], module_interfaces=unbound)
```

Should be used for C++ compilation. Returns tuple of (`CompilationContext`, `CcCompilationOutputs`).
Expand All @@ -73,7 +73,6 @@ Should be used for C++ compilation. Returns tuple of (`CompilationContext`, `CcC
| `public_hdrs` | [sequence](../core/list); default is `[]` List of headers needed for compilation of srcs and may be included by dependent rules transitively. |
| `private_hdrs` | [sequence](../core/list); default is `[]` List of headers needed for compilation of srcs and NOT to be included by dependent rules. |
| `includes` | [sequence](../core/list); or [depset](../builtins/depset); default is `[]` Search paths for header files referenced both by angle bracket and quotes. Usually passed with -I. Propagated to dependents transitively. |
| `local_includes` | [sequence](../core/list); or [depset](../builtins/depset); default is `[]` Search paths for header files referenced by angle brackets and quotes. Usually passed with -I. Not propagated to dependents transitively. |
| `quote_includes` | [sequence](../core/list); default is `[]` Search paths for header files referenced by quotes, e.g. #include "foo/bar/header.h". They can be either relative to the exec root or absolute. Usually passed with -iquote. Propagated to dependents transitively. |
| `system_includes` | [sequence](../core/list); default is `[]` Search paths for header files referenced by angle brackets, e.g. #include &lt;foo/bar/header.h&gt;. They can be either relative to the exec root or absolute. Usually passed with -isystem. Propagated to dependents transitively. |
| `framework_includes` | [sequence](../core/list); default is `[]` Search paths for header files from Apple frameworks. They can be either relative to the exec root or absolute. Usually passed with -F. Propagated to dependents transitively. |
Expand All @@ -85,7 +84,6 @@ Should be used for C++ compilation. Returns tuple of (`CompilationContext`, `CcC
| `conly_flags` | [sequence](../core/list); default is `[]` Additional list of compilation options for C compiles. |
| `cxx_flags` | [sequence](../core/list); default is `[]` Additional list of compilation options for C++ compiles. |
| `compilation_contexts` | [sequence](../core/list); default is `[]` Headers from dependencies used for compilation. |
| `progress_message_prefix` | [string](../core/string); or `None`; required An additional string to identify actions for logging. |
| `name` | [string](../core/string); required This is used for naming the output artifacts of actions created by this method. See also the `main_output` arg. |
| `disallow_pic_outputs` | [bool](../core/bool); default is `False` Whether PIC outputs should be created. |
| `disallow_nopic_outputs` | [bool](../core/bool); default is `False` Whether NOPIC outputs should be created. |
Expand Down
2 changes: 1 addition & 1 deletion upstream
Submodule upstream updated 474 files