Skip to content

bzd Framework

Build Status CI

Access the rendered version of this documentation.

Fullstack, lightweight and flexible framework for IoT applications. This mono-repository enables the following technologies:

C++20 Rust (2024) Python3.13 Node (v23) Vue Bazel KiCad

Overview

This framework is built to run on all sorts of embedded platforms, from bare-metal 8-bit microcontrollers to high-performance compute units. It is made to remove any dependencies from STL, but to provide a similar set of components and utilities to develop applications in an efficient and safe manner.

It features the following:

  • No dynamic allocations. All storage is declared either at compile time or on the stack.
  • The core library is self-contained, no reliance on third-party libraries, only on the freestanding STL.
  • Flexible error handling model.
  • Based on C++ coroutines.
  • Compile-time string formatting tool.
  • Lightweight.
  • Useful set of containers.

Platforms

The following target platforms are currently supported:

Name Compiler Version Executors Debug
linux_x86_64_clang* clang 19.1.7 host*
linux_x86_64_gcc gcc 14.2.0 host*
esp32_xtensa_lx6_gcc gcc 14.2.0 sim*, uart x
esp32s3_xtensa_lx7_gcc gcc 14.2.0 sim*, uart x

* Default.

When debug is supported by the platform, one can run a target with the --config=debug option and a debug environment will be made available.

Build

Locally

To build everything, just run:

./tools/bazel test //...

This will build locally; it will fetch all tools needed to build on your machine.

Remote

To build Bazel targets, simply run ./tools/bazel with --config=remote appended.

For debugging purposes, toolchains can be run locally in a docker sandbox which is very similar to what runs on remote execution. To enable this configuration, run ./tools/bazel with --config=docker.

Documentation

To build the full project documentation, run:

./tools/bazel run //docs

Code Quality

All supported languages come with their set of code quality related tools. To run all static sanity checks, code formatters and documentation generators at once, run the following command:

./tools/bazel run //:sanitizer

To run all tests, run the following command:

./quality_gate

This is a non-exhaustive list of languages and their supported tools. In addition to that, formatters and linters for YAML, JSON and Markdown are also available.

Language Formatters Code Analyzers Code Coverage Test Framework Documentation
C++ clang-format clang-tidy, asan, lsan, tsan, ubsan Yes Yes doxygen-based
Python ruff ruff, mypy Yes Yes
Node prettier eslint Yes Yes
Skylark buildifier buildifier stardoc

Update compile_commands.json

./tools/bazel run @bzd_sanitizer//aspects/compile_commands:build

Update rust-project.json

./tools/bazel run @rules_rust//tools/rust_analyzer:gen_rust_project -- //rust/...

Naming Convention

The code in this repository follows several principles regarding naming conventions. The following rules are applied across languages.

  • Files and directories are named lower case snake_case using only the characters matching the regex: [a-z0-9_/.]. This is enforced by tools/bazel_build/modules/bzd_sanitizer/actions/structure.
  • Variables, constants, functions, concepts, namespaces are named in camelCase.
  • All types are named in PascalCase.
  • Non-public members (variables, functions...) are appended with a _ character.
  • All names avoid abbreviations.

Memory Footprint

All classes offered by this library have the same objective to have a fixed memory size. Their footprint or maximum size is determined at compile time, ensuring no memory allocation at runtime, making this library ideal for any safety-critical application.