tree: 7ab0ecfefa539286a4ce09088405f23269e24296
  1. common/
  2. fuchsia/
  3. scripts/
  4. tools/
  5. BUILD.bazel
  6. MODULE.bazel
  7. README.md
  8. WORKSPACE.bazel
  9. WORKSPACE.bzlmod
build/bazel_sdk/bazel_rules_fuchsia/README.md

Fuchsia Bazel SDK

This directory contains the contents of the Fuchsia Bazel SDK. The Fuchsia Bazel SDK is a set of rules which aid in the development of Fuchsia packages and products.

Static vs. Generated files

The Fuchsia Bazel SDK is comprised of multiple different Bazel repositories. There are static repositories which contain pure source code and can be used as is without needing to be run through any system to transform them. Then there are various generated repositories which are either created by a repository rule in bazel itself or are generated by the Fuchsia build system.

The repositories that users generally need to interact with are:

  • rules_fuchsia — A static repository which contains all of the build rules that users should load in their BUILD.bazel files. It also contains toolchain types, python scripts, platform definitions, build flags, etc.
  • fuchsia_sdk — A generated repository and contains all of the BUILD.bazel files that are generated from the Fuchsia IDK. Additionally, this repository contains generated constants for the supported API levels, constraints, toolchain implementations and other data that comes from the IDK. The targets contained in this repository are generally used as dependencies in other targets.
  • fuchsia_clang — A generated repository that contains the clang repository. This repository contains the build flags and c++ toolchain definitions.

Directory layout

  • common — A set of repository rules that are part of rules_fuchsia as well as the rules that are used inside the Fuchsia build system.
  • fuchsia — Bazel build rules. The files declared in this directory make up the public API for rules_fuchsia.
  • fuchsia/private — The implementation of the rules_fuchsia public interface.
  • fuchsia/tools — The python scripts and other tools that are used as in various starlark actions.
  • fuchsia/workspace — Workspace rules that are used to create the generated repositories.
  • fuchsia/constraints — Definitions for constraints and platforms used in the rules.
  • fuchsia/flags — All of the build flags that are part of the SDK.