-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 stable -C emit-artifact-notifications
rustc flag
#60419
Comments
I'm working on diagnostic caching and have the same problem with the |
…ichton rustc: rename -Z emit-directives to -Z emit-artifact-notifications and simplify the output. This is my take on #60006 / #60419 (see #60006 (comment)). I'm not too attached the "notifications" part, it's pretty much bikeshed material. **EDIT**: for "artifact", @matklad pointed out Cargo already uses it (in #60464 (comment)) The first two commits are fixes that could be landed independently, especially the `compiletest` one, which removes the need for any of the normalization added in #60006 to land the test. The last commit enables the emission for all outputs, which was my main suggestion for #60006, mostly to show that it's minimal and not really a "scope creep" (as suggested in #60006 (comment)). cc @alexcrichton @nnethercote
-Z emit-directives
-Z emit-artifact-notification
-Z emit-artifact-notification
-Z emit-artifact-notifications
I'd like to propose FCP for this issue for stabilization. A summary of this feature to stabilize would be:
There's only one other unresolved question with cc @rust-lang/compiler, could I poke one of y'all to propose stabilization of this feature? |
@rfcbot fcp merge See above comment for summary. @alexcrichton could you also provide a link to the tests for this feature? |
Team member @cramertj 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. |
We could also enable this by default in JSON mode without a flag, to stabilize it. |
@cramertj sure yeah, there's a simple smoke test in the repository which asserts the output of the flag, and Cargo thoroughly also excercises this in pipelined compilation so it'd break very quickly if anything went awry. @eddyb I'd be fine with that as well! I would prefer to stabilize nothing and have Cargo simply use this internally with rustc, but that's not technically feasible right now. So long as Cargo has the option for this functionality I think that's ok. |
I don't think this is a codegen option, so it shouldn't go under |
@Zoxc hm I find that comment sort of curt and not super helpful. Do you have a suggestion of where it might go? Do you have a suggestion about simply enabling this by default in |
In #60987 (comment) I did mention I'd prefer if all the options related to the compiler's output were maybe grouped, like |
I tagged @michaelwoerister as they are on parental leave. |
ping @Zoxc, @nagisa, @petrochenkov, @pnkfelix, y'all mind taking a look at this? |
I think it would make sense to have an option which streams requested information to stdout in the form of JSON blobs, something like We could add to this list later if cargo, tools or IDEs want some more easily parsable information from rustc. |
@Zoxc do you intend to hold off on stabilization of this feature until that issue is resolved? That seems like a nice feature to have, but something we could always add after the fact. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
-Z emit-artifact-notifications
emit-artifact-notifications
rustc flag
emit-artifact-notifications
rustc flag-C emit-artifact-notifications
rustc flag
While we're waiting for FCP to finish, I've proposed an implementation of this stabilization at #62766 |
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. The RFC will be merged soon. |
This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in rust-lang#60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in rust-lang#60419 and rust-lang#60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes rust-lang#60419 Closes rust-lang#60987 Closes rust-lang#60988
…r=oli-obk rustc: Stabilize options for pipelined compilation This commit stabilizes options in the compiler necessary for Cargo to enable "pipelined compilation" by default. The concept of pipelined compilation, how it's implemented, and what it means for rustc are documented in #60988. This PR is coupled with a PR against Cargo (rust-lang/cargo#7143) which updates Cargo's support for pipelined compliation to rustc, and also enables support by default in Cargo. (note that the Cargo PR cannot land until this one against rustc lands). The technical changes performed here were to stabilize the functionality proposed in #60419 and #60987, the underlying pieces to enable pipelined compilation support in Cargo. The issues have had some discussion during stabilization, but the newly stabilized surface area here is: * A new `--json` flag was added to the compiler. * The `--json` flag can be passed multiple times. * The value of the `--json` flag is a comma-separated list of directives. * The `--json` flag cannot be combined with `--color` * The `--json` flag must be combined with `--error-format=json` * The acceptable list of directives to `--json` are: * `diagnostic-short` - the `rendered` field of diagnostics will have a "short" rendering matching `--error-format=short` * `diagnostic-rendered-ansi` - the `rendered` field of diagnostics will be colorized with ansi color codes embedded in the string field * `artifacts` - JSON blobs will be emitted for artifacts being emitted by the compiler The unstable `-Z emit-artifact-notifications` and `--json-rendered` flags have also been removed during this commit as well. Closes #60419 Closes #60987 Closes #60988
First added in #60006 the
-Z emit-directives
flag is currently intended to be paired with the--error-format=json
flag. Theemit-directives
flag indicates that the compiler will emit a JSON directive for various things it does, currently only for when an rmeta metadata file is produced.This issue is intended to track stabilizing this flag! The main use case for this is "pipelined compilation" which shows promise for accelerating Cargo's compile of multi-crate graphs.
Current known issues with this flag:
--message-format short
flag with this. Cargo will want to switch to-Z emit-directives
by default but--message-format short
in Cargo translates to--error-format short
in rustc, which means Cargo can't simultaneously get a directive JSON plus a short error format--emit
kind of that artifact also be emitted?cc @nnethercote
The text was updated successfully, but these errors were encountered: