From 14f86a2c478b2289a39c9c4380beff827662bff6 Mon Sep 17 00:00:00 2001 From: Pierre Chalamet Date: Sat, 14 Jun 2025 18:40:29 +0200 Subject: [PATCH] if task is older than children then rebuild --- src/Terrabuild/Core/Build.fs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Terrabuild/Core/Build.fs b/src/Terrabuild/Core/Build.fs index db3cb5db..b90a8cfd 100644 --- a/src/Terrabuild/Core/Build.fs +++ b/src/Terrabuild/Core/Build.fs @@ -261,10 +261,6 @@ let run (options: ConfigOptions.Options) (cache: Cache.ICache) (api: Contracts.I Log.Debug("{NodeId} must rebuild because force requested", node.Id) TaskRequest.Build, buildNode() - elif maxCompletionChildren = DateTime.MaxValue then - Log.Debug("{NodeId} must rebuild because child is rebuilding", node.Id) - TaskRequest.Build, buildNode() - elif node.Cache <> Terrabuild.Extensibility.Cacheability.Never then let cacheEntryId = GraphDef.buildCacheKey node match cache.TryGetSummaryOnly allowRemoteCache cacheEntryId with @@ -276,6 +272,11 @@ let run (options: ConfigOptions.Options) (cache: Cache.ICache) (api: Contracts.I Log.Debug("{NodeId} must rebuild because node is failed and retry requested", node.Id) TaskRequest.Build, buildNode() + // task is older than children + elif summary.EndedAt <= maxCompletionChildren then + Log.Debug("{NodeId} must rebuild because child is rebuilding", node.Id) + TaskRequest.Build, buildNode() + // task is cached else Log.Debug("{NodeId} is marked as used", node.Id)