1

I have a workspace with two projects as below

workspace/
├─ project-a/
│  ├─ src/
│  ├─ Cargo.toml
├─ project-b/
│  ├─ src/
│  ├─ Cargo.toml
├─ Cargo.toml

Project b depends on project a, it launches the binary file generated by project a with std::process::Command.

In /workspace/project-b/Cargo.toml, I set the dependencies as below.

[dependencies]
project-a = { path = "../project-a" }


[dev-dependencies]
project-a = { path = "../project-a" } 

And in /workspace/Cargo.toml, I set default entry to be project b.

[workspace]
members = [
    "project-a",
    "project-b",
]
default-members=["project-b"]

It works well if I run cargo run in `/workspace`` directory, project-b can successfully launches project-a as a child process.

But when I modify the code in /workspace/project-a``, cargo run in /workspace directory will not compile the updated code. Still I need enter /workspace/project-a/ directory and execute cargo run once more.

How can I make cargo run in `/workspace`` directory automatically compiles its dependencies?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.