Skip to content

fix: support -a (all-deps) for fresh scoped builds#13

Merged
typeless merged 1 commit intomainfrom
fix/scoped-alldeps-fresh-build
Mar 11, 2026
Merged

fix: support -a (all-deps) for fresh scoped builds#13
typeless merged 1 commit intomainfrom
fix/scoped-alldeps-fresh-build

Conversation

@typeless
Copy link
Owner

Summary

  • Fix -a flag for fresh builds with cross-directory deps where the producer outputs to a directory with no Tupfile (ghost nodes left unresolved)
  • Add ScopeWithUpstream build mode so -a builds scope + transitive upstream only, not the entire project
  • Add hint to ghost error messages suggesting -a
  • Refactor collect_upstream_files and collect_scope_with_upstream_commands to share walk_upstream_from_scope traversal

Test plan

  • 4 new E2E tests: fresh -a succeeds, without -a fails (ghost), -a skips unrelated dirs, incremental -a detects upstream changes
  • All 2640 assertions in 341 test cases pass
  • clang-tidy clean on changed files
  • clang-format applied

🤖 Generated with Claude Code

When running `putup consumer/ -a` on a fresh build (no index),
parse_scopes restricted parsing to only the target directory. If a
producer Tupfile output to a different directory (e.g., shared/),
the demand-driven parser couldn't trace the dependency, leaving
ghost nodes unresolved.

Three coordinated changes:

1. Parse all Tupfiles when -a is set, so ghost nodes get resolved
   by their producer Tupfiles regardless of scope.

2. Add ScopeWithUpstream build mode — limits execution to scope +
   transitive upstream producers via build_subset(), preventing a
   full project build when only scope deps are needed.

3. Add hint to ghost error messages suggesting -a as a remedy.

Also refactors collect_upstream_files and the new
collect_scope_with_upstream_commands to share a single
walk_upstream_from_scope traversal, eliminating duplication.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@typeless typeless merged commit a7afa54 into main Mar 11, 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