kas-based Yocto BSP build orchestrator - live build UI, pre-flight checks, telemetry, and failure triage
Project description
bakar
kas-based BSP build orchestrator for Yocto. Wraps kas-container with manifest-driven sync, pre-flight checks, a live event-driven build UI, structured telemetry, and post-mortem tooling. Works with NXP i.MX (repo XML), TI Sitara (oe-layertool), bitbake-setup workspaces, and any bring-your-own kas YAML.
Features
- Multi-BSP, out of the box - NXP i.MX (
repoXML), TI Sitara (oe-layertool), bitbake-setup workspaces, meta-avocado, and any bring-your-own kas YAML, with automatic family detection. See docs/workspace.md. - Idempotent build pipeline -
doctor->sync->gen-kas->kas-containerbuild in one command, with dry-run,--dry-run-script(emit a runnable shell script for the full invocation), keep-going, and from-scratch rebuild. See docs/build.md, docs/sync.md, docs/gen-kas.md. - Host execution by default - bakar runs
kasdirectly on the host when no container image is configured, so it works out of the box without Docker. The container path stays opt-in: configure akas_container_image(envKAS_CONTAINER_IMAGE, workspace[build], or userconfig.toml) and bakar useskas-container. An explicit[build] host_mode = true(envBAKAR_HOST_MODE, or--host) forces host mode even when an image is configured; it only ever forces host on. Precedence:--host>BAKAR_HOST_MODE> workspacehost_mode> userhost_mode> auto-detect (host when no image configured). - Graceful build stop -
bakar stophalts a running build by routing SIGINT to bitbake's own shutdown (then escalating to SIGTERM/SIGKILL, or--forceto skip the grace period). Container builds are signalled inside the container, targeted by a per-runbakar.run_idlabel; host builds by their recorded process group - so other workspaces and the persistent hashserv daemon are never touched. The build stays resumable with no manualcleansstate, andbakar buildwarns when a prior build was killed uncleanly. See docs/stop.md. - Pre-flight diagnostics - ~30 host/container/workspace checks with PASS/WARN/BLOCK gating and PSI throttle calibration. Checks always run before a build or sync; the global
--hide-doctor-reportflag (orbuild.show_doctor_report = false) hides the report while still aborting on a blocking issue. The host-environment thresholds (inotify instances/watches, swappiness ceiling, docker nofile floor, minimum memory) are configurable viahost.*settings keys; defaults equal the values doctor previously hardcoded. See docs/doctor.md, docs/settings.md. - Live build UI - driven by bitbake's own structured event stream (with a knotty-text fallback): a parse → setscene → tasks pipeline header with per-stage durations and a global wall clock, an sstate reuse ratio ("92% sstate (412 cached, 38 will build)"), a parse cache efficiency note, and a per-task table with task-type icons. Stuck-task highlighting compares each recipe against per-recipe timing baselines accumulated across builds, not just the current run's median. On a task failure the build status freezes above the error text and a
✗ FAILEDalert carries the host-side log path plus the last lines of the task log. Assumes a truecolor terminal and a Nerd Font. - Observability and post-mortem - per-run telemetry (
events.jsonl, logs, timing, disk usage) plus a normalized bitbake event stream (bitbake-events.json) parsed from bitbake's own event log on every build.bakar triagereads that artifact to name the failing recipe/task and print the recorded logfile excerpt (with akas.logfallback for older runs), and selects the right run dir under a multi-release preset fan-out via--run/--preset/--release.bakar monitorwatches a running build in one view - sccache-dist cluster load, build-daemon cache/dist stats, and bitbake task progress - as a refreshing terminal UI or as--json/NDJSON for CI. See docs/triage.md, docs/report.md, docs/log.md, docs/monitor.md. - Reproducibility - pin floating layer SHAs, diff manifests/configs, detect workspace drift (
bakar drift), generate release notes between pinned states (bakar changelog), flatten the resolved kas YAML, pre-fetch sources for offline builds, and seed a host-side premirrorgit2_*.tar.gztarball from a git URL. See docs/lock.md, docs/diff.md, docs/drift.md, docs/changelog.md, docs/dump.md, docs/prefetch.md, docs/mirror.md. - Recipe operations - run one recipe or task through
bakar bitbake(logged, exit-code-faithful), clean a single recipe's sstate withbakar clean-recipe, rebuild one from scratch (cleansstatethen build) withbakar rebuild, and analyze a recipe's dependency graph (blast radius, longest chain, cycles) withbakar graph. See docs/bitbake.md, docs/graph.md. - Build performance and robustness - ccache (per-workspace or shared), NPROC-scaled parallelism, PSI throttling with ratchet-up autocalibration, curated mirrors, persistent hash-equivalence server, and age-based sstate/ccache pruning. See docs/hashserv.md, docs/clean-cache.md.
- Shell and scripting - interactive/one-shot kas-container shell, run a command in every source repo, boot a QEMU image from the build dir. See docs/shell.md, docs/for-all.md, docs/run.md.
- Named presets - name a full build configuration in
config.tomland invoke it withbakar build --preset <name>; multi-release presets fan out to N sequential builds with a summary table. Manage presets withbakar presets list/show/add/remove. See docs/presets.md. - Shell completion - tab-completion for all subcommands, flags, and preset names. bash and zsh via
bakar --install-completion; fish via a generator script. See docs/completion.md. - Layered configuration - CLI >
BAKAR_*env > workspace.bakar.toml> preset > userconfig.toml> BSP default, plus asettingsCRUD interface and a vendor config layer for custom board families. See docs/settings.md, docs/configuration.md. - Advanced tooling - swap the BSP-bundled bitbake for a local upstream checkout, and stress-test the bitbake parser fork race. See docs/bitbake-override.md, docs/stress-parse.md.
- Host preparation -
setupruns once per machine before your first build: it profiles the host, remediates the host-environmentdoctorchecks (sysctl drop-in, dockerdaemon.jsonulimits/storage-driver,kasinstall, git identity, cache dirs), applies privileged steps through a single confirmedsudoof an auditable script, and persists the applied values to the global[host]config. When host mode is the effective default, it also installs thebuildtools-extendedtoolchain (when missing) and persists its path as[build] buildtools_dir, sobakar --host buildis turnkey; container-only setups skip this.--dry-runshows the plan and script without touching anything. See docs/setup.md. - Workspace scaffolding -
initwizard (interactive or--family) writes.bakar.toml. See docs/init.md. - Read-only inspection - query any BitBake variable (
getvar), dump resolved build metadata (show), inspect layer stack and override precedence (layers inspect/status), compare task signatures across builds (diffsigs), and walk the full recipe environment (inspect). See docs/getvar.md, docs/show.md, docs/layers.md, docs/inspect.md, docs/diffsigs.md.
Install
uv tool install bakar
# or
pip install bakar
Quickstart
# First time on this machine: prepare the host (sysctl, docker, kas, git identity)
bakar setup
# NXP i.MX manifest-driven build
bakar build -f imx-6.12.49-2.2.0.xml -m imx8mp-var-dart
# Bring-your-own kas YAML
bakar build my-project.yml
# Post-mortem a failed build
bakar triage
Documentation
Full command reference, workflow guides, and configuration: docs/index.md
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bakar-0.21.0.tar.gz.
File metadata
- Download URL: bakar-0.21.0.tar.gz
- Upload date:
- Size: 343.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8163dea8c871f31a1416e2b27e3e7cfd6386c238c3aafe3ed4231dc4215e546e
|
|
| MD5 |
4d2bd2a10c093aff495223f256a4564b
|
|
| BLAKE2b-256 |
c65521ef267126a98a764c33f39e73732321cc7f059b6cefcf6065fd395083a1
|
Provenance
The following attestation bundles were made for bakar-0.21.0.tar.gz:
Publisher:
publish.yml on jetm/bakar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bakar-0.21.0.tar.gz -
Subject digest:
8163dea8c871f31a1416e2b27e3e7cfd6386c238c3aafe3ed4231dc4215e546e - Sigstore transparency entry: 2117560878
- Sigstore integration time:
-
Permalink:
jetm/bakar@ce097054f5b9844442db0390884db3dbeafcb2ab -
Branch / Tag:
refs/tags/v0.21.0 - Owner: https://github.com/jetm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce097054f5b9844442db0390884db3dbeafcb2ab -
Trigger Event:
push
-
Statement type:
File details
Details for the file bakar-0.21.0-py3-none-any.whl.
File metadata
- Download URL: bakar-0.21.0-py3-none-any.whl
- Upload date:
- Size: 414.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a33ae0b0966ed911793d69607a002fe6e14c20a7c3c40245919dbd2b634b580e
|
|
| MD5 |
11b3e9d71206ec6ab00cb7aaef409b33
|
|
| BLAKE2b-256 |
c18645340e224530f47848460e0be54a7c313d17a6411f1dfdae04ee980d0c13
|
Provenance
The following attestation bundles were made for bakar-0.21.0-py3-none-any.whl:
Publisher:
publish.yml on jetm/bakar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bakar-0.21.0-py3-none-any.whl -
Subject digest:
a33ae0b0966ed911793d69607a002fe6e14c20a7c3c40245919dbd2b634b580e - Sigstore transparency entry: 2117560967
- Sigstore integration time:
-
Permalink:
jetm/bakar@ce097054f5b9844442db0390884db3dbeafcb2ab -
Branch / Tag:
refs/tags/v0.21.0 - Owner: https://github.com/jetm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce097054f5b9844442db0390884db3dbeafcb2ab -
Trigger Event:
push
-
Statement type: