CommunityImagegithub.com

build2-community/build2

Use when building, testing, packaging, or managing dependencies for C/C++ projects with the build2 toolchain. Covers the build system driver (b), package manager (bpkg), project dependency manager (bdep), task runner (bx), and repository web interface (brep). Activate for: writing or reading buildfiles, diagnosing build errors, resolving package dependency conflicts, packaging a library for cppget.org, setting up build configurations, configuring installations, authoring testscripts, hosting package repositories, or running any b/bpkg/bdep/bx/brep-* command.

What is build2?

build2 is a Claude Code agent skill that use when building, testing, packaging, or managing dependencies for C/C++ projects with the build2 toolchain. Covers the build system driver (b), package manager (bpkg), project dependency manager (bdep), task runner (bx), and repository web interface (brep). Activate for: writing or reading buildfiles, diagnosing build errors, resolving package dependency conflicts, packaging a library for cppget.org, setting up build configurations, configuring installations, authoring testscripts, hosting package repositories, or running any b/bpkg/bdep/bx/brep-* command.

Works with✓Claude Code~Codex CLI~Cursor
npx skills add https://github.com/build2-community/build2-agent-skills/tree/HEAD

Installed? Explore more Image skills: steipete/songsee, affaan-m/frontend-design, mattpocock/improve-codebase-architecture · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

build2 Skill

build2 is an integrated C/C++ build toolchain combining a build system (b), package manager (bpkg), project dependency manager (bdep), task runner (bx), and repository web interface (brep). This skill provides structured reference documentation for all five tools.

Start with INDEX.md for the full command index and navigation, or use the table below to jump directly to the relevant file.

When to use

TaskStart here
Write or read a buildfileguides/build2-intro-concepts.md
Buildfile language syntax (if/loop/switch/patterns)guides/build2-buildfile-language.md
Buildfile directives, name patterns, and attributesguides/build2-directives-patterns.md
Pin a target to src instead of out (@./ qualification)guides/build2-targets-variables.md
Create nested directories with fsdir{}HOWTO/fsdir-parent-chain.md
Look up a buildfile function signature, flags, or purityguides/build2-functions.md
Library projects, target importation, subprojectsguides/build2-projects-advanced.md
Import a library for metadata and still link it (including installed)HOWTO/import-immediate-vs-ordinary.md
Add rpath for a dlopen-only (never linked) dependencyHOWTO/rpath-unlinked-dependency.md
Write an ad hoc recipe ({{ }})HOWTO/ad-hoc-recipe.md
Share one recipe body across several targets via ~/^ name patternsHOWTO/ad-hoc-pattern-rule.md
Create a PHONY-equivalent (alias{}) targetHOWTO/alias-targets.md
Which compile/link options belong in a buildfileHOWTO/buildfile-compile-options.md
Place a compile flag after compiler mode or -stdHOWTO/buildfile-compile-options.md
Choose += vs = for a target-specific listHOWTO/buildfile-compile-options.md
Port a CMake project to build2 buildfilesHOWTO/migrate-from-cmake.md
Keep the build graph configuration-independentHOWTO/config-independent-build-graph.md
C/C++ compile and link options, module supportguides/build2-modules-cxx.md
C-common variables, DLL export, compilation database, compiler class vs. IDguides/build2-modules-cc.md
bin/liba/libs/exe target typesguides/build2-modules-bin.md
Match an upstream shared library name or SONAMEHOWTO/match-upstream-library-name.md
Create a header-only (binless) libraryHOWTO/header-only-library.md
Link pthreadHOWTO/link-pthread.md
Link a system library (-lm, -ldl, advapi32.lib)HOWTO/link-system-library.md
Embed a Windows .rc resource (VERSIONINFO) in a DLLHOWTO/windows-resource-file.md
Order sources before libraries on a link targetHOWTO/link-prerequisite-order.md
Make library components optionalHOWTO/optional-library-components.md
Use auto-generated C/C++ headersHOWTO/generated-headers.md
Create a library that provides main()HOWTO/library-provides-main.md
Disable shared library variant per platformHOWTO/disable-shared-lib-per-platform.md
Export metadata from executables or librariesHOWTO/target-metadata.md
Test an installed import! locally against a real prefixHOWTO/local-installed-import.md
Add/remove packages, resolve version conflictsbpkg/README.md
Build a package, upgrade, or patchbpkg/bpkg-pkg-build.md
Create a bpkg configuration (standalone, no bdep project)bpkg/bpkg-cfg-create.md
Create a configuration and initialize a bdep project in itbdep/bdep-init.md
Initialize a project in an existing configurationbdep/bdep-init.md
Sync manifest/lockfile with configurationbdep/bdep-sync.md
Create a new projectbdep/bdep-new.md
See what a bdep new option combination createsbdep/bdep-new-layouts.md
Publish a packagebdep/bdep-publish.md
Release a new versionbdep/bdep-release.md
Write testscriptsguides/testscript-summary.md
Testscript commands, redirections, regex, cleanup, builtinsguides/testscript-commands.md
Sanitize misbehaving tests with TestscriptHOWTO/sanitize-tests.md
Use assert() correctly in testsHOWTO/assert-in-tests.md
Tests with extra dependencies (separate test package)HOWTO/tests-extra-dependencies.md
Write a lib-tests/examples/benchmarks summary or PACKAGE-READMEHOWTO/tests-extra-dependencies.md
Build only what is needed for test or installHOWTO/update-for-test-install.md
Wire runtime test fixtures (child helpers, source-tree data)HOWTO/test-runtime-fixtures.md
Give tests access to source-tree data directoriesHOWTO/test-runtime-fixtures.md
Exclude test fixtures/resources from a b dist archiveHOWTO/exclude-test-data-from-dist.md
Testscript-test an imported executable (e.g. a package's own exe{} from tests/)HOWTO/test-imported-executable.md
Resolve "already updated but [not] for install" conflictsHOWTO/for-install-conflicts.md
Package a third-party libraryguides/packaging-guide-summary.md
Run the end-to-end cppget.org packaging workflowskills/build2-package/SKILL.md
Run the local pre-publish packaging sanity checkskills/build2-review/SKILL.md
Name a third-party package, project, and repositoryHOWTO/package-naming.md
Start a third-party package on the review branchguides/packaging-guide-summary.md
Require a dependency feature from a depends clauseHOWTO/require-dependency-feature.md
How a pkg vs git repository finds dependenciesguides/packaging-guide-summary.md
Test and publish a third-party packageguides/packaging-guide-testing.md
Review a third-party package submissionguides/packaging-guide-review.md
Packaging version management (new revision, new version)guides/packaging-guide-version-management.md
Packaging antipatterns, what not to doguides/packaging-guide-antipatterns.md
Handle private headers when packaging a third-party projectHOWTO/third-party-private-headers.md
Install man pages (any section other than 1)HOWTO/man-pages-install.md
Package an upstream changelog with a non-canonical nameHOWTO/package-changes-file.md
bpkg package name rules, version format, constraint syntaxguides/bpkg-package-name-version.md
Express a package license in the manifest (SPDX, other:, multiple licenses)guides/packaging-license.md
Install or bootstrap the toolchainguides/install-bootstrap.md
Install toolchain from repository (step 3)guides/install-toolchain.md
Upgrade an installed toolchain (dirty or staged)guides/install-upgrade.md
Use .in template preprocessing or bash moduleguides/build2-modules-misc.md
version module: variables, snapshot versions, version headersguides/build2-module-version.md
Process config.h.in / config.h.cmake / config.h.mesonguides/build2-modules-autoconf.md
Add project-specific autoconf checksguides/build2-autoconf-project-checks.md
Contribute a check to the autoconf builtin catalogguides/build2-autoconf-contributing-checks.md
Use autoconf check results in buildfilesguides/build2-autoconf-buildfile.md
kconfig: Kconfig language reference (config entries, dependencies, menus, choices)guides/kconfig-summary.md
kconfig: build system integration and examplesguides/kconfig-integration.md
kconfig: helper options, non-interactive/random configuration recipesguides/kconfig-patterns.md
Create a custom build2 module (rules, init, boot)guides/build2-module-hello.md
Understand the build2 module API (entry points, module_functions)guides/build2-module-hello.md
Develop a bootstrap-phase build2 moduleguides/build2-module-hello.md
Write a custom build2 rule (match, apply, recipe, register)HOWTO/write-build2-rule.md
Set up a build2 module development environmentguides/build2-module-dev-setup.md
Split host/target build configurations for module developmentguides/build2-module-dev-setup.md
Use a dev-version module in other projectsguides/build2-module-dev-setup.md
Set up cross-compilation with target tripletsHOWTO/cross-compilation.md
Manage debug/release/sanitize configurationsHOWTO/multiple-configurations.md
Set up a CI/CD pipeline for a build2 projectHOWTO/ci-cd-setup.md
Filter automated CI builds for specific platformsHOWTO/builds-ci-filtering.md
Trace whether a build-include/build-exclude pattern matches a bot nameHOWTO/builds-ci-filtering.md
Read cppget.org CI results (test-installed badges)HOWTO/ci-results.md
Request a system-provided library on a specific CI botHOWTO/sys-build-config.md
Set up build2 for toolchain developmentHOWTO/toolchain-dev-setup.md
Scaffold a new bpkg package directoryscripts/new-package.sh
Run .bx scripts or named tasksbx/bx.md
Get started with .bx scripts (practical walkthrough)HOWTO/bx-script.md
Verify toolchain is installedscripts/verify-install.sh
Find a C++ compiler for config.cxx=scripts/probe-compiler.sh
Validate a package manifest filescripts/check-manifest.sh
Run tests in a bpkg configurationscripts/run-tests.sh
Inspect project name/version/rootsscripts/show-project-info.sh
Check for broken links in documentationscripts/check-links.sh
Deploy a brep package repository web interfacebrep/README.md
Load repository data into brepbrep/brep-load.md
Expire old builds or archive tenants in brepbrep/brep-clean.md
Set up or migrate brep databasesbrep/brep-migrate.md
Monitor brep build infrastructure for delaysbrep/brep-monitor.md
Clean up binary distribution upload directoriesbrep/brep-upload-bindist-clean.md
Implement a package submission or CI handlerbrep/brep-request-handling.md
Understand the brep package submission protocolbrep/brep-request-handling.md
Understand the brep CI request protocolbrep/brep-request-handling.md
Troubleshoot errorsHOWTO/troubleshooting.md
Practical recipes by topicHOWTO/README.md
Terminology referenceGLOSSARY.md

Quick tool orientation

BinaryRoleLoad when
bBuild system driver: reads buildfiles, executes operationswriting buildfiles, diagnosing builds
bpkgPackage manager: manages packages in a build configurationadding dependencies, publishing
bdepProject dependency manager: syncs manifests with configurationsday-to-day project workflow
bxTask runner: runs .bx scripts or named tasksautomation, scripted tasks
brep-load et al.Repository web interface: hosts packages, handles CI and submissiondeploying or operating a package repository

Most common invocations

b                              # Build default target in current directory
b test                         # Build and run tests
b clean update                 # Rebuild from scratch
b install config.install.root=/usr/local

bpkg create -d build-gcc cc config.cxx=g++
bpkg build hello               # Build a package into the configuration

bdep new -l c++ -t exe hello   # Create a new executable project
bdep init -C ../build-gcc @gcc cc config.cxx=g++  # Create config and initialize project in it
bdep sync                      # Sync manifest/lockfile with configurations
bdep test                      # Run tests across all configurations
bdep update                    # Update project in all configurations

See also GLOSSARY.md for terminology definitions.

Individual skills in this repo

This repo contains 2 individual skills — each has its own dedicated page.

Related Skills