Skip to content

Commit 446fe81

Browse files
fweikertcopybara-github
authored andcommitted
Bazel Docs: Add missing generated files to 9.0 release docs.
6e1e226 built the initial 9.0 docs, but missed all generated docs under rules/lib/repo because the html2mdx tool ignored all .md files. Since then we've upgraded html2mdx to docs2mdx, so I could cherry-pick those additional commits to recreated the 9.0 docs: <details> <summary>Commands</summary> ``` git checkout release-9.0.0 # remove file that should be generated, but was checked in by mistake: rm docs/reference/command-line-reference.mdx # revert 9.1.0 change: git revert 87aad18 git cherry-pick bc436e3 \ a4e5d84 \ 8ca49ef \ 4c6b39b \ 8f80aea \ 1c114e3 \ e602c70 bazel build \ --config=docs \ //scripts/docs:gen_mdx_release_docs ``` </details> PiperOrigin-RevId: 895876591
1 parent 7bf699b commit 446fe81

6 files changed

Lines changed: 2862 additions & 0 deletions

File tree

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: 'cache repository rules'
3+
---
4+
5+
The following functions can be loaded from
6+
`@bazel_tools//tools/build_defs/repo:cache.bzl`.
7+
8+
Returns the default canonical id to use for downloads.
9+
10+
<a id="get_default_canonical_id"></a>
11+
12+
## get_default_canonical_id
13+
14+
<pre>
15+
load("@bazel//tools/build_defs/repo:cache.bzl", "get_default_canonical_id")
16+
17+
get_default_canonical_id(<a href="#get_default_canonical_id-repository_ctx">repository_ctx</a>, <a href="#get_default_canonical_id-urls">urls</a>)
18+
</pre>
19+
20+
Returns the default canonical id to use for downloads.
21+
22+
Returns `""` (empty string) when Bazel is run with
23+
`--repo_env=BAZEL_HTTP_RULES_URLS_AS_DEFAULT_CANONICAL_ID=0`.
24+
25+
e.g.
26+
```python
27+
load("@bazel_tools//tools/build_defs/repo:cache.bzl", "get_default_canonical_id")
28+
# ...
29+
repository_ctx.download_and_extract(
30+
url = urls,
31+
integrity = integrity
32+
canonical_id = get_default_canonical_id(repository_ctx, urls),
33+
),
34+
```
35+
36+
### Parameters
37+
38+
<table class="params-table">
39+
<colgroup>
40+
<col class="col-param" />
41+
<col class="col-description" />
42+
</colgroup>
43+
<tbody>
44+
<tr id="get_default_canonical_id-repository_ctx">
45+
<td><code>repository_ctx</code></td>
46+
<td>
47+
48+
required.
49+
50+
<p>
51+
52+
The repository context of the repository rule calling this utility
53+
function.
54+
55+
</p>
56+
</td>
57+
</tr>
58+
<tr id="get_default_canonical_id-urls">
59+
<td><code>urls</code></td>
60+
<td>
61+
62+
required.
63+
64+
<p>
65+
66+
A list of URLs matching what is passed to `repository_ctx.download` and
67+
`repository_ctx.download_and_extract`.
68+
69+
</p>
70+
</td>
71+
</tr>
72+
</tbody>
73+
</table>
74+

0 commit comments

Comments
 (0)