Skip to content

Commit 8565611

Browse files
redsun82Copilot
andcommitted
Bazel skill: narrow the rust.bzl rationale to shipped binaries
The wrapper is mandatory for binaries that go into a pack, not for every rust_binary in the repo: swift-syntax-parse is a local debugging aid and deliberately declares a plain one. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 66b70bd commit 8565611

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

‎.github/skills/bazel/SKILL.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@ Bazel's own macro / rule / repository-rule distinction applies as usual. What is
4848
| a wrapper used across languages | `misc/bazel/` |
4949

5050
Prefer inline rules in `BUILD.bazel`. A `.bzl` file earns its `load()` only when the shape repeats across packages or a
51-
value must be computed: [`rust.bzl`](../../../misc/bazel/rust.bzl) is worth it because every Rust binary in the repo
52-
must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. The `_gen_binaries`
53-
list in [`go/BUILD.bazel`](../../../go/BUILD.bazel) is not — it is shared by two targets in one file, so a local
51+
value must be computed: [`rust.bzl`](../../../misc/bazel/rust.bzl) is worth it because every Rust binary that ships in a
52+
pack must get the same universal-binary wrapper and symbols test, and forgetting either is a release bug. A local
53+
debugging aid opts out and declares a plain `rust_binary` — see `swift-syntax-parse` in
54+
[`unified/swift-syntax-rs/BUILD.bazel`](../../../unified/swift-syntax-rs/BUILD.bazel). The `_gen_binaries` list in
55+
[`go/BUILD.bazel`](../../../go/BUILD.bazel) does not earn a `.bzl` — it is shared by two targets in one file, so a local
5456
variable does the job.
5557

5658
Macros here are typically a thin public wrapper around a private rule (`codeql_csharp_binary`, `swift_cc_binary`). Keep

0 commit comments

Comments
 (0)