Skip to content

Getting started

YoCache has two halves that you set up once:

  • the server — a single static binary that stores and serves your shared sstate cache and source downloads;
  • the meta-yocache layer — enables your bitbake builds to use the cache and upload new artifacts to it automatically.

Download a pre-built binary for your platform from the Releases page and run it:

Terminal window
./yocache

By default it listens on port 6768 and stores artifacts under var/ in the current directory — see Server configuration for the flags that change this.

Prefer a container? See Running with Docker for docker run, podman run, and Docker Compose examples.

Quick check once it’s running:

Terminal window
curl http://yourcache.local:6768/healthz

Add YoCache to your kasfile’s repos: section:

repos:
yocache:
url: https://github.com/bmoczulski/yocache.git
refspec: main
layers:
meta-yocache:
local_conf_header:
yocache: |
YOCACHE_URL = "http://yourcache.local:6768"
# OPTIONAL: use YoCache as the hash-equivalence server — auto-picks the
# ws:// endpoint on Yocto >= Scarthgap, or the raw-TCP listener on older
# releases (whose bitbake has no ws:// client), same line either way
# BB_HASHSERVE = "${@'ws://yourcache.local:6768/hashequiv' if hasattr(__import__('hashserv'), 'ADDR_TYPE_WS') else 'yourcache.local:6767'}"
# The juice!
INHERIT += "yocache"
Terminal window
git clone https://github.com/bmoczulski/yocache.git

In bblayers.conf:

BBLAYERS += "/path/to/yocache/meta-yocache"

Then add the same configuration lines as in the kas snippet above to your local.conf or site.conf.

That’s it — run your bitbake build as usual. The first build populates the cache as it goes; every subsequent build, on any machine pointed at the same server, fetches what’s already there and uploads whatever it had to build or download fresh.

If the cache doesn’t have something, nothing changes for you: bitbake simply falls back to the upstream sources and builds locally, exactly as it would without YoCache.