Skip to content

GH4066/4324: RunTargets opt-in unified dependency graph#4759

Open
devlead wants to merge 1 commit intocake-build:developfrom
devlead:feature/gh-4066/gh-4324
Open

GH4066/4324: RunTargets opt-in unified dependency graph#4759
devlead wants to merge 1 commit intocake-build:developfrom
devlead:feature/gh-4066/gh-4324

Conversation

@devlead
Copy link
Member

@devlead devlead commented Mar 8, 2026

  • Add opt-in unified dependency graph for multiple targets so shared dependencies run once; legacy per-target traversal kept as default, or controlled via or boolean config (Settings_UnifiedDependencyGraphForMultipleTargets)
  • Add ExecutionSettings.UnifiedDependencyGraphForMultipleTargets, enable via UseUnifiedDependencyGraphForMultipleTargets()
  • Add CakeGraph.Traverse(IEnumerable) and TopologicalSort for merged dependency order
  • Add ICakeConfiguration.GetBoolValue() to reduce code duplication and use it for boolean config in BuildScriptHost, ProcessRunner, ScriptProcessor, AssemblyVerifier
  • Add unit tests for unified/legacy RunTargets and SetupContext.TasksToExecute; add CakeGraph multi-target traverse tests
  • Add integration tests (targets.cake) for unified vs legacy behavior, using --expected and env; add shared dependency F for A,B,C
  • fixes SetupContext.TasksToExecute only lists tasks related to first target when calling RunTargets #4066
  • fixes When running multiple targets, common dependent tasks are executed twice #4324

Before change

────────────────────────────────────────────────────────────────────────────────────────────────────
 Setup
────────────────────────────────────────────────────────────────────────────────────────────────────
Tasks to run: F, A

.....

  Task                            Duration                                   Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Setup                           00:00:00.0649513                           Succeeded
  F                               00:00:00.0075351                           Succeeded
  A                               00:00:00.0008039                           Succeeded
  F                               00:00:00.0005486                           Succeeded
  B                               00:00:00.0007980                           Succeeded
  F                               00:00:00.0004626                           Succeeded
  C                               00:00:00.0004866                           Succeeded
  Teardown                        00:00:00.0026602                           Succeeded
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Total:                          00:00:00.0782463

After

────────────────────────────────────────────────────────────────────────────────────────────────────
 Setup
────────────────────────────────────────────────────────────────────────────────────────────────────
Tasks to run: F, A, B, C

.....


  Task                            Duration                                   Status
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Setup                           00:00:00.0764160                           Succeeded
  F                               00:00:00.0157535                           Succeeded
  A                               00:00:00.0015117                           Succeeded
  B                               00:00:00.0005766                           Succeeded
  C                               00:00:00.0005362                           Succeeded
  Teardown                        00:00:00.0017801                           Succeeded
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

…endency graph

- Add opt-in unified dependency graph for multiple targets so shared dependencies run once; legacy per-target traversal kept as default, or controlled via or boolean config (`Settings_UnifiedDependencyGraphForMultipleTargets`)
- Add ExecutionSettings.UnifiedDependencyGraphForMultipleTargets, enable via UseUnifiedDependencyGraphForMultipleTargets()
- Add CakeGraph.Traverse(IEnumerable<string>) and TopologicalSort for merged dependency order
- Add ICakeConfiguration.GetBoolValue() to reduce code duplication and use it for boolean config in BuildScriptHost, ProcessRunner, ScriptProcessor, AssemblyVerifier
- Add unit tests for unified/legacy RunTargets and SetupContext.TasksToExecute; add CakeGraph multi-target traverse tests
- Add integration tests (targets.cake) for unified vs legacy behavior, using --expected and env; add shared dependency F for A,B,C
- fixes cake-build#4066
- fixes cake-build#4324
@devlead devlead requested a review from a team March 8, 2026 20:22
@devlead devlead changed the title (GH-4066) (GH-4324) RunTargets opt-in unified dependency graph GH4066/4324: RunTargets opt-in unified dependency graph Mar 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant