-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support inheriting jobserver when using cargo run
#12597
Comments
From what I understood in the PR, this does not seem to be what the PR does. The PR only makes it so that if cargo uses an external jobserver, that one is now propagated to So maybe the issue should be reopened? |
From reading this issue title, and the context of #10511 (comment), I made an assumption that miri (or some other tool alike) would like to inherit existing jobserver from the environment, exactly as how Cargo treats external commands today since #10511. #12776 made it so. It's my fault that didn't request more details from the issue author. The line between compilation and execution is not always clear in cargo, like That said, if this doesn't resolve the miri issue, I am sorry 😞. I would suggest opening another issue to clarify the workflow and expectation, and we could consider a piped-based jobserver by default (see PR description in #12776). |
Well, it's less of an issue for Miri than a peculiar interaction of how cargo-miri works (a big pile of hacks to get cargo to do what we need it to do) and how cargo works, that was noticed as part of rust-lang/rust#113730. I'm not aware of this causing actual problems for Miri users. #12776 doesn't change that interaction. |
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: