Skip to content

Support inheriting jobserver when using cargo run #12597

Closed
@petrochenkov

Description

@petrochenkov

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-jobserverArea: jobserver, concurrency, parallelismC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-runS-needs-team-inputStatus: Needs input from team on whether/how to proceed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions