Bazel is a multi-language, hermetic build system developed primarily by Google. The codebase serves as both the build tool itself (a C++ client communicating with a Java server) and the infrastructure for writing build rules in Starlark, a Python-like DSL. It implements a unique incremental build engine (Skyframe) that caches all intermediate states for correctness and speed, and supports remote caching and execution. The repository contains the full stack: command-line option parsing, Starlark interpreter and compiler, process sandboxing and wrapping, test runners (JUnit4 with coverage), jar merging, and platform-specific native code for Linux, macOS, and Windows. The architecture is split into a thin C++ client (handling startup, workspace discovery, and communication with the server) and a heavy Java server that performs all build analysis and execution. Key modules include the Starlark runtime (net.starlark.java.eval) which is an embeddable dynamic language with type checking, and the options framework (com.google.devtools.common.options) which provides annotation-driven, extensible command-line parsing. The repository is self-hosting: builds of Bazel are built with Bazel itself, using a bootstrap script. It maintains an extensive test suite across shell, Java, C++, and Python, and has active CI pipelines for multiple platforms and configurations.
This repository is a production-grade Rust implementation of the Starlark language, the deterministic Python-like configuration language used by build systems such as Bazel and Buck2. The system is structured as a multi-crate workspace: `starlark` provides the core runtime (parser, bytecode compiler, evaluator, garbage-collected heap, type system, and standard library), `starlark_syntax` handles parsing and AST, `starlark_map` offers high-performance ordered hash maps and sets, `starlark_derive` supplies procedural macros for defining Starlark-compatible Rust types, and `starlark_bin` bundles a CLI with REPL, linter, and Debug Adapter Protocol (DAP) server. Additional crates include `starlark_lsp` for Language Server Protocol support and a WASM example for embedding in JavaScript. The architecture is a classic interpreter pipeline: source text is parsed into an AST (`AstModule`), compiled to bytecode (with optimizations like constant folding, speculative execution, and inlining), and executed by a stack-based bytecode VM. Values are managed on a two-tier heap (unfrozen mutable and frozen immutable) with a custom bump allocator and explicit freeze operations. The type system supports both runtime type checking and static analysis, including union types, callable signatures, and generic type matchers. External dependencies include the `tower-lsp` and `lsp-types` crates for the LSP server, and several internal Facebook crates (e.g., `buck2_core`, `buck2_data`) for pagable serialization and profiling. Key entry points are `starlark::eval::eval_module` for programmatic evaluation, `starlark_bin/bin/main.rs` for the CLI, and the `#[starlark_module]` and `#[starlark_value]` proc macros for extending the language with custom types and functions. The system is designed for embedding in build tools, with a focus on performance, determinism, and debuggability.
Protoconf is a configuration-as-code framework that uses protobuf schemas and Starlark (a Python dialect) to define, compile, and deliver configuration to services. In production, it operates as a multi-component system: a compiler that transforms Starlark config files into protobuf messages, an agent that serves compiled configs to applications via gRPC streaming, a server that handles config mutations (with git-based workflows and staged rollouts), and an inserter that pushes configs to key-value stores (Consul, etcd, Zookeeper, Kubernetes ConfigMaps). The architecture is modular with clear separation between compilation, storage, and delivery layers, all communicating via gRPC and protobuf. External dependencies include protobuf tooling, Starlark runtime, gRPC, and multiple KV store backends. The project also includes a web IDE (compiled to WASM) for browser-based config authoring and a Python client library for config consumption.
This repository provides the Bazel build rules and tooling for building Android applications (APKs, AABs, libraries) using Bazel. It includes Starlark rules for android_binary, android_library, android_local_test, etc., along with a suite of Go and Java tools for resource processing, dexing, R8 optimization, manifest merging, and mobile-install deployment. The codebase is production-grade, used internally at Google, and supports both WORKSPACE and Bzlmod. It features a well-architected processing pipeline pattern, a reusable flag system, and extensive test infrastructure. The repository is actively maintained with regular commits and CI, though it carries some technical debt from internal migration and legacy feature flags.
rules_boost is a Bazel repository providing build rules for the Boost C++ libraries. It allows Bazel users to depend on Boost libraries using labels like @boost//:algorithm. The repository fetches Boost source code and provides platform-specific build configurations for hundreds of Boost components, handling separate compilation requirements for libraries like ASIO and Beast. While the README indicates it's legacy compared to Bazel Central Registry, it remains maintained for compatibility. The core reusable component is the boost_library macro in boost/boost.bzl, which encapsulates patterns for building C++ libraries with Bazel.