Skip to content

Commit

Permalink
Unrolled build for rust-lang#137073
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789

boostrap: skip no_std targets in Std doc step

This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (NixOS/nixpkgs#382166).

When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592

Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g.

```
./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none

./x.py doc
```

Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
  • Loading branch information
rust-timer authored Feb 18, 2025
2 parents ce36a96 + ea10f8e commit 5614930
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap/src/core/build_steps/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,10 @@ impl Step for Std {

fn make_run(run: RunConfig<'_>) {
let crates = compile::std_crates_for_run_make(&run);
let target_is_no_std = run.builder.no_std(run.target).unwrap_or(false);
if crates.is_empty() && target_is_no_std {
return;
}
run.builder.ensure(Std {
stage: run.builder.top_stage,
target: run.target,
Expand Down

0 comments on commit 5614930

Please sign in to comment.