Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cargo-run): inherit jobserver from env
External subcommands are already able to inherit the jobserver from env since #10511. However, users reported that they've expected `cargo run` to behave the same as external subcommands. A popular example "cargo-xtask" pattern is used as scripting to run arbitrary tasks. Users may want to invoke `cargo run` from Make and expect some parallelism. This PR tries to provide such an ability. Note that this PR doesn't create any jobserver client if there is no existing jobserver from the environment. Nor `-j`/`--jobs` would create a new client. Reasons for this decision: * There might be crates don't want the jobserver to pollute their file descriptors, although they might be rare * Creating a jobsever driver with the new FIFO named pipe style is not yet supported as of `[email protected]`. Once we can create a named pipe-based jobserver, it will be less risky and inheritance by default can be implemented.
- Loading branch information