-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 stabilizing "pipelined compilation" #60988
Comments
Reading the various issues and PRs, I got the impression that metadata is generated at earliest post static analysis, is that correct? |
Yes: metadata is now generated right at the start of code generation, immediately after all the checking (typeck, borrowck, etc.) finish. This is the best place for the initial pipelining implementation. One might argue that metadata generation should be moved earlier. That would help with successful builds, but slow down builds that trigger compile errors. Given that a lot of Rust compiler invocations end in compile errors during the normal development cycle, slowing down such invocations would be bad. Another possibility is to generate metadata in parallel with checking. That might give the best of both worlds. But that's a bigger change. |
No no... ;) At the start of code-gen sounds good to me and we should be cautious with moving it too much earlier as that can mess with language design. |
This is trivial to implement with |
It might be useful to have multiple rendered forms in the json output. |
…hton Make -Zemit-artifact-notifications also emit the artifact type This is easier for tooling to handle than trying to reverse-engineer the type from the filename extension. The field name and value is intended to reflect the `--emit` command-line option. Related issues rust-lang#60988 rust-lang#58465 cc @alexcrichton
…hton Make -Zemit-artifact-notifications also emit the artifact type This is easier for tooling to handle than trying to reverse-engineer the type from the filename extension. The field name and value is intended to reflect the `--emit` command-line option. Related issues rust-lang#60988 rust-lang#58465 cc @alexcrichton
I've proposed stabilization of |
I'd like to make sure there's a stable way to make sure that Context:
(cc @bolinfest) |
I agree that it should be the case, but that seems like a separable stabilization issue from this which is enabling Cargo's internal pipelined compilation. |
@alexcrichton IIUC it seems that pipelining always emits The immediate fix is to filter the injected |
@Xanewok that sounds reasonable to me yeah with the last option taking precedence! |
Update RLS Merged PRs: * fix(cmd): make clear_env_rust_log default to false (rust-lang/rls#1486) - Retain `RUST_LOG` in `rls --cli` mode * Pass --file-lines to rustfmt only if specified (rust-lang/rls#1497) - Fix entire-file formatting when using external rustfmt (specified via `rustfmt_path` config) * Ensure that --error-format is only passed once to `rustc` (rust-lang/rls#1500) - Unbreaks RLS when used together with Cargo [pipelining build](rust-lang#60988) feature (@alexcrichton I'd consider this a stabilization blocker, mind adding it to the tracking issue for the record? 🙇♂️ )
Update RLS Merged PRs: * fix(cmd): make clear_env_rust_log default to false (rust-lang/rls#1486) - Retain `RUST_LOG` in `rls --cli` mode * Pass --file-lines to rustfmt only if specified (rust-lang/rls#1497) - Fix entire-file formatting when using external rustfmt (specified via `rustfmt_path` config) * Ensure that --error-format is only passed once to `rustc` (rust-lang/rls#1500) - Unbreaks RLS when used together with Cargo [pipelining build](rust-lang#60988) feature (@alexcrichton I'd consider this a stabilization blocker, mind adding it to the tracking issue for the record? 🙇♂️ )
Update RLS Merged PRs: * fix(cmd): make clear_env_rust_log default to false (rust-lang/rls#1486) - Retain `RUST_LOG` in `rls --cli` mode * Pass --file-lines to rustfmt only if specified (rust-lang/rls#1497) - Fix entire-file formatting when using external rustfmt (specified via `rustfmt_path` config) * Ensure that --error-format is only passed once to `rustc` (rust-lang/rls#1500) - Unbreaks RLS when used together with Cargo [pipelining build](rust-lang#60988) feature (@alexcrichton I'd consider this a stabilization blocker, mind adding it to the tracking issue for the record? 🙇♂️ )
The two blocking issues are now in FCP:
and I have posted two PRs to stabilize the implementation: |
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
The NOTES.md link in the description is dead. |
This issue is intended to be an overall tracking issue for stabilizing the recently implemented feature of "pipelined compilation". This tracking issue spans both Cargo and rustc, as support currently lives in both. It also builds on top of a number of other tracking issues, since they're unstable features used to implement pipelined compilation!
For a bit of background, pipelined compilation has an initial set of notes about its implementation and initially had these tracking issues:
Currently today everything is implemented and available in nightly rustc. There is a thread on internals which is tasked with gaining user experience about pipelining and see the performance impact. A collation of these measurements is quite promising and I feel personally is convincing enough to push on stabilizing all the sub-features!
Known blockers for stabilization:
-Z emit-artifact-notifications
- this is how Cargo learns the moment metadata is ready.--json-rendered
- this is how Cargo continues to provide pretty error messages.--message-format=short
in Cargo with pipelining. The compiler currently has--error-format=json|short|human
, but for this feature in Cargo we'll need something like--error-format=short-json
or something like that. Basically some way to request that therendered
field in the JSON diagnostic is a "short message", not the long one.sccache
, this should be investigated and fixed one way or another. (fixed in Cache rmeta files whenever metadata is present in emit. mozilla/sccache#441)--error-format
flags (fixed in Update RLS #62176)Possible future work:
The text was updated successfully, but these errors were encountered: