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

Targets defined as parallel run sequentially when they have a common dependency #2691

Open
koenmetsu opened this issue Jul 30, 2022 · 0 comments

Comments

@koenmetsu
Copy link
Contributor

Hi

I'm trying to make 3 targets run in parallel, with a common first step. As soon as I add the common step, the targets don't seem to run in parallel anymore.

I added a small example script, which I run with dotnet fake run build-parallel.fsx --parallel 8.

Is this a known issue, or am I missing something here?

#r "paket:
version 7.0.2
framework: net6.0
source https://api.nuget.org/v3/index.json"

open System.Threading
open System.Threading.Tasks
open Fake.Core
open Fake.Core.TargetOperators


Target.create "Default" ignore

Target.create "PreTasks" (fun _ ->
    Thread.Sleep(5000)
    ()
)
Target.create "TaskA1" (fun _ ->
    Thread.Sleep(5000)
    ()
)
Target.create "TaskA2" (fun _ ->
    Thread.Sleep(5000)
    ()
)
Target.create "TaskA3" (fun _ ->
    Thread.Sleep(5000)
    ()
)

// ==> This runs in parallel
"TaskA1"
  ==> "Default"

"TaskA2"
  ==> "Default"

"TaskA3"
  ==> "Default"

//// ==> This runs in parallel as well
//"TaskA1" <=> "TaskA2" <=> "TaskA3"
//  ==> "Default"

//// ==> This makes it run sequentially
//"PreTasks"
//  ==> "TaskA1"
//  ==> "Default"
//
//
//"PreTasks"
//  ==> "TaskA2"
//  ==> "Default"
//
//"PreTasks"
//  ==> "TaskA3"
//  ==> "Default"
//

//// ==> This also runs sequentially
//"PreTasks"
//  ==> "TaskA1" <=> "TaskA2" <=> "TaskA3"
//  ==> "Default"

Target.runOrDefault "Default"
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

No branches or pull requests

1 participant