-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Don't bootstrap with rustdoc #43284
Comments
cc @Mark-Simulacrum would you be interested in tackling this? cc @aidanhs as well |
cc @GuillaumeGomez -- this would help you with your html diff problems |
Sure, we can do this. However, is it worth the investment today? AIUI, @steveklabnik is working on a rewrite that won't even be in-tree perhaps (or just a submodule). Should we wait for that? |
@Mark-Simulacrum I don't think there's any need to block, all of this work will need to happen anyway for a rewrite regardless. |
True. I'd prefer not to implement this myself on the current rustbuild, but I'd be happy to do it once we make a decision on the rewrite.
I'm not quite sure if this is what you meant to say -- this seems like a fairly large task; is the intent that we'd instead link against them via extern crate and the unstable feature gate rustc_private? |
Oh sorry I mean just literally delete these lines and nothing more. All those crates will be in the sysroot, so Cargo doesn't need to build them. |
I'm generally in support of this idea. @Mark-Simulacrum it is still very early days with that project; I wouldn't be taking anything about it into consideration when making decisions generally. |
As long as this also fixes #38318 then 👍. |
I approve! |
May (or may not) also have an effect on the proc macro issues in #41991. |
What would this change affect in terms of edit-compile-debug cycles on rustdoc or std documentation itself? I admit i don't know the placement of "tools" in terms of the build order, but it sounds like just working on rustdoc would have a longer single-setup time (since it would be part of "the final stage") but much shorter turnaround times (since you don't have to rebuild the world to get a working rustdoc)? How would this interact with the trick of using rustup to link a local toolchain that points to your local rustdoc? Would rustdoc now only appear in the As for regenerating std docs, how would this interact with that? When I'm working on rustdoc i like to test my changes on the std documentation so i don't have to write a purpose-built test crate for it. Putting rustdoc outside the regular staging could require some new considerations in regards to how it wants to rebuild dependencies of the crate you're documenting. I don't see these as pure blockers to getting this done, just things that may need to be taken into account as part of shaking out the rustbuild dependency graph and the |
@QuietMisdreavus it would make edit-compile faster on rustdoc because rustbuild wouldn't be fooled into thinking rustc depends on rustdoc. I would not improve edits to libstd documentation.
Actually it'll get faster!
Shouldn't affect it, the sysroot will still look the same.
Probably!
No better than it is today. |
I can't wait to have this update! |
Compile rustdoc on-demand Fixes #43284, fixes #38318, and fixes #39505. Doesn't directly help with #42686, since we need to rebuild just as much. In fact, this hurts it, since `./x.py doc --stage 0` will now fail. I'm not sure if it did before, but with these changes it runs into the problem where we attempt to use artifacts from bootstrap rustc with a non-bootstrap rustdoc, running into version conflicts. I believe this is solvable, but leaving for a future PR. This means that rustdoc will no longer be compiled when compiling rustc, by default. However, it is still built from `./x.py build` (for hosts, but not targets, since we don't produce compiler toolchains for them) and will be built for doc tests and crate tests. After this, the recommended workflow if you want a rustdoc is: `./x.py build --stage 1 src/tools/rustdoc` which will give you a working rustdoc in `build/triple/stage1/bin/rustdoc`. Note that you can add `src/libstd` onto the command to compile libstd as well so that the rustdoc can easily compile crates in the wild. `./x.py doc --stage 1 src/libstd` will document `libstd` with a freshly built rustdoc (if necessary), and will not rebuild rustc on modifications to rustdoc. r? @alexcrichton
Currently the
rustdoc
executable is bootstrapped in the same manner as rustc itself, meaning that we compilerustdoc
itself once per stage. This isn't really necessary though as we only really need to bootstrap the compiler! As a result dev times are slower (stage0/stage1 need to compile rustdoc) and overall CI times are slower (we compile it twice instead of once).I think we could instead move
rustdoc
tosrc/tools
and instead compile it in only one stage, the final stage. This'll involve a few changes such as:src/driver
(I think this is an old vestigate at this point anyway?src/tools/rustdoc
src/librustdoc
fromsrc/tools/rustdoc
src/tools/rustdoc/src/main.rs
a one-line shim torustdoc::main
librustc*
dependencies insrc/librustdoc/Cargo.toml
dist.rs
to account moving therustdoc
executable into place.The text was updated successfully, but these errors were encountered: