Support inheriting jobserver when using cargo run
#12597
Labels
A-jobserver
Area: jobserver, concurrency, parallelism
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-run
S-needs-team-input
Status: Needs input from team on whether/how to proceed.
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 ofcargo 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
The text was updated successfully, but these errors were encountered: