One-click install
npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill bazel-mohitmishra786
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: bazel
Source: https://github.com/mohitmishra786/low-level-dev-skills/tree/main/skills/build-systems/bazel
Command: npx skills add https://github.com/mohitmishra786/low-level-dev-skills --skill bazel-mohitmishra786

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers navigate the complexities of the Bazel build system, enabling efficient and reliable C/C++ project builds, dependency management, and toolchain configuration.

Core Features & Use Cases

  • BUILD File Authoring: Guides on writing BUILD files with cc_library and cc_binary rules.
  • Dependency Management: Explains Bzlmod for managing external dependencies.
  • Build Graph Analysis: Demonstrates bazel query and cquery for understanding project structure.
  • Toolchain Configuration: Assists in registering custom C++ toolchains.
  • Remote Execution & Caching: Provides insights into setting up distributed builds.
  • Debugging: Offers strategies for troubleshooting sandbox issues and build failures.

Quick Start

Use the bazel skill to build the //src:main target in your C++ project.

Frequently Asked Questions about bazel

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write BUILD files for C++ projects using Bazel?

To write Bazel BUILD files for C++ projects, define your compilation targets using rules like cc_library and cc_binary. This structures source code into reproducible build components within the dependency graph.

How does Bzlmod work for managing external dependencies in Bazel?

Bzlmod manages external dependencies in Bazel by using MODULE files to declare and resolve project requirements. This system replaces legacy WORKSPACE configurations to provide reliable, transitive dependency resolution.

What is the best way to analyze a Bazel dependency graph?

The best way to analyze a Bazel dependency graph is using the bazel query and cquery commands. These tools inspect your project structure, trace target dependencies, and help optimize build execution paths.

How do I register a custom C++ toolchain in Bazel?

Registering a custom C++ toolchain in Bazel involves configuring build constraints and defining toolchain rules. This ensures Bazel selects the correct compilers and linkers for your specific development environment.

Why does my Bazel sandbox debugging fail during C++ builds?

Bazel sandbox debugging fails during C++ builds when file permissions restrict access or hidden dependencies bypass the declared build graph. Isolating execution environments requires strict dependency declaration.

Does Bazel support remote execution for distributed C++ builds?

Bazel supports remote execution for distributed C++ builds by sending build actions to shared worker pools. This accelerates compilation times and enables remote caching across network infrastructure.