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
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
44 changes: 4 additions & 40 deletions rules/lib/repo/git.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Rules for cloning external git repositories.
<pre>
load("@bazel//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(<a href="#git_repository-name">name</a>, <a href="#git_repository-add_prefix">add_prefix</a>, <a href="#git_repository-branch">branch</a>, <a href="#git_repository-build_file">build_file</a>, <a href="#git_repository-build_file_content">build_file_content</a>, <a href="#git_repository-canonical_id">canonical_id</a>, <a href="#git_repository-commit">commit</a>,
<a href="#git_repository-init_submodules">init_submodules</a>, <a href="#git_repository-patch_args">patch_args</a>, <a href="#git_repository-patch_cmds">patch_cmds</a>, <a href="#git_repository-patch_cmds_win">patch_cmds_win</a>, <a href="#git_repository-patch_strip">patch_strip</a>, <a href="#git_repository-patch_tool">patch_tool</a>,
<a href="#git_repository-patches">patches</a>, <a href="#git_repository-recursive_init_submodules">recursive_init_submodules</a>, <a href="#git_repository-remote">remote</a>, <a href="#git_repository-remote_module_file_integrity">remote_module_file_integrity</a>,
git_repository(<a href="#git_repository-name">name</a>, <a href="#git_repository-branch">branch</a>, <a href="#git_repository-build_file">build_file</a>, <a href="#git_repository-build_file_content">build_file_content</a>, <a href="#git_repository-canonical_id">canonical_id</a>, <a href="#git_repository-commit">commit</a>, <a href="#git_repository-init_submodules">init_submodules</a>,
<a href="#git_repository-patch_args">patch_args</a>, <a href="#git_repository-patch_cmds">patch_cmds</a>, <a href="#git_repository-patch_cmds_win">patch_cmds_win</a>, <a href="#git_repository-patch_strip">patch_strip</a>, <a href="#git_repository-patch_tool">patch_tool</a>, <a href="#git_repository-patches">patches</a>,
<a href="#git_repository-recursive_init_submodules">recursive_init_submodules</a>, <a href="#git_repository-remote">remote</a>, <a href="#git_repository-remote_module_file_integrity">remote_module_file_integrity</a>,
<a href="#git_repository-remote_module_file_urls">remote_module_file_urls</a>, <a href="#git_repository-remote_patch_strip">remote_patch_strip</a>, <a href="#git_repository-remote_patches">remote_patches</a>, <a href="#git_repository-shallow_since">shallow_since</a>,
<a href="#git_repository-sparse_checkout_file">sparse_checkout_file</a>, <a href="#git_repository-sparse_checkout_patterns">sparse_checkout_patterns</a>, <a href="#git_repository-strip_prefix">strip_prefix</a>, <a href="#git_repository-tag">tag</a>, <a href="#git_repository-verbose">verbose</a>,
<a href="#git_repository-workspace_file">workspace_file</a>, <a href="#git_repository-workspace_file_content">workspace_file_content</a>)
Expand Down Expand Up @@ -64,24 +64,6 @@ The reasons are:

A unique name for this repository.

</p>
</td>
</tr>
<tr id="git_repository-add_prefix">
<td><code>add_prefix</code></td>
<td>

String; optional

<p>

Destination directory relative to the repository directory.

The git repo will be cloned into this directory, after applying `strip_prefix`
(if any) to the file paths within the repo. For example, file
`foo-1.2.3/src/foo.h` will be cloned to `bar/src/foo.h` if `add_prefix = "bar"`
and `strip_prefix = "foo-1.2.3"`.

</p>
</td>
</tr>
Expand Down Expand Up @@ -443,7 +425,7 @@ This repository rule depends on the following environment variables:
<pre>
load("@bazel//tools/build_defs/repo:git.bzl", "new_git_repository")

new_git_repository(<a href="#new_git_repository-name">name</a>, <a href="#new_git_repository-add_prefix">add_prefix</a>, <a href="#new_git_repository-branch">branch</a>, <a href="#new_git_repository-build_file">build_file</a>, <a href="#new_git_repository-build_file_content">build_file_content</a>, <a href="#new_git_repository-canonical_id">canonical_id</a>, <a href="#new_git_repository-commit">commit</a>,
new_git_repository(<a href="#new_git_repository-name">name</a>, <a href="#new_git_repository-branch">branch</a>, <a href="#new_git_repository-build_file">build_file</a>, <a href="#new_git_repository-build_file_content">build_file_content</a>, <a href="#new_git_repository-canonical_id">canonical_id</a>, <a href="#new_git_repository-commit">commit</a>,
<a href="#new_git_repository-init_submodules">init_submodules</a>, <a href="#new_git_repository-patch_args">patch_args</a>, <a href="#new_git_repository-patch_cmds">patch_cmds</a>, <a href="#new_git_repository-patch_cmds_win">patch_cmds_win</a>, <a href="#new_git_repository-patch_strip">patch_strip</a>, <a href="#new_git_repository-patch_tool">patch_tool</a>,
<a href="#new_git_repository-patches">patches</a>, <a href="#new_git_repository-recursive_init_submodules">recursive_init_submodules</a>, <a href="#new_git_repository-remote">remote</a>, <a href="#new_git_repository-remote_module_file_integrity">remote_module_file_integrity</a>,
<a href="#new_git_repository-remote_module_file_urls">remote_module_file_urls</a>, <a href="#new_git_repository-remote_patch_strip">remote_patch_strip</a>, <a href="#new_git_repository-remote_patches">remote_patches</a>, <a href="#new_git_repository-shallow_since">shallow_since</a>,
Expand Down Expand Up @@ -471,24 +453,6 @@ Deprecated - use the drop-in replacement 'git_repository' instead

A unique name for this repository.

</p>
</td>
</tr>
<tr id="new_git_repository-add_prefix">
<td><code>add_prefix</code></td>
<td>

String; optional

<p>

Destination directory relative to the repository directory.

The git repo will be cloned into this directory, after applying `strip_prefix`
(if any) to the file paths within the repo. For example, file
`foo-1.2.3/src/foo.h` will be cloned to `bar/src/foo.h` if `add_prefix = "bar"`
and `strip_prefix = "foo-1.2.3"`.

</p>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion upstream
Submodule upstream updated 51 files
+0 −1 .bazelci/postsubmit.yml
+1 −1 .bazelci/presubmit.yml
+0 −8 CHANGELOG.md
+0 −16 docs/external/vendor.mdx
+0 −7 site/en/_buttons.html
+0 −6 site/en/_redirects.yaml
+0 −16 site/en/external/vendor.md
+0 −2 site/en/versions/_toc.yaml
+0 −1 src/main/java/com/google/devtools/build/lib/bazel/BUILD
+1 −2 src/main/java/com/google/devtools/build/lib/bazel/BazelServices.java
+0 −5 src/main/java/com/google/devtools/build/lib/bazel/bzlmod/GitRepoSpecBuilder.java
+0 −2 src/main/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistry.java
+1 −1 src/main/java/com/google/devtools/build/lib/bazel/bzlmod/MultipleVersionOverride.java
+2 −1 src/main/java/com/google/devtools/build/lib/bazel/bzlmod/SingleVersionOverride.java
+2 −7 src/main/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContext.java
+1 −2 src/main/java/com/google/devtools/build/lib/buildtool/PostAnalysisQueryProcessor.java
+12 −59 src/main/java/com/google/devtools/build/lib/cmdline/IgnoredSubdirectories.java
+5 −6 src/main/java/com/google/devtools/build/lib/concurrent/RequestBatcher.java
+1 −1 src/main/java/com/google/devtools/build/lib/packages/SelectorList.java
+11 −1 src/main/java/com/google/devtools/build/lib/remote/PathCanonicalizer.java
+8 −3 src/main/java/com/google/devtools/build/lib/remote/RemoteActionFileSystem.java
+2 −2 src/main/java/com/google/devtools/build/lib/runtime/commands/RunCommandLine.java
+1 −1 src/main/java/com/google/devtools/build/lib/runtime/commands/info/BUILD
+2 −6 src/main/java/com/google/devtools/build/lib/runtime/commands/info/ServerLogInfoItem.java
+1 −1 src/main/java/com/google/devtools/build/lib/skyframe/ProcessPackageDirectory.java
+11 −7 src/main/java/com/google/devtools/build/lib/skyframe/SkyframeTargetPatternEvaluator.java
+1 −1 src/main/java/com/google/devtools/build/lib/skyframe/serialization/analysis/RemoteAnalysisCachingOptions.java
+1 −18 src/main/java/com/google/devtools/build/lib/util/BUILD
+17 −0 src/main/java/com/google/devtools/build/lib/util/DebugLoggerConfigurator.java
+0 −30 src/main/java/com/google/devtools/build/lib/util/ServerLogPathService.java
+0 −34 src/main/java/com/google/devtools/build/lib/util/ServerLogPathServiceImpl.java
+0 −1 src/main/java/net/starlark/java/eval/BUILD
+0 −684 src/main/java/net/starlark/java/eval/CompactImmutableDict.java
+230 −270 src/main/java/net/starlark/java/eval/Dict.java
+1 −1 src/main/java/net/starlark/java/eval/Starlark.java
+1 −3 src/test/java/com/google/devtools/build/lib/bazel/bzlmod/IndexRegistryTest.java
+0 −4 src/test/java/com/google/devtools/build/lib/bazel/repository/starlark/StarlarkBaseExternalContextTest.java
+5 −0 src/test/java/com/google/devtools/build/lib/bazel/rules/java/BUILD
+93 −0 src/test/java/com/google/devtools/build/lib/bazel/rules/java/JavaConfiguredTargetsTest.java
+18 −0 src/test/java/com/google/devtools/build/lib/rules/java/BUILD
+46 −0 src/test/java/com/google/devtools/build/lib/rules/java/JavaTestUtil.java
+5 −5 src/test/java/com/google/devtools/build/lib/runtime/commands/RunCommandLineTest.java
+0 −1 src/test/java/net/starlark/java/eval/BUILD
+0 −326 src/test/java/net/starlark/java/eval/CompactImmutableDictTest.java
+0 −1 src/test/java/net/starlark/java/eval/EvalTests.java
+0 −61 src/test/py/bazel/bzlmod/bazel_vendor_test.py
+10 −52 src/test/shell/bazel/starlark_git_repository_test.sh
+8 −0 src/test/shell/integration/BUILD
+87 −0 src/test/shell/integration/stale_output_symlink_test.sh
+0 −18 tools/BUILD.tools
+7 −38 tools/build_defs/repo/git.bzl