Skip to content

Commit 6bdfbc6

Browse files
Nero5023facebook-github-bot
authored andcommitted
Fix link in bxl developers doc
Summary: The links in bxl developers docs don't work. I tried to update the `redirects.ts`, but it seems not work. So I just update the link directly. Reviewed By: JakobDegen Differential Revision: D65217980 fbshipit-source-id: 3c941169b665459d73de39135c73c418bae1aa57
1 parent cf67212 commit 6bdfbc6

File tree

3 files changed

+31
-35
lines changed

3 files changed

+31
-35
lines changed

docs/developers/bxl_basics.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ in BXL may be challenging without much prior knowledge of Buck2 building blocks
1313
### Build
1414

1515
You can build targets within BXL with
16-
[`ctx.build()`](../../api/bxl/bxl/Context/#bxl_ctxbuild). The result is a
17-
[`bxl.BuildResult`](../../api/bxl/bxl/BuildResult), which has `artifacts()` and
16+
[`ctx.build()`](../../api/bxl/Context/#contextbuild). The result is a
17+
[`bxl.BuildResult`](../../api/bxl/BuildResult), which has `artifacts()` and
1818
`failures()` functions that provide iterators to the artifacts or failures,
1919
respectively. You can pass in a single target or target pattern to build.
2020

2121
### Analysis
2222

2323
You can run analysis on targets within BXL via
24-
[`ctx.analysis()`](../../api/bxl/bxl/Context/#bxl_ctxanalysis). Analysis means
25-
to evaluate the underlying rule implementation for the inputted targets, and
24+
[`ctx.analysis()`](../../api/bxl/Context/#contextanalysis). Analysis means to
25+
evaluate the underlying rule implementation for the inputted targets, and
2626
produce the providers that the rule defined for the target. A common workflow is
2727
to inspect the resulting providers, and perhaps ensure parts of these providers
2828
or run actions using information from the providers (see [Actions](#actions)
@@ -34,12 +34,9 @@ Buck2 supports a couple different query types: querying the unconfigured graph
3434
(`buck2 uquery`), the configured graph (`buck2 cquery`), or the action graph
3535
(`buck2 aquery`). These queries are all available in BXL as well:
3636

37-
- `ctx.uquery()` returns a
38-
[`bxl.UqueryContext`](../../api/bxl/bxl/UqueryContext)
39-
- `ctx.cquery()` returns a
40-
[`bxl.CqueryContext`](../../api/bxl/bxl/CqueryContext)
41-
- `ctx.aquery()` returns a
42-
[`bxl.AqueryContext`](../../api/bxl/bxl/AqueryContext)
37+
- `ctx.uquery()` returns a [`bxl.UqueryContext`](../../api/bxl/UqueryContext)
38+
- `ctx.cquery()` returns a [`bxl.CqueryContext`](../../api/bxl/CqueryContext)
39+
- `ctx.aquery()` returns a [`bxl.AqueryContext`](../../api/bxl/AqueryContext)
4340

4441
You can read more about the individual queries in the API docs. There are many
4542
queries that are common between uquery, cquery, and aquery, but cquery and
@@ -50,13 +47,13 @@ query that takes in the entire query as a string literal. A common use for
5047
entire query string directly into `eval()`.
5148

5249
The query results are target sets (iterable container) of
53-
[`bxl.UnconfiguredTargetNode`s](../../api/bxl/bxl/UnconfiguredTargetNode) for
54-
uquery, [`bxl.ConfiguredTargetNode`s](../../api/bxl/bxl/ConfiguredTargetNode)
55-
for cquery, and [`bxl.ActionQueryNode`s](../../api/bxl/bxl/ActionQueryNode) for
56-
aquery. Each of these node types have accessors on their attributes. A common
57-
workflow is to run some query in BXL, and iterate through the resulting nodes to
58-
inspect their attributes, and use those attributes to inform further
59-
computations in BXL.
50+
[`bxl.UnconfiguredTargetNode`s](../../api/bxl/UnconfiguredTargetNode) for
51+
uquery, [`bxl.ConfiguredTargetNode`s](../../api/bxl/ConfiguredTargetNode) for
52+
cquery, and [`bxl.ActionQueryNode`s](../../api/bxl/ActionQueryNode) for aquery.
53+
Each of these node types have accessors on their attributes. A common workflow
54+
is to run some query in BXL, and iterate through the resulting nodes to inspect
55+
their attributes, and use those attributes to inform further computations in
56+
BXL.
6057

6158
#### Uquery
6259

@@ -84,8 +81,7 @@ You can create actions directly within the BXL API. The available action APIs
8481
are equivalent to the ones found on the
8582
[`AnalysisActions`](../../api/build/AnalysisActions) type for normal rules, with
8683
the caveat that [dynamic actions](./bxl_dynamic_output.md) use the
87-
[`bxl.Context`](../../api/bxl/bxl/Context) (which provides richer
88-
functionalities).
84+
[`bxl.Context`](../../api/bxl/Context) (which provides richer functionalities).
8985

9086
A common workflow would be to run analysis on a target, and use some interesting
9187
bits found in the analysis result to construct an augmented
@@ -98,13 +94,13 @@ output (see below for ensuring). Also see
9894
Ensuring an artifact means that you want the artifact to be materialized
9995
(meaning, downloaded to your machine) at the end of the BXL execution. There are
10096
two APIs for ensuring: `ctx.output.ensure()` and `ctx.output.ensure_multiple()`
101-
(see [`bxl.OutputStream`](../../api/bxl/bxl/OutputStream)). As the naming
102-
indicates, the former is for ensuring a single artifact, and the latter is for
103-
ensuring multiple artifact-like inputs. Artifact-like inputs include
97+
(see [`bxl.OutputStream`](../../api/bxl/OutputStream)). As the naming indicates,
98+
the former is for ensuring a single artifact, and the latter is for ensuring
99+
multiple artifact-like inputs. Artifact-like inputs include
104100
[`cmd_args`](../../api/build#cmd_args) (can be found when inspecting providers),
105-
[`bxl.BuildResult`](../../api/bxl/bxl/BuildResult) (produced when building
106-
something in BXL), or [`artifact`](../../api/build/artifact) (can be found when
107-
inspecting providers, or creating your own actions).
101+
[`bxl.BuildResult`](../../api/bxl/BuildResult) (produced when building something
102+
in BXL), or [`artifact`](../../api/build/artifact) (can be found when inspecting
103+
providers, or creating your own actions).
108104

109105
A common workflow is to ensure an artifact that you created via some custom
110106
actions defined in your script, or ensuring some artifacts found in the

docs/developers/bxl_common_how_tos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ computations, that would also result in errors.
249249

250250
However, if you are not making any assumptions about the existence of these
251251
artifacts, you can use use
252-
[`get_path_without_materialization()`](../../api/bxl/bxl#get_path_without_materialization),
252+
[`get_path_without_materialization()`](../../api/bxl#get_path_without_materialization),
253253
which accepts source, declared, or build aritfacts. It does _not_ accept ensured
254254
artifacts (also see
255255
[What do I need to know about ensured artifacts](./bxl_faq.md#what-do-i-need-to-know-about-ensured-artifacts)).
256256

257257
For getting paths of `cmd_args()` inputs, you can use
258-
[`get_paths_without_materialization()`](../../api/bxl/bxl#get_paths_without_materialization),
258+
[`get_paths_without_materialization()`](../../api/bxl#get_paths_without_materialization),
259259
but note this is risky because the inputs could contain tsets, which, when
260260
expanded, could be very large. Use these methods at your own risk.

docs/developers/bxl_getting_started.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ If you are mostly unfamiliar with Buck2, take a look at
88

99
## Navigating the docs
1010

11-
All BXL APIs can be found [here](../../api/bxl/bxl). A good place to start would
12-
be the [`bxl.Context`](../../api/bxl/bxl/Context), which contains all available
13-
BXL functionalities.
11+
All BXL APIs can be found [here](../../api/bxl). A good place to start would be
12+
the [`bxl.Context`](../../api/bxl/Context), which contains all available BXL
13+
functionalities.
1414

1515
The [Build APIs](../../api/build) available and often useful in BXL as well.
1616

@@ -67,14 +67,14 @@ your_function_name = bxl_main(
6767
```
6868

6969
The implementation function takes a single context as parameter (see the
70-
documentation for [`bxl.Context`](../../api/bxl/bxl/Context)). Using it, you'll
71-
be able to access functions that enable you to perform queries, analysis,
72-
builds, and even create your own actions within BXL to build artifacts as part
73-
of a BXL function.
70+
documentation for [`bxl.Context`](../../api/bxl/Context)). Using it, you'll be
71+
able to access functions that enable you to perform queries, analysis, builds,
72+
and even create your own actions within BXL to build artifacts as part of a BXL
73+
function.
7474

7575
The primary method to return information from BXL is to either print them, or
7676
build some artifact (for details, see the
77-
[`bxl.OutputStream`](../../api/bxl/bxl/OutputStream) documentation, available as
77+
[`bxl.OutputStream`](../../api/bxl/OutputStream) documentation, available as
7878
part of `ctx.output`). At high level, `ctx.output.print(..)` prints results to
7979
stdout, and `ctx.output.ensure(artifact)` marks artifacts as to be materialized
8080
into buck-out by the end of the BXL function, returning an object that lets you

0 commit comments

Comments
 (0)