Skip to content
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

bootstrap: Various Step refactors #111955

Merged
merged 8 commits into from
May 30, 2023
Merged

bootstrap: Various Step refactors #111955

merged 8 commits into from
May 30, 2023

Commits on May 29, 2023

  1. Give a more helpful error when calling cargo_crates_in_set for an a…

    …lias
    
    Before:
    ```
    thread 'main' panicked at 'no entry found for key', builder.rs:110:30
    ```
    
    After:
    ```
    thread 'main' panicked at 'missing crate for path library', check.rs:89:26
    ```
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    c571558 View commit details
    Browse the repository at this point in the history
  2. Allow checking individual crates

    This is useful for profiling metadata generation.
    
    This comes very close to removing all_krates, but doesn't quite -
    there's one last usage left in `doc`.
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    564e3ad View commit details
    Browse the repository at this point in the history
  3. Add a make_run_crates function and use it Rustc and Std

    This fixes the panic from the previous commit.
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    20372f1 View commit details
    Browse the repository at this point in the history
  4. Extend msg and description to work with any subcommand

    Previously `description` only supported `Testing` and `Benchmarking`,
    and `msg` gave weird results for `doc` (it would say `Docing`).
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    cb4b7f6 View commit details
    Browse the repository at this point in the history
  5. Switch doc::{Std, Rustc} to crate_or_deps

    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`
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    58e18dd View commit details
    Browse the repository at this point in the history
  6. Switch Steps from crates to crate_or_deps where possible

    and document why the single remaining place can't switch
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    3e765a7 View commit details
    Browse the repository at this point in the history
  7. Document ShouldRun::paths

    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    71770d5 View commit details
    Browse the repository at this point in the history
  8. Fix bugs in doc refactor

    - 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.
    jyn514 committed May 29, 2023
    Configuration menu
    Copy the full SHA
    c28ee60 View commit details
    Browse the repository at this point in the history