fix(templates): import-std-safe I/O; CI compile-checks every template; 0.2.8#18
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Building a project generated from
llmapi@0.2.7:openaifails:stderr/stdout/fflushcome from<cstdio>and are not reachable under pureimport std. All four templates now usestd::cerr/std::coutstream overloads (and the chat template flushes its prompts).Regression gate:
tools/template_smoke.shrenders each template exactly likemcpp new({{project.name}}/{{self.name}}/{{self.version}}), swaps the version dep for a path dep on the checkout, andmcpp 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.