A 5-minute, self-contained walkthrough that builds and runs a tiny "thermostat"-style
C program end-to-end via ebuild build.
- Python 3.8+
- A system C compiler (
gccorclang) - The
ninjapip package — a systemninjabinary alone is not enough, sinceebuildinvokespython -m ninjainternally.
python3 -m venv .venv
source .venv/bin/activatepip install -e '.[dev]' # falls back to: pip install -e .If this fails with an error like:
ERROR: File "setup.py" or "setup.cfg" not found. Directory cannot be installed
in editable mode: ...
(A "pyproject.toml" file was found, but editable mode currently requires a
setuptools-based build.)
your virtualenv's pip is too old to support pyproject.toml-only editable
installs (PEP 660). Upgrade it first, then retry:
python3 -m pip install --upgrade pip
pip install -e '.[dev]'pytestYou should see all tests pass.
cd examples/hello_world
cat build.yaml # see how the project is described
ebuild buildExpected output ends with:
[info] Auto-detected backend: ninja
Resolving dependency graph...
Resolving toolchain...
Generating build.ninja in _build/...
[ok] Generated _build/build.ninja
[ok] Generated _build/compile_commands.json
Invoking ninja...
[ok] Build completed successfully.
Run the built binary:
./_build/helloHello from EoS Build System!
Using a virtualenv (step 1) avoids Python's PEP 668 "externally managed environment" errors entirely, since you're not installing into the system Python. If you still hit editable-install errors inside the venv, see the pip-upgrade note in step 2 above — that resolves the case actually encountered while writing this guide.
Not yet verified. This guide's build step was tested with a system gcc
available. Behavior when no system compiler is present (e.g. cross-compile-only
environments) has not been confirmed and needs a maintainer with the
appropriate toolchain setup to document. If you hit this, please open an issue
with the exact error output.