Skip to main content

bakar

CI PyPI Python License Coverage

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.

bakar build UI

Features

  • Multi-BSP, out of the box - NXP i.MX (repo XML), 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-container build 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.
  • Remote build dispatch - bakar build --on <host> runs a build on an idle remote node in one command: it preflights the ssh host, rsyncs the working tree (uncommitted edits included) to the identical path with a cache/artifact exclude set, gates the destructive --delete mirror behind a dry-run preview and confirmation (--yes bypasses it), execs bakar build remotely fish-safely over ssh <host> bash -s with sccache-dist off by default (--sccache-dist opts back in), streams the build output live, and surfaces the remote run-id plus a copy-pasteable ssh <host> bakar triage <run-id> line. The remote exit code propagates. See docs/build.md.
  • Host execution by default - bakar runs kas directly on the host, so it works out of the box without Docker. The container path is an explicit opt-in: pass the global --container flag, set BAKAR_CONTAINER=1, or set a [build] container = true toggle in the workspace .bakar.toml or user config.toml. Configuring a kas_container_image does not select the container on its own - it only names the image used once the container path is opted into. The older --host flag, BAKAR_HOST_MODE, and [build] host_mode are retained as no-op back-compat aliases (host is already the default) so existing configs keep working. Precedence: --container > --host > BAKAR_CONTAINER > workspace container > user container > host.
  • Graceful build stop - bakar stop halts a running build by routing SIGINT to bitbake's own shutdown (then escalating to SIGTERM/SIGKILL, or --force to skip the grace period). Container builds are signalled inside the container, targeted by a per-run bakar.run_id label; host builds by their recorded process group - so other workspaces and the persistent hashserv daemon are never touched. The build stays resumable with no manual cleansstate, and bakar build warns when a prior build was killed uncleanly. See docs/stop.md.
  • Session-survival - bakar build (and the live bakar bitbake path) run kas/kas-container inside a transient systemd-run --user --scope by default, so a closed terminal, SSH disconnect, or reaped background shell no longer kills the build. By default the scope also sets a positive oom_score_adjust (the build is the OOM victim under global pressure); it does not impose memory ceilings or CPU/IO weights, so memory and scheduling behave exactly as they did before the scope. CPUWeight/IOWeight ([build] scope_cpu_weight/scope_io_weight) are opt-in and off by default: setting them realizes the cpu/io cgroup controllers session-wide, and under a heavy-I/O recipe the io controller's throttling can hang the whole session (observed with chromium). Hard cgroup memory caps (MemoryHigh/MemoryMax, plus MemorySwapMax=0) are opt-in under [build] scope_memory_* for dedicated build hosts - on a workstation with a large zram swap they swap-thrash the desktop and can soft-lock the box, so they default off. Parallelism (BB_NUMBER_THREADS/PARALLEL_MAKE) is never touched. Opt out of scoping entirely with --no-scope. See docs/build.md, docs/config-reference.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-report flag (or build.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 via host.* 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 ✗ FAILED alert 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 triage reads that artifact to name the failing recipe/task and print the recorded logfile excerpt (with a kas.log fallback for older runs), and selects the right run dir under a multi-release preset fan-out via --run/--preset/--release. bakar monitor watches 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. bakar insights renders per-recipe/per-task analytics for a completed run - sstate hit/miss breakdown, per-task timing with top-N slowest, PSI CPU/IO/memory pressure share, and disk-usage growth - defaulting to the latest run under the workspace, same as report. See docs/triage.md, docs/report.md, docs/insights.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 premirror git2_*.tar.gz tarball 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 with bakar clean-recipe, rebuild one from scratch (cleansstate then build) with bakar rebuild, and analyze a recipe's dependency graph (blast radius, longest chain, cycles) with bakar 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.toml and invoke it with bakar build --preset <name>; multi-release presets fan out to N sequential builds with a summary table. Manage presets with bakar 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 > user config.toml > BSP default, plus a settings CRUD 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 - setup runs once per machine before your first build: it profiles the host, remediates the host-environment doctor checks (sysctl drop-in, docker daemon.json ulimits/storage-driver, kas install, git identity, cache dirs), applies privileged steps through a single confirmed sudo of an auditable script, and persists the applied values to the global [host] config. When host mode is the effective default, it also installs the buildtools-extended toolchain (when missing) and persists its path as [build] buildtools_dir, so bakar --host build is turnkey; container-only setups skip this. --dry-run shows the plan and script without touching anything. See docs/setup.md.
  • Workspace scaffolding - init wizard (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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bakar-0.24.0.tar.gz (426.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bakar-0.24.0-py3-none-any.whl (511.0 kB view details)

Uploaded Python 3

File details

Details for the file bakar-0.24.0.tar.gz.

File metadata

  • Download URL: bakar-0.24.0.tar.gz
  • Upload date:
  • Size: 426.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bakar-0.24.0.tar.gz
Algorithm Hash digest
SHA256 5239ae663d0854d076d6e24a3a6127fa2b9cb00406d695b5b0ea94af523715f8
MD5 1bde8ff0b2ea662d8320841a21c40aa7
BLAKE2b-256 b1a53efc4a32f34c4b39877133a7262ec1f8bf2883d993bb79805878be0d7ad9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bakar-0.24.0.tar.gz:

Publisher: publish.yml on jetm/bakar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bakar-0.24.0-py3-none-any.whl.

File metadata

  • Download URL: bakar-0.24.0-py3-none-any.whl
  • Upload date:
  • Size: 511.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for bakar-0.24.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1986a06214650b93680714227e797d18cccd9d1a6ebf9b91f374ddd2e1ce763a
MD5 8292505419187b1554adb0aeebf86138
BLAKE2b-256 061a9f32ca53abb6203685de4df2086155189852b10e15c186961d3348503f67

See more details on using hashes here.

Provenance

The following attestation bundles were made for bakar-0.24.0-py3-none-any.whl:

Publisher: publish.yml on jetm/bakar

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.31.1

2 files

0.31.0

2 files

0.30.0

2 files

0.29.3

2 files

0.29.2

2 files

0.29.1

2 files

0.29.0

2 files

0.28.0

2 files

0.27.1

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

This release

0.24.0 This release

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.1

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page