Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert single thread build order change #1516

Merged
merged 1 commit into from
Apr 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions src/app/FakeLib/TargetHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -654,14 +654,14 @@ let run targetName =
tracefn "Building project with version: %s" buildVersion
PrintDependencyGraph false targetName

// determine a parallel build order
let order = determineBuildOrder targetName

let parallelJobs = environVarOrDefault "parallel-jobs" "1" |> int

// Figure out the order in in which targets can be run, and which can be run in parallel.
if parallelJobs > 1 then
tracefn "Running parallel build with %d workers" parallelJobs

// determine a parallel build order
let order = determineBuildOrder targetName
CurrentTargetOrder <- order |> List.map (fun targets -> targets |> Array.map (fun t -> t.Name) |> Array.toList)

PrintRunningOrder()
Expand All @@ -671,12 +671,15 @@ let run targetName =
runTargetsParallel parallelJobs par
else

let flatenedOrder = order |> List.map (fun targets -> targets |> Array.map (fun t -> t.Name) |> Array.toList) |> List.concat
CurrentTargetOrder <- flatenedOrder |> Seq.map (fun t -> [t]) |> Seq.toList

// Note: we could use the ordering resulting from flattening the result of determineBuildOrder
// for a single threaded build (thereby centralizing the algorithm for build order), but that
// ordering is inconsistent with earlier versions of FAKE.
let _, order = visitDependencies ignore targetName
CurrentTargetOrder <- order |> Seq.map (fun t -> [t]) |> Seq.toList

PrintRunningOrder()

runTargets (flatenedOrder |> Seq.map getTarget |> Seq.toArray)
runTargets (order |> Seq.map getTarget |> Seq.toArray)

finally
if errors <> [] then
Expand Down