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
16 changes: 0 additions & 16 deletions external/vendor.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,6 @@ 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}

Some Bazel subcommands (such as `bazel mod tidy`) have implicit tool
dependencies that are not reachable from user build targets, so they are
**not** included by `bazel vendor //...`. To vendor those tools as well, add
the `@bazel_tools//tools:tools_for_bazel_subcommands` filegroup to your
vendor invocation:

```none
bazel vendor //... @bazel_tools//tools:tools_for_bazel_subcommands
```

This is required if you plan to run commands like `bazel mod tidy` in an
offline or hermetic environment (for example with `--vendor_dir` and
`--nofetch`).

## Configure vendor mode with VENDOR.bazel {#configure-vendor-mode}

You can control how given repos are handled with the VENDOR.bazel file located
Expand Down
8 changes: 8 additions & 0 deletions navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@
"$ref": "./navigation/7.7.en.json"
}
]
},
{
"version": "6.5",
"languages": [
{
"$ref": "./navigation/6.5.en.json"
}
]
}
]
}
51 changes: 33 additions & 18 deletions reference/command-line-reference.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,15 @@ Remote caching and execution options:
`--[no]experimental_remote_discard_merkle_trees` default: "true"
: If set to true, discard in-memory copies of the input root's Merkle tree and associated input mappings during calls to GetActionResult() and Execute(). This reduces memory usage significantly, but does require Bazel to recompute them upon remote cache misses and retries.

`--experimental_remote_downloader=<a string>` default: see description
: A Remote Asset API endpoint URI, to be used as a remote download proxy. The supported schemes are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no scheme is provided Bazel will default to grpcs. See: https://github.com/bazelbuild/remote-apis/blob/master/build/bazel/remote/asset/v1/remote_asset.proto

`--[no]experimental_remote_downloader_local_fallback` default: "false"
: Whether to fall back to the local downloader if remote downloader fails.

`--[no]experimental_remote_downloader_propagate_credentials` default: "false"
: Whether to propagate credentials from netrc and credential helper to the remote downloader server. The server implementation needs to support the new `http_header_url:<url-index>:<header-key>` qualifier where the `<url-index>` is a 0-based position of the URL inside the FetchBlobRequest's `uris` field. The URL-specific headers should take precedence over the global headers.

`--experimental_remote_failure_rate_threshold=<an integer in 0-100 range>` default: "10"
: Sets the allowed number of failure rate in percentage for a specific time window after which it stops calling to the remote cache/executor. By default the value is 10. Setting this to 0 means no limitation.

Expand Down Expand Up @@ -1549,18 +1558,9 @@ Remote caching and execution options:
Tags:
[`affects_outputs`](#effect_tag_AFFECTS_OUTPUTS)

`--remote_downloader=<a string>` default: see description
: A Remote Asset API endpoint URI, to be used as a remote download proxy. The supported schemes are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no scheme is provided Bazel will default to grpcs. See: https://github.com/bazelbuild/remote-apis/blob/master/build/bazel/remote/asset/v1/remote_asset.proto

`--remote_downloader_header=<a 'name=value' assignment>` multiple uses are accumulated
: Specify a header that will be included in remote downloader requests: --remote_downloader_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.

`--[no]remote_downloader_local_fallback` default: "false"
: Whether to fall back to the local downloader if remote downloader fails.

`--[no]remote_downloader_propagate_credentials` default: "false"
: Whether to propagate credentials from netrc and credential helper to the remote downloader server. The server implementation needs to support the new `http_header_url:<url-index>:<header-key>` qualifier where the `<url-index>` is a 0-based position of the URL inside the FetchBlobRequest's `uris` field. The URL-specific headers should take precedence over the global headers.

`--remote_exec_header=<a 'name=value' assignment>` multiple uses are accumulated
: Specify a header that will be included in execution requests: --remote_exec_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.

Expand Down Expand Up @@ -3397,6 +3397,9 @@ Miscellaneous options, not otherwise categorized.:
Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`incompatible_change`](#metadata_tag_INCOMPATIBLE_CHANGE)

`--j2objc_translation_flags=<comma-separated list of options>` multiple uses are accumulated
: Additional options to pass to the J2ObjC tool.

`--java_debug`
: Causes the Java virtual machine of a java test to wait for a connection from a JDWP-compliant debugger (such as jdb) before starting the test. Implies -test_output=streamed.

Expand Down Expand Up @@ -4434,6 +4437,15 @@ Remote caching and execution options:
`--[no]experimental_remote_discard_merkle_trees` default: "true"
: If set to true, discard in-memory copies of the input root's Merkle tree and associated input mappings during calls to GetActionResult() and Execute(). This reduces memory usage significantly, but does require Bazel to recompute them upon remote cache misses and retries.

`--experimental_remote_downloader=<a string>` default: see description
: A Remote Asset API endpoint URI, to be used as a remote download proxy. The supported schemes are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no scheme is provided Bazel will default to grpcs. See: https://github.com/bazelbuild/remote-apis/blob/master/build/bazel/remote/asset/v1/remote_asset.proto

`--[no]experimental_remote_downloader_local_fallback` default: "false"
: Whether to fall back to the local downloader if remote downloader fails.

`--[no]experimental_remote_downloader_propagate_credentials` default: "false"
: Whether to propagate credentials from netrc and credential helper to the remote downloader server. The server implementation needs to support the new `http_header_url:<url-index>:<header-key>` qualifier where the `<url-index>` is a 0-based position of the URL inside the FetchBlobRequest's `uris` field. The URL-specific headers should take precedence over the global headers.

`--experimental_remote_failure_rate_threshold=<an integer in 0-100 range>` default: "10"
: Sets the allowed number of failure rate in percentage for a specific time window after which it stops calling to the remote cache/executor. By default the value is 10. Setting this to 0 means no limitation.

Expand Down Expand Up @@ -4513,18 +4525,9 @@ Remote caching and execution options:
Tags:
[`affects_outputs`](#effect_tag_AFFECTS_OUTPUTS)

`--remote_downloader=<a string>` default: see description
: A Remote Asset API endpoint URI, to be used as a remote download proxy. The supported schemes are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no scheme is provided Bazel will default to grpcs. See: https://github.com/bazelbuild/remote-apis/blob/master/build/bazel/remote/asset/v1/remote_asset.proto

`--remote_downloader_header=<a 'name=value' assignment>` multiple uses are accumulated
: Specify a header that will be included in remote downloader requests: --remote_downloader_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.

`--[no]remote_downloader_local_fallback` default: "false"
: Whether to fall back to the local downloader if remote downloader fails.

`--[no]remote_downloader_propagate_credentials` default: "false"
: Whether to propagate credentials from netrc and credential helper to the remote downloader server. The server implementation needs to support the new `http_header_url:<url-index>:<header-key>` qualifier where the `<url-index>` is a 0-based position of the URL inside the FetchBlobRequest's `uris` field. The URL-specific headers should take precedence over the global headers.

`--remote_exec_header=<a 'name=value' assignment>` multiple uses are accumulated
: Specify a header that will be included in execution requests: --remote_exec_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.

Expand Down Expand Up @@ -6063,6 +6066,9 @@ Miscellaneous options, not otherwise categorized.:
Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`incompatible_change`](#metadata_tag_INCOMPATIBLE_CHANGE)

`--j2objc_translation_flags=<comma-separated list of options>` multiple uses are accumulated
: Additional options to pass to the J2ObjC tool.

`--java_debug`
: Causes the Java virtual machine of a java test to wait for a connection from a JDWP-compliant debugger (such as jdb) before starting the test. Implies -test_output=streamed.

Expand Down Expand Up @@ -7874,6 +7880,9 @@ Miscellaneous options, not otherwise categorized.:
Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`incompatible_change`](#metadata_tag_INCOMPATIBLE_CHANGE)

`--j2objc_translation_flags=<comma-separated list of options>` multiple uses are accumulated
: Additional options to pass to the J2ObjC tool.

`--java_debug`
: Causes the Java virtual machine of a java test to wait for a connection from a JDWP-compliant debugger (such as jdb) before starting the test. Implies -test_output=streamed.

Expand Down Expand Up @@ -9506,6 +9515,9 @@ Miscellaneous options, not otherwise categorized.:
Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`incompatible_change`](#metadata_tag_INCOMPATIBLE_CHANGE)

`--j2objc_translation_flags=<comma-separated list of options>` multiple uses are accumulated
: Additional options to pass to the J2ObjC tool.

`--java_debug`
: Causes the Java virtual machine of a java test to wait for a connection from a JDWP-compliant debugger (such as jdb) before starting the test. Implies -test_output=streamed.

Expand Down Expand Up @@ -12496,6 +12508,9 @@ Miscellaneous options, not otherwise categorized.:
Tags:
[`loading_and_analysis`](#effect_tag_LOADING_AND_ANALYSIS), [`incompatible_change`](#metadata_tag_INCOMPATIBLE_CHANGE)

`--j2objc_translation_flags=<comma-separated list of options>` multiple uses are accumulated
: Additional options to pass to the J2ObjC tool.

`--java_debug`
: Causes the Java virtual machine of a java test to wait for a connection from a JDWP-compliant debugger (such as jdb) before starting the test. Implies -test_output=streamed.

Expand Down
14 changes: 13 additions & 1 deletion rules/lib/builtins/ToolchainContext.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@
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.
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.
4 changes: 2 additions & 2 deletions rules/lib/builtins/module_ctx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ The context of the module extension containing helper functions and information
unknown module_ctx.download(url, output='', sha256='', executable=False, allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', block=True)
```

Downloads a file to the output path for the provided url and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`, as well as `size_bytes`, which contains the size of the downloaded file in bytes as an integer. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)
Downloads a file to the output path for the provided url and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)

### Parameters

Expand All @@ -54,7 +54,7 @@ Downloads a file to the output path for the provided url and returns a struct co
struct module_ctx.download_and_extract(url, output='', sha256='', type='', strip_prefix='', allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', rename_files={}, strip_components=0)
```

Downloads a file to the output path for the provided url, extracts it, and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`, as well as the `size_bytes` of the downloaded file in bytes as an integer. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)
Downloads a file to the output path for the provided url, extracts it, and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)

### Parameters

Expand Down
4 changes: 2 additions & 2 deletions rules/lib/builtins/repository_ctx.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Deletes a file or a directory. Returns a bool, indicating whether the file or di
unknown repository_ctx.download(url, output='', sha256='', executable=False, allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', block=True)
```

Downloads a file to the output path for the provided url and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`, as well as `size_bytes`, which contains the size of the downloaded file in bytes as an integer. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)
Downloads a file to the output path for the provided url and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)

### Parameters

Expand All @@ -81,7 +81,7 @@ Downloads a file to the output path for the provided url and returns a struct co
struct repository_ctx.download_and_extract(url, output='', sha256='', type='', strip_prefix='', allow_fail=False, canonical_id='', auth={}, headers={}, *, integrity='', rename_files={}, strip_components=0)
```

Downloads a file to the output path for the provided url, extracts it, and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`, as well as the `size_bytes` of the downloaded file in bytes as an integer. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)
Downloads a file to the output path for the provided url, extracts it, and returns a struct containing `success`, a flag which is `true` if the download completed successfully, and if successful, a hash of the file with the fields `sha256` and `integrity`. If the value of the `success` field is false, the `error` field will be set with a message indicating why the download failed. The message in the `error` field is for debugging purposes only and should not be relied upon as a stable API (the format of the string can change between patch versions of Bazel). When `sha256` or `integrity` is user specified, setting an explicit `canonical_id` is highly recommended. e.g. [`get_default_canonical_id`](/rules/lib/repo/cache#get_default_canonical_id)

### Parameters

Expand Down
Loading