Skip to content

Remove install_source_configs — Tupfile-driven config#11

Merged
typeless merged 2 commits intomainfrom
remove-install-source-configs
Mar 9, 2026
Merged

Remove install_source_configs — Tupfile-driven config#11
typeless merged 2 commits intomainfrom
remove-install-source-configs

Conversation

@typeless
Copy link
Owner

@typeless typeless commented Mar 9, 2026

Summary

  • Remove install_source_configs() from the configure pass (~62 lines of C++)
  • Config installation is now 100% Tupfile-driven via copy rules: : defaults.config |> cp %f %o |> tup.config
  • Move load_ignore_list() into anonymous namespace (no external callers remain)
  • Rename BSP tup.configdefaults.config in 11 directories, add copy rules to each Tupfile
  • Update docs, Makefile.pup, and E2E tests to match

Motivation

install_source_configs() hardcoded tup.config as the filename to scan for in the source tree, creating ambiguity between variant build dirs and source config dirs. The configure pass already discovers and executes any rule outputting tup.config — a static config copy is just a trivial config-generating rule.

Test plan

  • make — putup builds itself
  • make test — all 337 tests pass (2626 assertions)
  • ./build/test/unit/putup_test '[configure]' — all 19 configure tests pass
  • New binary produces no "source config(s)" output
  • Manual verification: copy rules produce correct tup.config in build tree

🤖 Generated with Claude Code

@typeless typeless force-pushed the remove-install-source-configs branch from 3065890 to 411d6c9 Compare March 9, 2026 02:12
Config installation was hardcoded in C++ (scanning source tree for
tup.config files and copying them to the build tree). This created
ambiguity between variant build dirs and source config dirs, and
encoded policy that belongs in the Tupfile.

The configure pass already discovers and executes any rule outputting
tup.config. A static config copy is just a trivial config-generating
rule: `: defaults.config |> cp %f %o |> tup.config`.

- Delete install_source_configs() and its call site (~62 lines)
- Move load_ignore_list() into anonymous namespace (no external callers)
- Rename BSP tup.config → defaults.config, add copy rules to Tupfiles
- Rewrite 3 E2E tests to use copy rules, delete 2 obsolete tests
- Update docs to describe the copy-rule pattern

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@typeless typeless force-pushed the remove-install-source-configs branch from 411d6c9 to 27c063e Compare March 9, 2026 02:52
Commands are stored as instruction patterns with NodeId operands.
At execution time, expand_instruction() re-resolves NodeIds to paths
relative to source CWD. In 3-tree builds (-C/-S/-B), overlay files
like defaults.config live in config_root, not source_root. Without
config_root awareness, expand_instruction produced bare filenames
instead of cross-tree relative paths, causing cp to fail.

Plumb config_root through SchedulerOptions → expand_instruction so
the path resolver falls back to config_root when a file doesn't
exist in source_root.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@typeless typeless merged commit 670d2ac into main Mar 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant