Skip to content

Commit d4ac1a1

Browse files
committed
Revert single thread build order change
1 parent 5e78ad7 commit d4ac1a1

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/app/FakeLib/TargetHelper.fs

+10-7
Original file line numberDiff line numberDiff line change
@@ -654,14 +654,14 @@ let run targetName =
654654
tracefn "Building project with version: %s" buildVersion
655655
PrintDependencyGraph false targetName
656656

657-
// determine a parallel build order
658-
let order = determineBuildOrder targetName
659-
660657
let parallelJobs = environVarOrDefault "parallel-jobs" "1" |> int
661658

662659
// Figure out the order in in which targets can be run, and which can be run in parallel.
663660
if parallelJobs > 1 then
664661
tracefn "Running parallel build with %d workers" parallelJobs
662+
663+
// determine a parallel build order
664+
let order = determineBuildOrder targetName
665665
CurrentTargetOrder <- order |> List.map (fun targets -> targets |> Array.map (fun t -> t.Name) |> Array.toList)
666666

667667
PrintRunningOrder()
@@ -671,12 +671,15 @@ let run targetName =
671671
runTargetsParallel parallelJobs par
672672
else
673673

674-
let flatenedOrder = order |> List.map (fun targets -> targets |> Array.map (fun t -> t.Name) |> Array.toList) |> List.concat
675-
CurrentTargetOrder <- flatenedOrder |> Seq.map (fun t -> [t]) |> Seq.toList
676-
674+
// Note: we could use the ordering resulting from flattening the result of determineBuildOrder
675+
// for a single threaded build (thereby centralizing the algorithm for build order), but that
676+
// ordering is inconsistent with earlier versions of FAKE.
677+
let _, order = visitDependencies ignore targetName
678+
CurrentTargetOrder <- order |> Seq.map (fun t -> [t]) |> Seq.toList
679+
677680
PrintRunningOrder()
678681

679-
runTargets (flatenedOrder |> Seq.map getTarget |> Seq.toArray)
682+
runTargets (order |> Seq.map getTarget |> Seq.toArray)
680683

681684
finally
682685
if errors <> [] then

0 commit comments

Comments
 (0)