Skip to content

fix(new): write every source the generated build.yaml declares - #168

Merged
srpatcha merged 2 commits into
masterfrom
fix/new-scaffold-test-source
Oct 1, 2026
Merged

srpatcha merged 2 commits into
masterfrom
fix/new-scaffold-test-source

Conversation

@srpatcha

@srpatcha srpatcha commented Oct 1, 2026

Copy link
Copy Markdown
Member

Fixes #167

Summary

  • ebuild new now writes tests/test_main.c from each template's test_main.c.template, and creates parent directories as needed.
  • templates/safety-critical/build.yaml.template: the test target now sits under targets:. Before, it was under firmware:, which is invalid YAML.
  • New tests/unit/test_new_scaffold.py, parametrized over all 6 templates. It checks that every sources: entry in the generated build.yaml exists and that no {{...}} placeholders are left in the test source.

Evidence (Ubuntu 20.04 WSL2, Python 3.12.14)

Scope / not in this PR

After this fix, ebuild build for --board stm32f4 gets past ninja's missing-input error and reaches the link step. The link step still fails on a host build: eos_port_enter_critical has no host port, and eos master does not compile (eos#147, fixed by eos#144). Those are separate issues.

Each template's build.yaml declares a test target built from
tests/test_main.c, and each template ships test_main.c.template, but
"ebuild new" never copied it. The first "ebuild build" of a new project
stopped in ninja with "missing and no known rule to make it".

The safety-critical template had its test target under the firmware:
mapping, which made it invalid YAML. It now sits in targets:.

test_new_scaffold.py creates a project from all six templates and checks
that every source the build.yaml declares exists.

Fixes #167
@srpatcha
srpatcha merged commit 5d67b00 into master Oct 1, 2026
32 checks passed
@srpatcha
srpatcha deleted the fix/new-scaffold-test-source branch October 1, 2026 06:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ebuild new: generated projects fail ebuild build (tests/test_main.c never written; safety-critical build.yaml is invalid YAML)

1 participant