Toolchain development

Guide engineers through building, testing, and debugging the Carbon toolchain.

33.9k|1.7k|Updated Apr 27, 2020
One-click install
npx skills add https://github.com/carbon-language/carbon-lang --skill toolchain-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Toolchain development
Source: https://github.com/carbon-language/carbon-lang/tree/main/.agents/skills/toolchain_development
Command: npx skills add https://github.com/carbon-language/carbon-lang --skill toolchain-development

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This section explains how to check, build, debug, and understand the Carbon toolchain to streamline development workflows and reduce ramp-up time for contributors.

Core Features & Use Cases

  • Guides on navigating the toolchain structure and architecture (base, check, lex, parse, lower, sem_ir)
  • Step-by-step workflows for building, testing, and debugging, including common pitfalls
  • Use Case: A contributor validating a change in the parser and SemIR generation and ensuring it passes existing tests

Quick Start

Run the autoupdate_testdata.py script to refresh test data before running a targeted build.

Frequently Asked Questions about Toolchain development

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

FAQPage Schema
How do I build and test the Carbon toolchain locally?

To build and test the Carbon toolchain locally, run the autoupdate_testdata.py script to refresh test data, then execute a targeted build using Bazel to validate your changes and ensure they pass existing tests.

What is the architecture of the Carbon toolchain?

The Carbon toolchain architecture consists of several core components including base, check, lex, parse, lower, and sem_ir, which guide engineers through the structure for iterative development and debugging.

How do I debug the parser and SemIR generation in Carbon?

To debug the Carbon parser and SemIR generation, navigate the toolchain structure to isolate the parse and sem_ir components, then run targeted Bazel testing workflows to identify and resolve common pitfalls during iterative development.

When do I need to run the autoupdate_testdata.py script?

You need to run the autoupdate_testdata.py script before executing a targeted build to refresh and maintain test data, ensuring your local testing environment accurately reflects the current state of the Carbon toolchain.

Does the Carbon toolchain build system work with Bazel?

Yes, the Carbon toolchain build system works with Bazel, supporting iterative development workflows by allowing contributors to run targeted builds and tests for specific components like the parser and SemIR generation.

Why does my Carbon toolchain build fail after updating parser test data?

A Carbon toolchain build may fail after updating parser test data if the changes are not validated against existing tests, requiring you to run the autoupdate_testdata.py script and execute targeted Bazel builds to check for common pitfalls.