-
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
Tracking issue for --keep-going
#10496
Comments
Just a small question, I was wondering if there might be confusion on the difference between |
@ehuss, at least for Buck, Instead of a |
For my own use case of If some current users of |
I've just released version 1.0.60 of the Before:$ time cargo test --test compiletest
real 0m21.442s
user 0m15.288s
sys 0m6.317s After:$ time cargo test --test compiletest
real 0m1.290s
user 0m20.761s
sys 0m6.962s |
9176: CARGO: Use `--keep-going` when building and evaluating buildscripts r=undin a=vlad20012 Since Rust 1.62 Cargo has an unstable option [`--keep-going`](rust-lang/cargo#10496). By default, cargo stops the build immediately if one rustc instance or buildscript instance fails, even if it would be possible to compile other crates that does not depends on the error crate. The option `--keep-going` instructs cargo to continue building even if the compilation of some crate fails or the evaluation of some buildscript fails. This behavior is exactly what we need in the case of buildscript evaluation - as an IDE, we need to compile&evaluate as much as possible. Co-authored-by: vlad20012 <[email protected]>
At $work we intend to use EDIT: what is missing to move toward stabilization ? |
As it seems not pretty controversial, what we need is more feedback from users, so that we will be confident in this being useful in practice. Personally I'd like to see something like
Besides, there are some tiny concerns but not blockers:
|
I use For example, in my codebase, we deny My understanding of |
The Cargo team briefly discussed moving this towards stabilization. One thing some of us were still uncertain about is the behavior of That change would make the use case of "build as much as possible, but stop on the first test binary that fails" more awkward. We couldn't think of that as a significant use case that we would expect people to have, but we were also uncertain. I think if people want something like that behavior, they can do something like Does anyone have any objections to making that change? |
Counterproposal: delete The intended use cases for Deleting the flag leaves room for |
That also sounds reasonable to me! |
At the cargo meeting last week, we talked about David proposed a nice solution in #10496 (comment): delete I propose to stabilize For @rfcbot fcp merge |
Team member @weihanglo has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
I've recently been experimenting with First, could someone clarify to me when we "keep going" today and when we don't? Many times I do a build and I see failures from a lot of different packages but at other times, I only see them from the first (which is why I experimented with Similarly, I assume we don't "keep going" when the failure is just a lint and in theory the dependents could build. What should be the semantics in those cases and the messaging to be clear about this? |
One Cargo execution makes multiple executions of rustc, in general. Some of these rustc executions need to be serial, for example if one has an input rlib/rmeta artifact that is the output of the other. Some rustc executions can be done in parallel because neither one produces artifacts that are a transitive dependency of the other. Some rustc executions that can happen in parallel, are done serially anyway, because there are not enough cores on the machine to serve the inherent parallelism in the build graph. In general there is a directed acyclic graph of dependencies among the rustc executions in the build graph. Other build tools like Buck also have such a DAG. When some rustc returns a failure, the rest of the currently running rustc processes continue to run, and may also produce other failures. After some rustc returns a failure, additional rustc subprocesses are not started by cargo, even if they would not need to depend on any outputs from the failed rustc.
It depends on whether the 2 failing packages were buildable in parallel or not. This depends on whether they depend on one another, and also how the DAG is mapped to cores, with the latter being nondeterministic.
The dependents couldn't build because when a It may be reasonable to change Cargo to parse It may also be reasonable to introduce a rustc flag that makes it produce artifacts despite any denied lints, although I anticipate there would be pushback against this. There would be no problem making either of these changes in the future after initial stabilization of |
I'm a bit worried about how unclear the semantics are though improvements can be made later
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
|
Stabilize `--keep-going` Tracking issue with completed FCP: #10496
Closing since this was stabilized in #12568. Thanks everyone for your input on this 🎉🎉🎉 |
|
Current rust template uses stable-23.11 channel which has cargo 1.73.0, when the VSCode Rust Analyzer runs, it will check against `--keep-going` flag with the following error message error: the `--keep-going` flag is unstable, pass `-Z unstable-options` to enable it See rust-lang/cargo#10496 for more information about the `--keep-going` flag. To fix this error, we should add the `-Z unstable-options` flag in the cargo check command which Rust Analyzer runs on.
Summary
Implementation: #10383
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#keep-going
This flag makes Cargo build as many crates in the dependency graph as possible, rather than aborting the build at the first one that fails to build.
Unresolved Issues
-k
short flag? According to @joshtriplett: "similar tomake -k
; the nature of this option is such that it'd should be easy for people to invoke"Future Extensions
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
The text was updated successfully, but these errors were encountered: