Open sffc opened 3 years ago
@sffc there is a workaround for the issue you stated, but i agree that this is a limitation and a complex one to resolve. it would also break things like task specific env vars i have, but i guess thats not an issue. I'll see if i can get to it at some point, but probably not in the near future due to the complexity and my limited free time.
I'm trying to have several microservices in a workspace running at the same time with a cargo run
for each.
I've tried the following:
[tasks.dev-service1]
env = { CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = ["service1"] }
run_task = { name = "dev-service1", fork = true }
[tasks.dev-service2]
env = { CARGO_MAKE_WORKSPACE_INCLUDE_MEMBERS = ["service2"] }
run_task = { name = "dev-service2", fork = true }
[tasks.watch-flow]
workspace = false
clear = true
run_task = { name = [
"dev-service1",
"dev-service2"
], parallel = true }
But this causes each task to run twice for each service. All servers crash because the address and port has already been taken by the previous run in each
@sagiegurari what is the workaround you've mentioned?
you should not run dev-service1, instead you should run a flow of 2 tasks
But I thought the watch option already killed previous task https://github.com/sagiegurari/cargo-make#watch? I'm a bit confused
no. i don't think i wrote such a comment in the documentation either. the watch flag on a task is very simple. something changes -> task is called. a simple example would be, you change a file -> cargo build is called. for server like processes, i think you need to model it based on that.
Feature Description
If my task has multiple dependencies, and those dependencies are independent from one another, cargo make should be able to run them in parallel.
Describe The Solution You'd Like
If I write the following, I expect each of the subtasks to be run in parallel, or at least be allowed to be run in parallel if I pass a
-j
option to cargo make.I can use
parallel = true
inrun_task
, like this:However, this causes duplicate work. Each of the subtasks depends on a task that runs "cargo build", so "cargo build" gets executed four times.