Add --strict convention checker for dual-mode composability#19
Merged
Add --strict convention checker for dual-mode composability#19
Conversation
Phase 1: 2 error checks (S/B anchor ?=) + 2 warning checks (toolchain ?=, Tupfile.ini). Pure stateless check functions, callback integration during evaluation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
6-task plan: check functions, unit tests, on_statement callback, cmd_parse wiring, E2E test, bootstrap + docs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the strict convention checking system (Tasks 1-4): - Diagnostic type and check_assignment/check_component_dirs functions that verify dual-mode composability conventions in Tuprules.tup files - Unit tests for all check functions (6 test cases, 20 assertions) - on_statement callback on EvalContext, fired in builder.cpp's process_statement for each AST statement during evaluation - --strict flag wired into putup parse via Options, BuildContextOptions, and the statement callback in cmd_parse.cpp Checks: E1/E2 (S/B must use ?= in components), W1 (toolchain vars should use ?=), W2 (component dirs should have Tupfile.ini). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds strict_check fixture with a root Tuprules.tup (exempt) and a component libfoo/Tuprules.tup that uses hard assignment for S and CC. The E2E test verifies parse --strict detects the violations and fails, while parse without --strict succeeds normally. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds strict_checks.o compile/link/ar entries to all three bootstrap scripts (linux, macos, mingw). Documents --strict in the parse subcommand section of docs/reference.md. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
libc++ emits __libcpp_verbose_abort for std::variant valueless state. Guard with _LIBCPP_VERSION so it only compiles on libc++ platforms. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
_LIBCPP_VERSION is only defined after including a libc++ header. Use __APPLE__ as the platform guard instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The symbol is mangled as std::__1::__libcpp_verbose_abort, not std::__libcpp_verbose_abort. Define in the matching inline namespace. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
putup parse --strictthat verifies Tupfiles follow conventions guaranteeing a project can be built both standalone and as a component of a larger projecton_statementcallback?=) + 2 warning checks (toolchain?=, missingTupfile.ini)Checks
Smust use?=in component Tuprules.tup=overwrites parent's root anchorBmust use?=in component Tuprules.tup=overwrites parent's build anchor?==overrides parent's toolchain choiceTupfile.iniTest plan
putup parse --stricton putup itself (passes — root exempt)🤖 Generated with Claude Code