-
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
Implement "pipelined" rustc compilation (compiler side) #58465
Comments
For the rustc side of things I believe there's two primary work items to implement:
|
I'm able to get around this with |
I think that |
My first instinct would be to make rmeta generation a subcommand of the compiler, with the signal being the termination of the process. After that, the compiler can be re-invoked to create the rlib. The feasibility of that would depend on how much compiler state gets stored to disk during rmeta creation, and how much would get lost on exit that would have to be recreated on the second run, which I don't know much about. |
The produce-an-rlib-from-rmeta-inputs part needs to be done first and sounds like the larger piece of work. I would like to work on that. rust-lang/cargo#6660 has some discussion of the cargo/rustc interaction, pros and cons of different approaches. |
So it turns out I was remember a time long since passed, and my first bullet above is seemingly already done (@nnethercote is going to fully confirm). That means that actually all rustc needs to do is to somehow signal Cargo when a file is ready to go! I've talked with @nnethercote about this and I think he's going to work on implementing the JSON message idea (where rustc emits a JSON message whenever a file is ready for Cargo to consume). @ehuss FWIW rustc generates different rmeta files if you do |
Oh, indeed, it does seem to work! |
There is now WG-pipelining: https://github.com/rust-lang/compiler-team/tree/master/working-groups/pipelining I'm going to remove the nominated tag from this ticket. I don't know whether this ticket should be repurposed into a tracking issue for this work, or simply be closed. I'll leave that choice up to WG-pipelining. |
#60006 just landed, which implements the JSON message rustc gives to Cargo so that Cargo knows when metadata has been written. I'm now working on #60385, which will move metadata writing much earlier in the pipeline -- currently it happens right at the end, preventing much in the way of crate overlap that is the whole goal of pipelining. |
I've opened a dedicated tracking issue for stabilizing |
I've made a post on internals about evaluating pipelined compilation now that nightly Cargo/rustc both fully support pipelined compilation. |
Since this issue as listed is done, I'm going to close this in favor of a new tracking issue for stabilization - #60988 |
…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
@alexcrichton opened rust-lang/cargo#6660, which describes a scheme to do "pipelined" compilation. This issue represents the rustc side of that work. I'm opening it -- initially, at least -- so that I can nominate the issue and we can discuss in the compiler team meetings. It may then serve as the hub for any mentoring re: the rustc part of the equation.
I would like us to decide whether to do this work and how to integrate that into our overall planning (who will do the rustc part of the work? How hard is it? etc)
The text was updated successfully, but these errors were encountered: