Copy subdir tup.config files during configure for scoped configs#10
Merged
Copy subdir tup.config files during configure for scoped configs#10
Conversation
Configure now runs a unified three-step flow: 1. Install root config (if --config specified) 2. Copy subdir tup.config files from config root to build tree 3. Run config-generating rules (unchanged) Step 2 enables per-component scoped configs: each subdirectory ships a tup.config alongside its Tupfile. At configure time, these are installed into the build tree where scoped config merging picks them up during the build. For in-tree builds (config_root == output_root), step 2 is a no-op. Also removes the false-positive variant skip from discover_tupfile_dirs that treated any directory with both Tupfile and tup.config as a variant. Variant directories don't contain Tupfiles in normal usage. Co-Authored-By: Claude Opus 4.6 <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 configure: automatically copy subdirtup.configfiles from the config root to the build tree for out-of-tree buildsgmp/tup.config,mpfr/tup.config) to work seamlessly with out-of-tree variant buildstup.configThree-step configure flow
Step 2 walks the config root, finds subdir
tup.configfiles, and copies them to corresponding locations in the build tree. This handles the gap where--configonly installed the root config but subdir scoped configs had no mechanism to reach the build tree.Changes
src/cli/cmd_configure.cpp— Newinstall_source_configshelper; refactoredconfigure_single_variantinto unified three-step flow with singlediscover_layoutcallsrc/cli/context.cpp— Removed variant-directory skip fromdiscover_tupfile_dirs(directories with both Tupfile and tup.config are valid for scoped configs)test/unit/test_e2e.cpp— 4 new E2E scenarios covering subdir config copy, scoped merge integration, in-tree no-op, and mixed static + auto-gen configsdocs/reference.md— Updated §3.5 configure flow documentation and CLI option descriptionsTest plan
🤖 Generated with Claude Code