about summary refs log tree commit diff
path: root/src/bootstrap/doc.rs
AgeCommit message (Collapse)AuthorLines
2023-06-29Rollup merge of #112234 - ozkanonur:hotfix, r=jyn514Matthias Krüger-9/+41
refactor `tool_doc!` resolves https://github.com/rust-lang/rust/pull/112211#discussion_r1215190510
2023-06-29refactor `tool_doc!` so that it can accept additional arguments.ozkanonur-9/+41
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-06-25Switch some more Steps to `builder.msg`jyn-11/+4
In particular, this hides compiletest suites under a dropdown - some builders are configured with `verbose-tests`, which makes the suites take up many thousands of lines. before: ``` Documenting stage1 cargo (x86_64-unknown-linux-gnu) Check compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) ``` after: ``` ::group::Documenting stage1 cargo (x86_64-unknown-linux-gnu) ::group::Testing stage1 compiletest suite=rustdoc-js mode=js-doc-test (x86_64-unknown-linux-gnu) ```
2023-06-10Auto merge of #112256 - jyn514:faster-mingw-check, r=Mark-Simulacrumbors-10/+13
Don't compile rustc to self-test compiletest This was changed from stage 0 to 1 in https://github.com/rust-lang/rust/pull/108905, but I'm not sure why. Change it to `top_stage` instead to allow people to choose the stage. This should save quite a bit of time in the `mingw-check` builder, which explicitly runs `x test --stage 0 compiletest`. Note that this also fixes a latent bug that depended on running `x build compiler` before `x doc compiler`, as well as a couple cleanups related to symlinks (which made the latent bug easier to find). cc `@pietroalbini`
2023-06-09Compile rustc_driver by defaultMatthew Esposito-1/+6
2023-06-03fix `x doc --stage 0 compiler` if the compiler hasn't yet been builtjyn-0/+1
2023-06-03don't return a `Result` from symlink_dir_forcejyn-9/+11
this gives a more helpful backtrace if it fails before: ``` thread 'main' panicked at 'symlink_dir_force(&builder.config, &out, &out_dir) failed with No such file or directory (os error 2)', doc.rs:697:9 ``` after: ``` thread 'main' panicked at 'symlink_dir(config, original, link) failed with No such file or directory (os error 2) ("failed to create link from /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/doc -> /home/jyn/src/rust2/build/x86_64-unknown-linux-gnu/compiler-doc")', doc.rs:975:5 ```
2023-06-03rename src/dst to original/linkjyn-5/+5
this is consistent with std and makes it much easier to understand what's actually happening
2023-06-02Rollup merge of #112211 - eval-exec:exec/fix-bootstrap-rustdoc, r=ozkanonurMichael Goulet-0/+1
pass `--lib` to `x doc` This PR want to close #112082
2023-06-03Add `--lib` to `cargo doc`Eval EXEC-0/+1
2023-05-31Fix the progress message for `x doc rustc`jyn-1/+1
This makes it more clear that we're using stage 0 *to document* rustc, not that we're documenting stage0 rustc itself. It also fixes a bug in `msg_sysroot_tool` that would print `Docing`, and removes the `Debug` impl for `Kind` to make sure it doesn't happen again. Before: ``` Documenting stage0 compiler {rustc-main} (aarch64-apple-darwin) ``` After: ``` Documenting compiler {rustc-main} (stage0 -> stage1, aarch64-apple-darwin) ```
2023-05-29Fix bugs in `doc` refactorjyn-25/+40
- Switch from `cargo rustdoc` to `cargo doc` This allows passing `-p` to multiple packages. - Remove `OsStr` support It doesn't work with RUSTDOCFLAGS, and we don't support non-utf8 paths anyway. - Pass `-p std` for each crate in the standard library By default cargo only documents the top-level crate, which is `sysroot` and has no docs.
2023-05-29Switch doc::{Std, Rustc} to `crate_or_deps`jyn-94/+79
Previously they were using `all_krates` and various hacks to determine which crates to document. Switch them to `crate_or_deps` so `ShouldRun` tells them which crate to document instead of having to guess. This also makes a few other refactors: - Remove the now unused `all_krates`; new code should only use `crate_or_deps`. - Add tests for documenting Std - Remove the unnecessary `run_cargo_rustdoc_for` closure so that we only run cargo once - Give a more helpful error message when documenting a no_std target - Use `builder.msg` in the Steps instead of `builder.info`
2023-05-25Generate docs for bootstrap itselfjyn-1/+4
This verifies the intra-doc links are correct, and hopefully makes things easier for new contributors.
2023-04-25Add a `sysroot` crate to represent the standard library cratesJohn Kåre Alsaker-1/+1
2023-04-10Fix `x check --stage 1` when `download-ci-llvm=false`Joshua Nelson-1/+1
2023-03-27Always set `RUSTC_BOOTSTRAP` with `x doc`clubby789-4/+5
2023-03-10bootstrap: document tidyAlex Huang-0/+1
2023-02-23make --open work on all booksPietro Albini-15/+20
2023-01-26also document hidden itemsPietro Albini-1/+1
2023-01-24add option to include private items in library docsPietro Albini-0/+3
2022-12-30Rollup merge of #106305 - jyn514:tail-args, r=Mark-SimulacrumMichael Goulet-1/+3
bootstrap: Get rid of tail_args in stream_cargo Based on https://github.com/rust-lang/rust/pull/106303 for convenience. r? ````@Mark-Simulacrum````
2022-12-30Use more consistent progress messages in bootstrapJoshua Nelson-1/+3
Before: ``` Testing ["rustc_interface"] stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) ``` After: ``` Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) ``` Note there is a slight consistency between `build` and `test`: The former doesn't print "compiler artifacts". It would be annoying to fix and doesn't hurt anything, so I left it be. ``` ; x t rustc_interface --stage 0 --dry-run Testing {rustc_interface} stage0 (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) ; x b rustc_interface --stage 0 --dry-run Building {rustc_interface} stage0 compiler artifacts (aarch64-unknown-linux-gnu -> aarch64-unknown-linux-gnu) ```
2022-12-29`./x doc library --open` opens `std`Lukas Markeffsky-1/+5
2022-12-22Support documenting CargoJoshua Nelson-11/+52
The primary motivation is to have the cargo docs show up on https://doc.rust-lang.org/nightly/nightly-rustc/cargo, but as a nice side effect this makes `x doc cargo` work locally.
2022-11-25rustbuild: Don't build doc::SharedAssets when building JSON docs.Nixon Enraght-Moony-1/+3
2022-11-23Rollup merge of #104286 - ozkanonur:fix-doc-bootstrap-recompilation, r=jyn514Dylan DPC-13/+8
copy doc output files by format This pr provides copying doc outputs by checking output format without removing output directory on each trigger. Resolves #103785
2022-11-20refactor doc copying processozkanonur-47/+9
Signed-off-by: ozkanonur <work@onurozkan.dev>
2022-11-13Make all download functions need only Config, not BuilderJoshua Nelson-3/+3
This also adds a new `mod download` instead of scattering the download code across `config.rs` and `native.rs`.
2022-11-13copy doc output files by format r=ozkanonurozkanonur-13/+46
Signed-off-by: ozkanonur <work@onurozkan.dev>
2022-11-12Distinguish `--dry-run` from the automatic dry run checkJoshua Nelson-5/+5
2022-11-06Rollup merge of #103851 - viandoxdev:103816_bootstrap_fix_json_doc, r=jyn514Matthias Krüger-51/+32
Fix json flag in bootstrap doc Fix the `--json` flag not working with x.py (Closes #103816) While this works I'm not sure about the `should_run` of `JsonStd`, had to change it because https://github.com/rust-lang/rust/blob/ab5a2bc7316012ee9b2a4a4f3821673f2677f3d5/src/bootstrap/builder.rs#L334 would match with JsonStd and remove the paths that Std matched. So I did [this](https://github.com/viandoxdev/rust/blob/ffd4078264c4892b5098d6191e0adfe3564d62ca/src/bootstrap/doc.rs#L526-L534) but that looks more like a hack/workaround than anything. I'm guessing there's something to do with the default condition thing but idk how it works
2022-11-05fix out dir being wrong in jsonviandoxdev-1/+5
2022-11-03address review commentPietro Albini-2/+5
2022-11-03move browser opening logic in BuilderPietro Albini-29/+11
This allows open() to be called from other places in bootstrap (I need this for Ferrocene), and it simplifies the callers by moving the "was_invoked_explicitly" check into the function.
2022-11-02prevent open with jsonviandoxdev-0/+5
2022-11-02merge JsonStd and Std stepsviandoxdev-55/+22
2022-11-01fix json running all the timeviandoxdev-2/+7
2022-11-01Fixes #103816 make --json workviandoxdev-1/+1
2022-10-31Auto merge of #102950 - oli-obk:check_miri, r=RalfJungbors-29/+6
Enable `x.py check` for miri Now that the miri subtree is working properly, let's add it to x.py check. cc `@rust-lang/miri`
2022-10-26Rollup merge of #102706 - ferrocene:pa-ignore-doc-index, r=jyn514Dylan DPC-18/+48
Support excluding the generation of the standalone docs For Ferrocene we need to exclude the generation of the standalone docs (which include the index page, which we want to replace with our own), but with the way bootstrap is currently implemented that proved not possible. This PR aims to support that. The first problem is that the `doc::Standalone` step did two things: it generated the "standalone" documentation (which includes the index page and all the pages at the root of the documentation tree), but it also generated some files like `rust.css` and `version_info.html` that other step like `doc::TheBook` required. This meant generating the book required generating the index page, which made disabling the index page generation problematic. The approach I took to fix the first problem is to split the step into `doc::Standalone` and `doc::SharedAssets`, with `doc::TheBook` now depending on `doc::SharedAssets`. The second problem is that disabling the `doc::Standalone` proved to be tricky due to its path, `src/doc`. The path is accurate, as the source files for that step are `src/doc/*.md`. The problem is, bootstrap treats `--exclude` as a *suffix*, and so it also excluded the Cargo book whose source lives at `src/tools/cargo/src/doc`. The approach I took to fix the second problem is to add the `standalone` path in addition to `src/doc`, so that you can pass `--exclude standalone`. I'm not fully happy with the solution, and the other idea I had was to just move the standalone docs source code to `src/doc/standalone`. I feel that second approach is cleaner, but also requires more changes and might require more consensus. This PR is best reviewed commit-by-commit. r? `@jyn514`
2022-10-24use the shared assets step for building std tooPietro Albini-1/+2
2022-10-18apply joshua's suggestionPietro Albini-1/+1
Co-authored-by: Joshua Nelson <github@jyn.dev>
2022-10-12Enable `x.py check` for miriOli Scherer-29/+6
2022-10-05add a "standalone" path for doc::Standalone to be able to exclude itPietro Albini-1/+1
Before this commit, the path for the doc::Standalone step was "src/doc", which is accurate as the standalone docs source files live at the root of the "src/doc" directory tree. Unfortunately, that caused bad interactions when trying to exclude it with `--exclude src/doc`. When an exclusion is passed to bootstrap, it will exclude all steps whose path *ends with* the exclusion, which results in the Cargo book (src/tools/cargo/src/doc) to also be excluded. To work around this problem, this commit adds the "standalone" path as an alternate path for doc::Standalone, allowing `--exclude standalone` to work without side effects.
2022-10-05split steps for generating the standalone docs and the shared assetsPietro Albini-16/+45
Before this commit, the step to generate the standalone docs (which included the index page and other HTML files at the root of the documentation) was bundled with the code copying files needed by multiple pieces of documentation. This means it wasn't possible to avoid generating the standalone docs. This commit splits the step into two, allowing the standalone docs generation to be excluded while still building the rest of the docs.
2022-09-24Move style guide to rust-lang/rustJosh Triplett-0/+1
Per [RFC 3309](https://rust-lang.github.io/rfcs/3309-style-team.html).
2022-09-19Auto merge of #101799 - LukeMathWalker:distribute-json-doc, r=jyn514bors-59/+153
Distribute json doc # Overview We add a new component, `rust-json-docs`, to distribute the JSON version of rustdoc's output for public compiler crates (i.e. `std`, `alloc`, `proc_macro`, `core` and `test`). As discussed in #101383, we do not bundle this up as part of the existing `rust-docs` component since `rustdoc`'s JSON format is still unstable. # Open questions / Doubts I tried my best, but I never touched this codebase and I couldn't find much documentation on how `dist` works - I pattern-matched existing code, which might have led to some non-sensical choices in the eyes of people more familiar with the codebase. In particular, I am not sure if my choice of adding a new config flag is appropriate or if the decision to build/not build the JSON docs is more appropriately gated by one of the existing flags. Any suggestion is more than welcome. Closes #101383
2022-09-17Add a new component, `rust-json-docs`, to distribute the JSON-formatted ↵Luca Palmieri-59/+153
documentation for std crates in nightly toolchains. We also add a new flag to `x doc`, `--json`, to render the JSON-formatted version alongside the HTML-formatted one.
2022-09-16Don't add rustdoc's CSS to other doc pagesJacob Hoffman-Andrews-8/+2
This was originally added so those doc pages could use the same font files, but it turns out to be fragile. And those doc pages are just stubs that link to other pages, so they don't need fancy fonts.