Fix include_rules to include all Tuprules.tup root-to-leaf#5
Merged
Conversation
include_rules now includes every Tuprules.tup from the project root down to the current directory in root-first order, matching tup semantics. Previously only the nearest file was found, preventing per-library Tuprules.tup files from layering on top of a root file. Refactors builder.cpp: find_tuprules_file -> find_tuprules_files (returns vector), extracts include_single_file helper from process_include, loops over all found files for the is_rules path. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Describes the pattern for composable multi-library builds: root Tuprules.tup sets layout, per-library Tuprules.tup provides ?= defaults, prefixed DIR vars for cross-references, unprefixed CFLAGS/\!cc within each subtree. Also clarifies include_rules semantics (all Tuprules.tup from root to current dir, root-first). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6aa2104 to
2a8d3e6
Compare
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
include_rulesnow includes everyTuprules.tupfrom the project root down to the current directory (root-first order), matching tup semantics. Previously only the nearest file was found.find_tuprules_file→find_tuprules_files(returns vector), extractsinclude_single_filehelper fromprocess_includeTuprules.tupwith?=defaults layered on top of a rootTuprules.tupTest plan
include_rules_nested: root setsCC=gcc, sub setsCC?=clang— verifies root wins, sub contributes its own varsmake formatcleanmake tidy— no new warnings🤖 Generated with Claude Code