Skip to content

Navigation Menu

Sign in
Sign up

fix(templates): import-std-safe I/O; CI compile-checks every template; 0.2.8 - #18

Merged
Sunrisepeak merged 2 commits into
main from
fix/template-import-std
Jun 10, 2026
Merged

fix(templates): import-std-safe I/O; CI compile-checks every template; 0.2.8 #18
Sunrisepeak merged 2 commits into
main from
fix/template-import-std

Conversation

@Sunrisepeak

@Sunrisepeak Sunrisepeak commented Jun 10, 2026

Copy link
Copy Markdown
Member

Building a project generated from llmapi@0.2.7:openai fails:

error: 'stderr' was not declared in this scope

stderr/stdout/fflush come from <cstdio> and are not reachable under pure import std. All four templates now use std::cerr / std::cout stream overloads (and the chat template flushes its prompts).

Regression gate: tools/template_smoke.sh renders each template exactly like mcpp new ({{project.name}}/{{self.name}}/{{self.version}}), swaps the version dep for a path dep on the checkout, and mcpp builds it — wired into CI after the library build. All 4 templates compile locally (gcc 16.1.0, mcpp 0.0.53).

Version → 0.2.8; 0.2.7 will not be indexed (broken default template). mcpp-index PR will point at 0.2.8.

std::println(stderr, ...) fails under `import std` (stderr/stdout/fflush
are <cstdio> macros/functions not reachable without the header) — caught
when building a project generated from llmapi@0.2.7:openai. Use
std::cerr/std::cout stream overloads instead, and flush the chat
prompts explicitly.
tools/template_smoke.sh renders every template the way `mcpp new` does
and builds it against this checkout (path dependency), so template code
is compile-gated in CI before any release ships it. Version → 0.2.8
(0.2.7's default template is broken and will not be indexed).
mktemp dirs live outside the repo, where the `mcpp` shim has no
workspace .xlings.json to resolve — CI failed with "'mcpp' is not
installed". Render/build under target/template-smoke instead.
Sunrisepeak merged commit a48d0cd into main Jun 10, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /