-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Add caching layer to bootstrap #142816
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
base: master
Are you sure you want to change the base?
Add caching layer to bootstrap #142816
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! I haven't checked the code yet, but once you get it working, it would be great to see some benchmarks. Ideally of "no-op" commands, like running x check rustc
after no change has been made to the compiler.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like you misunderstood what I meant and went in a different direction, sorry :) I tried to clarify in comments.
cf6a2c5
to
cd9224f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that std::process::Command
now provides a way to return all the inner state regarding arguments, env. variables, program and workdir. In that case, we don't need to store the cache key at all, and we can just reconstruct it from the inner std Command right before executing the bootstrap command.
0f9af82
to
043d094
Compare
This comment has been minimized.
This comment has been minimized.
043d094
to
821d695
Compare
This comment has been minimized.
This comment has been minimized.
821d695
to
f40c002
Compare
This comment has been minimized.
This comment has been minimized.
Seems like some cache hits are being encountered, that's good. Later it would be nice to also record the durations of individual commands and then print some statistics at the end, which commands took the longest to execute, how many cache hits/misses they had etc. |
f40c002
to
5735674
Compare
Code looks good now, but before we merge it, I think that we should go through existing commands and make sure that it won't be problematic to cache them. I'll go through bootstrap tomorrow and check. It would also be useful to add a comment on top of |
I will add that.. added here: a5df236 |
This comment has been minimized.
This comment has been minimized.
a5df236
to
bebe11d
Compare
Just to be sure, use Also, it's a big edge case, but calling |
Oops |
This PR modifies If appropriate, please update |
Thank you! Please squash the commits and I'll approve the PR. We'll see how it works in practice. |
ede9cb4
to
b7ad1eb
Compare
Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred in compiler/rustc_passes/src/check_attr.rs
cc @davidtwco, @compiler-errors, @TaKO8Ki Some changes occurred in compiler/rustc_attr_parsing
cc @davidtwco, @compiler-errors, @TaKO8Ki Some changes occurred in compiler/rustc_codegen_ssa rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi Some changes occurred in src/tools/rustfmt cc @rust-lang/rustfmt Some changes occurred in compiler/rustc_attr_data_structures Some changes occurred to the CTFE machinery Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs Some changes occurred in HTML/CSS/JS. cc @GuillaumeGomez, @jsha, @lolbinarycat Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
…e, remove extra caching logic from run and re-structure the changes
…ommand directly from bootstrap command inside start, and not via as_command_mut
b7ad1eb
to
ec765c3
Compare
This PR adds a caching layer to the bootstrap command execution context. It is still a work in progress but introduces the initial infrastructure for it.
r? @Kobzol