Description
Problem
Sometimes commands run through cargo run
actually perform build actions for a larger build system.
For example in #10511 (comment) the scenario is running something like cargo run -p binding_generator
which generates headers to be used during the build later.
And in rust-lang/rust#113730 (comment) cargo-miri is set as target.runner
and runs as a part of cargo run
(and calls build tools like cargo and rustc recursively).
Proposed Solution
In all cases like these cargo shouldn't close its jobserver file descriptors (or other handles), but pass them to the tool being run instead.
I think doing this under an options would be fine.
The default for such option can be decided upon later (probably kept being false, which is equivalent to the current behavior).
Notes
No response