ワンクリックで
bazel-usage
Instructions that **MUST** be followed when using Bazel or Bazelisk to build, test, and debug in the Carbon repository.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Instructions that **MUST** be followed when using Bazel or Bazelisk to build, test, and debug in the Carbon repository.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Instructions for registering, mapping, constant evaluating, and lowering builtin functions in the Carbon toolchain.
Instructions for declaring, formatting, emitting, testing, and styling diagnostic messages (errors, warnings, notes) in the Carbon toolchain.
Guidelines and restrictions on shell commands and file manipulation tools for AI assistants.
Instructions for using Jujutsu (jj) for version control in the Carbon repository.
Instructions for running prek, the Carbon pre-submit/style/lint checker, that *MUST* be run before submitting an change.
Instructions for authoring, structuring, and running toolchain tests using the file_test infrastructure.
| name | Bazel usage |
| description | Instructions that **MUST** be followed when using Bazel or Bazelisk to build, test, and debug in the Carbon repository. |
This skill documents how best to use Bazel when building, testing, or manipulating the Carbon repository's Bazel in any way.
Carbon uses Bazel for its build system. To ensure consistent versions, the project uses Bazelisk.
[!IMPORTANT] Always use
bazeliskwhenever you want to run Bazel. Never runbazeldirectly in the Carbon project. Anything you want to do withbazelcan be done with thebazeliskcommand instead.
bazelisk in your existing $PATH if available.
run_bazelisk.py: If bazelisk isn't available, use
./scripts/run_bazelisk.py to run bazelisk without it being installed.bazelisk build //...bazelisk build //toolchain/...bazelisk build //toolchain:carbonbazelisk test //...:allbazelisk test //toolchain/...bazelisk test //examples/...[!TIP] Running all of the tests can be slow, so try to narrowly test the immediately relevant parts of the project first, and only expand coverage as necessary to be confident in the changes.
[!TIP] For specialized instructions on testing and developing the Carbon toolchain, consult these skills:
- Toolchain tests: For authoring, structuring, and running
file_testtests.- Toolchain development: For architecture, essential commands, and debugging the toolchain.
[!IMPORTANT] Always manually run binaries built by Bazel using the
bazelisk runcommand. Never run the binary directly frombazel-bin/.
You can run the Carbon driver or command line directly via Bazel:
bazelisk run //toolchain -- compile --phase=parse toolchain/parse/testdata/basics/empty.carbonTo enable ASan for local testing:
--config=asan: bazelisk test --config=asan //...bazel cleanChanges to packages installed on your system (like changing LLVM versions or
installing libc++) may not be noticed by Bazel.
bazelisk clean to force cached state to be rebuilt when environment
changes occur.